blob: bfbee0c44052016561bdd3faa70d9fb2116be8c8 [file] [log] [blame]
Gaurav Agrawalb102b012016-08-02 12:52:48 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Gaurav Agrawalb102b012016-08-02 12:52:48 +05303 *
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-Huaweiaf9c7a72016-08-30 19:43:39 +053017package org.onosproject.yms.ydt;
Gaurav Agrawalb102b012016-08-02 12:52:48 +053018
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 */
57public enum YmsOperationType {
58 /**
59 * The YANG based request is to edit a config node / subtree in the data
60 * store.
61 */
VinodKumarS-Huaweiaf9c7a72016-08-30 19:43:39 +053062 EDIT_CONFIG_REQUEST,
Gaurav Agrawalb102b012016-08-02 12:52:48 +053063
64 /**
65 * The YANG based request is to query a config node / subtree in the data
66 * store.
67 */
VinodKumarS-Huaweiaf9c7a72016-08-30 19:43:39 +053068 QUERY_CONFIG_REQUEST,
Gaurav Agrawalb102b012016-08-02 12:52:48 +053069
70 /**
71 * The YANG based request is to query a node / subtree in the data store.
72 */
VinodKumarS-Huaweiaf9c7a72016-08-30 19:43:39 +053073 QUERY_REQUEST,
Gaurav Agrawalb102b012016-08-02 12:52:48 +053074
75 /**
76 * The YANG based request is to execute an RPC defined in YANG.
77 */
VinodKumarS-Huaweiaf9c7a72016-08-30 19:43:39 +053078 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 Agrawalb102b012016-08-02 12:52:48 +053099
100 /**
101 * The YANG based request is to execute an RPC defined in YANG.
102 */
103 NOTIFICATION
104}