Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Foundation |
Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +0530 | [diff] [blame] | 17 | package org.onosproject.yms.ydt; |
Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 18 | |
| 19 | /** |
| 20 | * Represents type of root level operation for the request. |
| 21 | * |
| 22 | * This is used by protocols to specify the root level operation associated |
| 23 | * with the request. YMS data validation and data handling will vary based |
| 24 | * on the edit operation type, for an instance YANG specified "mandatory" |
| 25 | * leafs needn't be present for QUERY_CONFIG and QUERY, but they may be |
| 26 | * mandatory to be present in request for EDIT_CONFIG type. The validation |
| 27 | * and handling is further dependent on edit operation type. |
| 28 | * |
| 29 | * In SBI, driver/provider must provide this information to YMS which needs |
| 30 | * to encode this information in corresponding data format. |
| 31 | * |
| 32 | * YmsOperationType MUST be specified by protocol. |
| 33 | */ |
| 34 | |
| 35 | /* |
| 36 | * Yang interaction type with RESTCONF and NETCONF as example: |
| 37 | * +--------------+-------------------+-------------+ |
| 38 | * | RESTCONF | NETCONF | EditOpType | |
| 39 | * +--------------+-------------------+-------------+ |
| 40 | * | OPTIONS | NA | NA | |
| 41 | * | HEAD | NA | NA | |
| 42 | * | GET | <get> | QUERY | |
| 43 | * | none | <get-config> | QUERY_CONFIG| |
| 44 | * | POST (data) | <edit-config> | EDIT_CONFIG | |
| 45 | * | PUT | <edit-config> | EDIT_CONFIG | |
| 46 | * | PATCH | <edit-config> | EDIT_CONFIG | |
| 47 | * | DELETE | <edit-config> | EDIT_CONFIG | |
| 48 | * | POST (op) | <rpc> | RPC | |
| 49 | * +--------------+-------------------+-------------+ |
| 50 | * |
| 51 | * Note: Additionally RESTCONF must use API resource to figure out whether |
| 52 | * request contains data resource or it's for data model specific operation. |
| 53 | * +--rw restconf |
| 54 | * +--rw data |
| 55 | * +--rw operations |
| 56 | */ |
| 57 | public enum YmsOperationType { |
| 58 | /** |
| 59 | * The YANG based request is to edit a config node / subtree in the data |
| 60 | * store. |
| 61 | */ |
VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +0530 | [diff] [blame] | 62 | EDIT_CONFIG_REQUEST, |
Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 63 | |
| 64 | /** |
| 65 | * The YANG based request is to query a config node / subtree in the data |
| 66 | * store. |
| 67 | */ |
VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +0530 | [diff] [blame] | 68 | QUERY_CONFIG_REQUEST, |
Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * The YANG based request is to query a node / subtree in the data store. |
| 72 | */ |
VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +0530 | [diff] [blame] | 73 | QUERY_REQUEST, |
Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 74 | |
| 75 | /** |
| 76 | * The YANG based request is to execute an RPC defined in YANG. |
| 77 | */ |
VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +0530 | [diff] [blame] | 78 | RPC_REQUEST, |
| 79 | |
| 80 | /** |
| 81 | * The YANG based response is for edit operation. |
| 82 | */ |
| 83 | EDIT_CONFIG_REPLY, |
| 84 | |
| 85 | /** |
| 86 | * The YANG based response is for query config operation. |
| 87 | */ |
| 88 | QUERY_CONFIG_REPLY, |
| 89 | |
| 90 | /** |
| 91 | * The YANG based response is for query operation. |
| 92 | */ |
| 93 | QUERY_REPLY, |
| 94 | |
| 95 | /** |
| 96 | * The YANG based response is for a RPC operation. |
| 97 | */ |
| 98 | RPC_REPLY, |
Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 99 | |
| 100 | /** |
| 101 | * The YANG based request is to execute an RPC defined in YANG. |
| 102 | */ |
| 103 | NOTIFICATION |
| 104 | } |