blob: e64fef179328918eda568ebeef4e591c4b3b35e3 [file] [log] [blame]
Khen Nursimulu7626ce12016-12-21 11:51:46 -05001// Copyright (c) 2015, Google Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// This file contains annotation definitions that can be used to describe
16// a configuration tree.
17
18syntax = "proto3";
19
20package voltha;
21
22import "google/protobuf/descriptor.proto";
23
24enum MessageParserOption {
25 // Move any enclosing child enum/message definition to the same level
26 // as the parent (this message) in the yang generated file
27 MOVE_TO_PARENT_LEVEL= 0;
28
29 // Create both a grouping and a container for this message. The container
30 // name will be the message name. The grouping name will be the message
31 // name prefixed with "grouping_"
32 CREATE_BOTH_GROUPING_AND_CONTAINER = 1;
33}
34
35message InlineNode {
36 string id = 1;
37 string type = 2;
38}
39
Khen Nursimulu3676b7c2017-01-31 13:48:38 -050040message RpcReturnDef {
41 // The gRPC methods return message types. NETCONF expects an actual
42 // attribute as defined in the YANG schema. The xnl_tag will be used
43 // as the top most tag when translating a gRPC response into an xml
44 // response
45 string xml_tag = 1;
46
47 // When the gRPC response is a list of items, we need to differentiate
48 // between a YANG schema attribute whose name is "items" and when "items"
49 // is used only to indicate a list of items is being returned. The default
50 // behavior assumes a list is returned when "items" is present in
51 // the response. This option will therefore be used when the attribute
52 // name in the YANG schema is 'items'
53 string list_items_name = 2;
54}
55
Khen Nursimulu7626ce12016-12-21 11:51:46 -050056extend google.protobuf.MessageOptions {
57 // This annotation is used to indicate how a message is parsed when
58 // converting from proto to yang format.
59 MessageParserOption yang_child_rule = 7761774;
60
61 MessageParserOption yang_message_rule = 7761775;
62}
63
64extend google.protobuf.FieldOptions {
65 // If present, the field (a message reference) should be replaced by the
66 // message itself. For now, this applies only to non-repeated fields.
67 InlineNode yang_inline_node = 7761776;
68}
Khen Nursimulu3676b7c2017-01-31 13:48:38 -050069
70extend google.protobuf.MethodOptions {
71 RpcReturnDef yang_xml_tag = 7761777;
72}