Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | // 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 | |
| 18 | syntax = "proto3"; |
| 19 | |
| 20 | option go_package = "github.com/opencord/voltha-go/protos/common"; |
| 21 | |
| 22 | package voltha; |
| 23 | |
| 24 | import "google/protobuf/descriptor.proto"; |
| 25 | |
| 26 | enum MessageParserOption { |
| 27 | // Move any enclosing child enum/message definition to the same level |
| 28 | // as the parent (this message) in the yang generated file |
| 29 | MOVE_TO_PARENT_LEVEL= 0; |
| 30 | |
| 31 | // Create both a grouping and a container for this message. The container |
| 32 | // name will be the message name. The grouping name will be the message |
| 33 | // name prefixed with "grouping_" |
| 34 | CREATE_BOTH_GROUPING_AND_CONTAINER = 1; |
| 35 | } |
| 36 | |
| 37 | message InlineNode { |
| 38 | string id = 1; |
| 39 | string type = 2; |
| 40 | } |
| 41 | |
| 42 | message RpcReturnDef { |
| 43 | // The gRPC methods return message types. NETCONF expects an actual |
| 44 | // attribute as defined in the YANG schema. The xnl_tag will be used |
| 45 | // as the top most tag when translating a gRPC response into an xml |
| 46 | // response |
| 47 | string xml_tag = 1; |
| 48 | |
| 49 | // When the gRPC response is a list of items, we need to differentiate |
| 50 | // between a YANG schema attribute whose name is "items" and when "items" |
| 51 | // is used only to indicate a list of items is being returned. The default |
| 52 | // behavior assumes a list is returned when "items" is present in |
| 53 | // the response. This option will therefore be used when the attribute |
| 54 | // name in the YANG schema is 'items' |
| 55 | string list_items_name = 2; |
| 56 | } |
| 57 | |
| 58 | extend google.protobuf.MessageOptions { |
| 59 | // This annotation is used to indicate how a message is parsed when |
| 60 | // converting from proto to yang format. |
| 61 | MessageParserOption yang_child_rule = 7761774; |
| 62 | |
| 63 | MessageParserOption yang_message_rule = 7761775; |
| 64 | } |
| 65 | |
| 66 | extend google.protobuf.FieldOptions { |
| 67 | // If present, the field (a message reference) should be replaced by the |
| 68 | // message itself. For now, this applies only to non-repeated fields. |
| 69 | InlineNode yang_inline_node = 7761776; |
| 70 | } |
| 71 | |
| 72 | extend google.protobuf.MethodOptions { |
| 73 | RpcReturnDef yang_xml_tag = 7761777; |
| 74 | } |