diff --git a/rpc/openconfig/LICENSE b/rpc/openconfig/LICENSE deleted file mode 100644 index 8f71f43..0000000 --- a/rpc/openconfig/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/rpc/openconfig/README.md b/rpc/openconfig/README.md deleted file mode 100644 index 6fd8a31..0000000 --- a/rpc/openconfig/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# openconfig.proto - -**Note: This package is deprecated - and has been replaced with the gRPC Network -Management Interface**. The gNMI specification can be found in -[openconfig/reference](https://github.com/openconfig/reference/tree/master/rpc/gnmi), -and the protobuf service definition and reference code in -[openconfig/gnmi](https://github.com/openconfig/gnmi). - ---- - -The openconfig package defines a [gRPC](http://www.grpc.io/) service for interacting with network devices -based on OpenConfig models. - -This package and its contents are a *work-in-progress* and subject to change. It is provided -as an example implementation of the -[OpenConfig RPC reference specification](available at github.com/openconfig/public/tree/master/release/models/rpc) -but also contains some additional capabilities not included in the base -RPC specification. - -*Note: this is not an official Google product* - -# Howto Generate the OpenConfig proto -* [Protocol buffer overview](https://developers.google.com/protocol-buffers) -* [Install protoc](https://developers.google.com/protocol-buffers/docs/proto3#generating) - * Make sure you use the protoc version 3.0.0 currently this is only available on github. - ``` - git clone https://github.com/google/protobuf - ``` -* Install any language specific generators and compile the proto. - * Go based installation instructions - * [How to compile proto for Go](https://developers.google.com/protocol-buffers/docs/gotutorial#compiling-your-protocol-buffers) - * Compile the proto. - ``` - cd $WORKSPACE - protoc -I . github.com/openconfig/reference/rpc/openconfig/openconfig.proto --go_out=plugins=grpc:. - ``` - * C++ based installation instructions - * [How to compile proto for C++](https://developers.google.com/protocol-buffers/docs/cpptutorial#compiling-your-protocol-buffers) - * [Install gRPC plugin](https://github.com/grpc/grpc/blob/release-0_13/INSTALL.md) - * Compile the proto. - ``` - cd $WORKSPACE - protoc -I ./ --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` github.com/openconfig/reference/rpc/openconfig/openconfig.proto - protoc -I ./ --cpp_out=. github.com/openconfig/reference/rpc/openconfig/openconfig.proto - ``` - * Python based installation instructions - * [How to compile proto for python](https://developers.google.com/protocol-buffers/docs/pythontutorial#compiling-your-protocol-buffers) - * [Install gRPC plugin](https://github.com/grpc/grpc/blob/release-0_13/INSTALL.md) - * Compile the proto. - ``` - cd $WORKSPACE - protoc -I. --python_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_python_plugin` github.com/openconfig/reference/rpc/openconfig/openconfig.proto - ``` diff --git a/rpc/openconfig/openconfig.pb.go b/rpc/openconfig/openconfig.pb.go deleted file mode 100644 index b63d23c..0000000 --- a/rpc/openconfig/openconfig.pb.go +++ /dev/null @@ -1,1784 +0,0 @@ -// Code generated by protoc-gen-go. -// source: github.com/openconfig/reference/rpc/openconfig/openconfig.proto -// DO NOT EDIT! - -/* -Package openconfig is a generated protocol buffer package. - -Package openconfig defines the gRPC service for getting and setting the -configuration and state data of a network target based on OpenConfig models. - -This package and its contents is a work-in-progress. It is meant as a -example implementation of the OpenConfig RPC reference specification -(available at github.com/openconfig/public/tree/master/release/models/rpc) -but also contains some additional capabilities not included in the base -RPC specification. - - -It is generated from these files: - github.com/openconfig/reference/rpc/openconfig/openconfig.proto - -It has these top-level messages: - Notification - Update - Path - Value - GetModelsRequest - ModelQuery - GetModelsResponse - ModelData - GetRequest - GetResponse - SetRequest - SetResponse - UpdateResponse - Error - SubscribeRequest - SubscriptionList - Subscription - QOSMarking - AliasList - Alias - PollRequest - Proxies - Proxy - SubscribeResponse - Heartbeat - UDPWrapper -*/ -package openconfig - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import google_protobuf "github.com/golang/protobuf/ptypes/any" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// A Type describes what format a Value's data is encoded in. -type Type int32 - -const ( - Type_JSON Type = 0 - Type_BYTES Type = 1 - Type_PROTO Type = 2 -) - -var Type_name = map[int32]string{ - 0: "JSON", - 1: "BYTES", - 2: "PROTO", -} -var Type_value = map[string]int32{ - "JSON": 0, - "BYTES": 1, - "PROTO": 2, -} - -func (x Type) String() string { - return proto.EnumName(Type_name, int32(x)) -} -func (Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -// SubscriptionMode mode informs the target how notifications should be -// delivered, as they change or coalesced. When the mode is TARGET_DEFINED the -// target chooses the mode the best suits the value. When the mode is -// ON_CHANGE, the target must send a notification each time the value changes. -// When the mode is SAMPLE, the target send notifications at some sampling -// interval. -type SubscriptionMode int32 - -const ( - SubscriptionMode_TARGET_DEFINED SubscriptionMode = 0 - SubscriptionMode_ON_CHANGE SubscriptionMode = 1 - SubscriptionMode_SAMPLE SubscriptionMode = 2 -) - -var SubscriptionMode_name = map[int32]string{ - 0: "TARGET_DEFINED", - 1: "ON_CHANGE", - 2: "SAMPLE", -} -var SubscriptionMode_value = map[string]int32{ - "TARGET_DEFINED": 0, - "ON_CHANGE": 1, - "SAMPLE": 2, -} - -func (x SubscriptionMode) String() string { - return proto.EnumName(SubscriptionMode_name, int32(x)) -} -func (SubscriptionMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -// Type selects to return only the summary model information or -// the full YANG model as bytes. The caller is responsible for extracting the -// YANG model from the bytes. -type GetModelsRequest_Type int32 - -const ( - GetModelsRequest_SUMMARY GetModelsRequest_Type = 0 - GetModelsRequest_DETAIL GetModelsRequest_Type = 1 -) - -var GetModelsRequest_Type_name = map[int32]string{ - 0: "SUMMARY", - 1: "DETAIL", -} -var GetModelsRequest_Type_value = map[string]int32{ - "SUMMARY": 0, - "DETAIL": 1, -} - -func (x GetModelsRequest_Type) String() string { - return proto.EnumName(GetModelsRequest_Type_name, int32(x)) -} -func (GetModelsRequest_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} } - -type ModelData_Type int32 - -const ( - ModelData_MODULE ModelData_Type = 0 - ModelData_BUNDLE ModelData_Type = 1 - ModelData_AUGMENTATION ModelData_Type = 3 - ModelData_DEVIATION ModelData_Type = 4 -) - -var ModelData_Type_name = map[int32]string{ - 0: "MODULE", - 1: "BUNDLE", - 3: "AUGMENTATION", - 4: "DEVIATION", -} -var ModelData_Type_value = map[string]int32{ - "MODULE": 0, - "BUNDLE": 1, - "AUGMENTATION": 3, - "DEVIATION": 4, -} - -func (x ModelData_Type) String() string { - return proto.EnumName(ModelData_Type_name, int32(x)) -} -func (ModelData_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } - -// Type defines the mode that Get should use (GET_TYPE in the -// RPC specification YANG schema). -type GetRequest_Type int32 - -const ( - GetRequest_ALL GetRequest_Type = 0 - GetRequest_CONFIG GetRequest_Type = 1 - GetRequest_STATE GetRequest_Type = 2 - GetRequest_OPERATIONAL GetRequest_Type = 3 -) - -var GetRequest_Type_name = map[int32]string{ - 0: "ALL", - 1: "CONFIG", - 2: "STATE", - 3: "OPERATIONAL", -} -var GetRequest_Type_value = map[string]int32{ - "ALL": 0, - "CONFIG": 1, - "STATE": 2, - "OPERATIONAL": 3, -} - -func (x GetRequest_Type) String() string { - return proto.EnumName(GetRequest_Type_name, int32(x)) -} -func (GetRequest_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{8, 0} } - -type UpdateResponse_Operation int32 - -const ( - UpdateResponse_NOT_SPECIFIED UpdateResponse_Operation = 0 - UpdateResponse_DELETE UpdateResponse_Operation = 1 - UpdateResponse_REPLACE UpdateResponse_Operation = 2 - UpdateResponse_UPDATE UpdateResponse_Operation = 3 -) - -var UpdateResponse_Operation_name = map[int32]string{ - 0: "NOT_SPECIFIED", - 1: "DELETE", - 2: "REPLACE", - 3: "UPDATE", -} -var UpdateResponse_Operation_value = map[string]int32{ - "NOT_SPECIFIED": 0, - "DELETE": 1, - "REPLACE": 2, - "UPDATE": 3, -} - -func (x UpdateResponse_Operation) String() string { - return proto.EnumName(UpdateResponse_Operation_name, int32(x)) -} -func (UpdateResponse_Operation) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{12, 0} } - -type SubscriptionList_Mode int32 - -const ( - SubscriptionList_STREAM SubscriptionList_Mode = 0 - SubscriptionList_ONCE SubscriptionList_Mode = 1 - SubscriptionList_POLL SubscriptionList_Mode = 2 -) - -var SubscriptionList_Mode_name = map[int32]string{ - 0: "STREAM", - 1: "ONCE", - 2: "POLL", -} -var SubscriptionList_Mode_value = map[string]int32{ - "STREAM": 0, - "ONCE": 1, - "POLL": 2, -} - -func (x SubscriptionList_Mode) String() string { - return proto.EnumName(SubscriptionList_Mode_name, int32(x)) -} -func (SubscriptionList_Mode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{15, 0} } - -// A Notification is a list of updates to apply. Deletes are a list of paths to -// delete as long as their data is older than timestamp. Deleting nodes deletes -// all values below the node that are older than timestamp. Deletes are -// performed after updates are applied. Delete paths are created by -// concatenating the prefix, if present, with the individual paths. -// -// Timestamps are always represented as nanoseconds since UNIX epoch, -// Jan 1 1970 00:00:00 UTC. Targets which are incapable of generating nanosecond -// resolution are expected to round the timestamp to the highest supported -// resolution. -// -// Update paths are created by concatenating the prefix, if present, with the -// paths contained in the Updates. -// -// It is valid to have a path be in both an update and a delete. The -// deletion will only delete values that are older than this update. -// -// Each notification should contain at most a single update for a given path. -// If a nonconforming implementation does send multiple updates for a given path -// in a single notification, all but the final update should be ignored. -// -// The prefix should normally be the longest common prefix to all the individual -// update and delete paths. This reduces the repetition of the common prefix in -// each update and/or delete. The individual updates and deletes also are a -// Path (repeated list of elements), allowing a notification such as: -// -// prefix: /a/b/c -// update: { -// path: d -// value: x -// } -// update: { -// path: e/f -// value: y -// } -// update: { -// path: e/g -// value: z -// } -// -// The prefix may begin with an alias. An alias is a Path with 1 or more -// elements, which maps to another Path. Aliases may be defined by either the -// target or the client. Target defined aliases are limited to a single -// element. Aliases are client specific (though a target may define the same -// alias for multiple clients). -// -// The target defines an alias by sending a Notification that has alias set and -// a non-empty prefix. When alias is set, a Notification need not provide -// updates or deletes. If the alias was previously defined, it is over ridden -// with the new definition. Once defined, the target may send the value of -// alias as the first element of a prefix. A target must not send target -// defined aliases to clients that do not specify the use_aliases option in the -// initial SubscriptionList message. A target does not need to define aliases -// even if the client does specify the use_aliases option in the initial -// SubscriptionLlist message. -// -// Clients define aliases by sending a SubscriptionRequest with aliases set. -// -// A target should use a defined alias when possible, but is not required to. A -// target may ignore client defined aliases. -// -// -// Clients should not define aliases that are valid paths in the data -// tree. The target must not define aliases that are valid paths in the -// data tree. -// -// If a target sends a notification with alias set, but not prefix, then it is -// indicating it will no longer use this alias. The client may delete this -// alias from its list of aliases. A target may not delete an alias defined by -// the client. It is implementation dependent on what happens if the client -// defines an alias that is also defined by the target. -// -// Aliases must not be used in UDP packets. -// -// If a client sets the use_aliases option, or defines aliases, in the initial -// SubscriptionList message, then it must always check the initial elements of a -// prefix against the list of known aliases, expanding the prefix as needed. -// Aliases must always be defined as fully expanded prefixes. Only single alias -// lookup is needed per Notification. -// -// Target defined aliases may be any unique string. A target may choose to use -// a unique prefix for aliases to make them visually distinct. For example, a -// target might construct all aliases as an @ character followed by a decimal or -// hexadecimal number (perhaps a hashed address in memory). -// -// Example: -// -// Define @42 as an alias: -// -// timestamp: 1439416376123456789 -// prefix: "this_is" -// prefix: "a_long" -// prefix: "prefix" -// alias: "@42 -// -// Use @42 as an alias to set /this_is/a_long/prefix/Ethernet0/0/1/in-octets to -// 17: -// -// timestamp: 1439416376456456456 -// prefix: "@42" -// prefix: "Ethernet0/0/1" -// update: { -// path: { -// element: "in-octets" -// } -// value: 17 -// } -// -// Delete the alias @42: -// -// timestamp: 1439416376987654321 -// alias: @42 -type Notification struct { - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - Prefix *Path `protobuf:"bytes,2,opt,name=prefix" json:"prefix,omitempty"` - Alias string `protobuf:"bytes,3,opt,name=alias" json:"alias,omitempty"` - Update []*Update `protobuf:"bytes,4,rep,name=update" json:"update,omitempty"` - Delete []*Path `protobuf:"bytes,5,rep,name=delete" json:"delete,omitempty"` -} - -func (m *Notification) Reset() { *m = Notification{} } -func (m *Notification) String() string { return proto.CompactTextString(m) } -func (*Notification) ProtoMessage() {} -func (*Notification) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Notification) GetPrefix() *Path { - if m != nil { - return m.Prefix - } - return nil -} - -func (m *Notification) GetUpdate() []*Update { - if m != nil { - return m.Update - } - return nil -} - -func (m *Notification) GetDelete() []*Path { - if m != nil { - return m.Delete - } - return nil -} - -// An Update maps a path to a value. -// -// In a Notification, an Update represents a new or updated value for path. The -// absolute path name is the concatenation of the Notification prefix and the -// Update path. Updates are only sent by the target. Path must always specify -// a leaf node. Value should be a scalar value (e.g., if Value is JSON encoded -// then the value 123 is acceptable, but {"x":123} is not). -// -// In a SetRequest, an Update contains a path to a read-write node and an -// optional value. The absolute path name is the concatenation of the -// SetRequest prefix and the Update path The path may reference either a -// directory or leaf node. If value is not present then path, and all its -// subelements, should be removed. If value set and path references a directory -// node, the value is the JSON encoded tree of values below that node, -// otherwise, if the value is a scalar and may be encoded in JSON are as raw -// BYTES. the value -// -// For an example of updating a directory node, consider a tree that has the -// following values: -// -// /a/b/c: 1 -// /a/b/d: 2 -// /a/b/e: 3 -// -// And an Update of -// -// Path: /a/b -// Value: "{c: 4, f: 5}" -// -// The result is that /a/b/d and /a/b/e are removed, /a/b/c now has the value of -// 4, and /a/b/f is added with the value of 5. -type Update struct { - Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` - Value *Value `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` -} - -func (m *Update) Reset() { *m = Update{} } -func (m *Update) String() string { return proto.CompactTextString(m) } -func (*Update) ProtoMessage() {} -func (*Update) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Update) GetPath() *Path { - if m != nil { - return m.Path - } - return nil -} - -func (m *Update) GetValue() *Value { - if m != nil { - return m.Value - } - return nil -} - -// A Path represents an OpenConfig path as a list of strings, one path element -// per string. -type Path struct { - Element []string `protobuf:"bytes,1,rep,name=element" json:"element,omitempty"` -} - -func (m *Path) Reset() { *m = Path{} } -func (m *Path) String() string { return proto.CompactTextString(m) } -func (*Path) ProtoMessage() {} -func (*Path) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -// A Value is either raw data or a JSON encoded value. An enumerated value is -// of type JSON, with the numeric value in the value field and the name of the -// enumerated value in the name field. -type Value struct { - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Type Type `protobuf:"varint,2,opt,name=type,enum=openconfig.Type" json:"type,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` -} - -func (m *Value) Reset() { *m = Value{} } -func (m *Value) String() string { return proto.CompactTextString(m) } -func (*Value) ProtoMessage() {} -func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -// GetModelsRequest contains a list of models to return. If no queries are -// specified, all currently support models will be returned. ModelReturnType -// specifies the format of the model to return. By default, only summaries will -// be returned. -type GetModelsRequest struct { - RequestType GetModelsRequest_Type `protobuf:"varint,1,opt,name=request_type,json=requestType,enum=openconfig.GetModelsRequest_Type" json:"request_type,omitempty"` - Query *ModelQuery `protobuf:"bytes,2,opt,name=query" json:"query,omitempty"` -} - -func (m *GetModelsRequest) Reset() { *m = GetModelsRequest{} } -func (m *GetModelsRequest) String() string { return proto.CompactTextString(m) } -func (*GetModelsRequest) ProtoMessage() {} -func (*GetModelsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *GetModelsRequest) GetQuery() *ModelQuery { - if m != nil { - return m.Query - } - return nil -} - -// ModelQuery contains a name and/or namespace regex pattern to match against -// supported models on the system. -type ModelQuery struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace" json:"namespace,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` -} - -func (m *ModelQuery) Reset() { *m = ModelQuery{} } -func (m *ModelQuery) String() string { return proto.CompactTextString(m) } -func (*ModelQuery) ProtoMessage() {} -func (*ModelQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -// GetModelsResponse returns a list of models supported by the system. -type GetModelsResponse struct { - // List of models supported by the system. - Models []*ModelData `protobuf:"bytes,1,rep,name=models" json:"models,omitempty"` -} - -func (m *GetModelsResponse) Reset() { *m = GetModelsResponse{} } -func (m *GetModelsResponse) String() string { return proto.CompactTextString(m) } -func (*GetModelsResponse) ProtoMessage() {} -func (*GetModelsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -func (m *GetModelsResponse) GetModels() []*ModelData { - if m != nil { - return m.Models - } - return nil -} - -// ModelData contains the summary information for the model as well as the -// actual model data if requested. -type ModelData struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace" json:"namespace,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - ModelType ModelData_Type `protobuf:"varint,5,opt,name=model_type,json=modelType,enum=openconfig.ModelData_Type" json:"model_type,omitempty"` -} - -func (m *ModelData) Reset() { *m = ModelData{} } -func (m *ModelData) String() string { return proto.CompactTextString(m) } -func (*ModelData) ProtoMessage() {} -func (*ModelData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } - -// A GetRequest requests all the values identified by path be returns in a -// single GetResponse message. -// -// If cache_interval is provided and is non-zero number of nanoseconds, it is -// a hint of when this get request will be repeated in the future. -type GetRequest struct { - Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` - Path []*Path `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` - Type GetRequest_Type `protobuf:"varint,3,opt,name=type,enum=openconfig.GetRequest_Type" json:"type,omitempty"` - CacheInterval int64 `protobuf:"varint,4,opt,name=cache_interval,json=cacheInterval" json:"cache_interval,omitempty"` -} - -func (m *GetRequest) Reset() { *m = GetRequest{} } -func (m *GetRequest) String() string { return proto.CompactTextString(m) } -func (*GetRequest) ProtoMessage() {} -func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } - -func (m *GetRequest) GetPrefix() *Path { - if m != nil { - return m.Prefix - } - return nil -} - -func (m *GetRequest) GetPath() []*Path { - if m != nil { - return m.Path - } - return nil -} - -type GetResponse struct { - Notification []*Notification `protobuf:"bytes,1,rep,name=notification" json:"notification,omitempty"` -} - -func (m *GetResponse) Reset() { *m = GetResponse{} } -func (m *GetResponse) String() string { return proto.CompactTextString(m) } -func (*GetResponse) ProtoMessage() {} -func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } - -func (m *GetResponse) GetNotification() []*Notification { - if m != nil { - return m.Notification - } - return nil -} - -// A SetRequest contains an optional prefix, a list of zero or more Paths to -// delete, a list of zero or more paths to replace, and a list of zero of more -// paths to update. Deletes should appear to happen first, followed by -// replacements, followed by updates. -// -// If the path lists a node, rather than leaf, the value is presented in JSON. -// When included in replace, it is as if the path was first deleted. When -// included in update, the value augments the existing value, if any. -// -// The target must either apply all the deletes, replacements, and updates or -// return an error. The deletes, replacements, and updates should appear to be -// atomically applied. -// -// Non-existing but otherwise valid paths are valid for all operations. Deletes -// to a non-existing path are a no-op. Updates and replaces to a non-existing -// path will create a path with its values set to values contained in the -// Update. Any unspecified values will be set to system defaults. -// -// Example: -// A SetRequest consisting of a single replace, which has a Path of "/" -// and a Value of the full current configuration of a target, in JSON, should -// not result in any state changes on the system. -type SetRequest struct { - Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` - Delete []*Path `protobuf:"bytes,2,rep,name=delete" json:"delete,omitempty"` - Replace []*Update `protobuf:"bytes,3,rep,name=replace" json:"replace,omitempty"` - Update []*Update `protobuf:"bytes,4,rep,name=update" json:"update,omitempty"` -} - -func (m *SetRequest) Reset() { *m = SetRequest{} } -func (m *SetRequest) String() string { return proto.CompactTextString(m) } -func (*SetRequest) ProtoMessage() {} -func (*SetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } - -func (m *SetRequest) GetPrefix() *Path { - if m != nil { - return m.Prefix - } - return nil -} - -func (m *SetRequest) GetDelete() []*Path { - if m != nil { - return m.Delete - } - return nil -} - -func (m *SetRequest) GetReplace() []*Update { - if m != nil { - return m.Replace - } - return nil -} - -func (m *SetRequest) GetUpdate() []*Update { - if m != nil { - return m.Update - } - return nil -} - -// A SetResponse contains responses to a SetRequest. The optional prefix is -// applied to all paths in response. Each operation and path in a SetRequest -// requires a response. The target may return additional informational messages -// in the response such as path not found for a delete or update. -type SetResponse struct { - Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` - Response []*UpdateResponse `protobuf:"bytes,2,rep,name=response" json:"response,omitempty"` -} - -func (m *SetResponse) Reset() { *m = SetResponse{} } -func (m *SetResponse) String() string { return proto.CompactTextString(m) } -func (*SetResponse) ProtoMessage() {} -func (*SetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } - -func (m *SetResponse) GetPrefix() *Path { - if m != nil { - return m.Prefix - } - return nil -} - -func (m *SetResponse) GetResponse() []*UpdateResponse { - if m != nil { - return m.Response - } - return nil -} - -// An UpdateResponse contains the response for a single path Update. -type UpdateResponse struct { - // The timestamp is the time, in nanoseconds since the epoch, that a Set was - // accepted (i.e., the request was valid). It does not imply the value was - // actually propagated to an underlying datastore. - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - Path *Path `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - // message contains an informational or an error message. Required for - // unsuccessful SetRequest operations. - Message *Error `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` - Op UpdateResponse_Operation `protobuf:"varint,4,opt,name=op,enum=openconfig.UpdateResponse_Operation" json:"op,omitempty"` -} - -func (m *UpdateResponse) Reset() { *m = UpdateResponse{} } -func (m *UpdateResponse) String() string { return proto.CompactTextString(m) } -func (*UpdateResponse) ProtoMessage() {} -func (*UpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } - -func (m *UpdateResponse) GetPath() *Path { - if m != nil { - return m.Path - } - return nil -} - -func (m *UpdateResponse) GetMessage() *Error { - if m != nil { - return m.Message - } - return nil -} - -// An Error contains information about why a particular request failed. -// Examples of informational errors are included in the RPC specification -// YANG modules. -// -// The canonical error codes are defined for each language. -// -// Go: import "google.golang.org/grpc/codes" -// C++: #include -// Java: import static io.grpc.Status.Code; -// C: #include -// C#: using Grpc.Core; -type Error struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - Data *google_protobuf.Any `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"` -} - -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } - -func (m *Error) GetData() *google_protobuf.Any { - if m != nil { - return m.Data - } - return nil -} - -// A SubscribeRequest is either a subscription request, a change to the -// heartbeat rate, initiating a poll, or defining an alias. It is always sent -// from the client to the target. -type SubscribeRequest struct { - // Types that are valid to be assigned to Request: - // *SubscribeRequest_Subscribe - // *SubscribeRequest_Heartbeat - // *SubscribeRequest_Poll - // *SubscribeRequest_Aliases - Request isSubscribeRequest_Request `protobuf_oneof:"request"` - Proxy *Proxies `protobuf:"bytes,5,opt,name=proxy" json:"proxy,omitempty"` -} - -func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} } -func (m *SubscribeRequest) String() string { return proto.CompactTextString(m) } -func (*SubscribeRequest) ProtoMessage() {} -func (*SubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } - -type isSubscribeRequest_Request interface { - isSubscribeRequest_Request() -} - -type SubscribeRequest_Subscribe struct { - Subscribe *SubscriptionList `protobuf:"bytes,1,opt,name=subscribe,oneof"` -} -type SubscribeRequest_Heartbeat struct { - Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,oneof"` -} -type SubscribeRequest_Poll struct { - Poll *PollRequest `protobuf:"bytes,3,opt,name=poll,oneof"` -} -type SubscribeRequest_Aliases struct { - Aliases *AliasList `protobuf:"bytes,4,opt,name=aliases,oneof"` -} - -func (*SubscribeRequest_Subscribe) isSubscribeRequest_Request() {} -func (*SubscribeRequest_Heartbeat) isSubscribeRequest_Request() {} -func (*SubscribeRequest_Poll) isSubscribeRequest_Request() {} -func (*SubscribeRequest_Aliases) isSubscribeRequest_Request() {} - -func (m *SubscribeRequest) GetRequest() isSubscribeRequest_Request { - if m != nil { - return m.Request - } - return nil -} - -func (m *SubscribeRequest) GetSubscribe() *SubscriptionList { - if x, ok := m.GetRequest().(*SubscribeRequest_Subscribe); ok { - return x.Subscribe - } - return nil -} - -func (m *SubscribeRequest) GetHeartbeat() *Heartbeat { - if x, ok := m.GetRequest().(*SubscribeRequest_Heartbeat); ok { - return x.Heartbeat - } - return nil -} - -func (m *SubscribeRequest) GetPoll() *PollRequest { - if x, ok := m.GetRequest().(*SubscribeRequest_Poll); ok { - return x.Poll - } - return nil -} - -func (m *SubscribeRequest) GetAliases() *AliasList { - if x, ok := m.GetRequest().(*SubscribeRequest_Aliases); ok { - return x.Aliases - } - return nil -} - -func (m *SubscribeRequest) GetProxy() *Proxies { - if m != nil { - return m.Proxy - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SubscribeRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SubscribeRequest_OneofMarshaler, _SubscribeRequest_OneofUnmarshaler, _SubscribeRequest_OneofSizer, []interface{}{ - (*SubscribeRequest_Subscribe)(nil), - (*SubscribeRequest_Heartbeat)(nil), - (*SubscribeRequest_Poll)(nil), - (*SubscribeRequest_Aliases)(nil), - } -} - -func _SubscribeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SubscribeRequest) - // request - switch x := m.Request.(type) { - case *SubscribeRequest_Subscribe: - b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Subscribe); err != nil { - return err - } - case *SubscribeRequest_Heartbeat: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Heartbeat); err != nil { - return err - } - case *SubscribeRequest_Poll: - b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Poll); err != nil { - return err - } - case *SubscribeRequest_Aliases: - b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Aliases); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("SubscribeRequest.Request has unexpected type %T", x) - } - return nil -} - -func _SubscribeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SubscribeRequest) - switch tag { - case 1: // request.subscribe - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SubscriptionList) - err := b.DecodeMessage(msg) - m.Request = &SubscribeRequest_Subscribe{msg} - return true, err - case 2: // request.heartbeat - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Heartbeat) - err := b.DecodeMessage(msg) - m.Request = &SubscribeRequest_Heartbeat{msg} - return true, err - case 3: // request.poll - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PollRequest) - err := b.DecodeMessage(msg) - m.Request = &SubscribeRequest_Poll{msg} - return true, err - case 4: // request.aliases - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(AliasList) - err := b.DecodeMessage(msg) - m.Request = &SubscribeRequest_Aliases{msg} - return true, err - default: - return false, nil - } -} - -func _SubscribeRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SubscribeRequest) - // request - switch x := m.Request.(type) { - case *SubscribeRequest_Subscribe: - s := proto.Size(x.Subscribe) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *SubscribeRequest_Heartbeat: - s := proto.Size(x.Heartbeat) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *SubscribeRequest_Poll: - s := proto.Size(x.Poll) - n += proto.SizeVarint(3<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *SubscribeRequest_Aliases: - s := proto.Size(x.Aliases) - n += proto.SizeVarint(4<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// SubscriptionList contains the list of individual subscriptions. A -// SubscriptionList is only valid if all of the contained subscriptions are -// valid. -// -// A SubscriptionList operates in one of three modes, all of which operate on -// the streaming channel. -// -// STREAM: This is the default mode. The target must send notifications for -// all subscribed values. After each subscribed value as been sent at least -// once, the target must send a sync_response. The target continues to send -// update notifications for the subscribed values as indicated in the -// subscription. -// -// ONCE: This mode is used to send a one-time request for data to the target -// by setting once to true in the SubscriptionRequest. The target sends each -// subscribed value once, followed by a sync_response (indicating all values -// were sent) and then closes the stream. -// -// POLL: This mode provides a method to send periodic requests over a single -// stream similar to conventional polling. In this mode, the client is able to -// control when data is sent by the target, in contrast to the STREAM mode. -// With a single declared subscription, the target need only parse the -// subscription once, and can expect periodic requests for the corresponding -// data. -// -// After sending a SubscriptionList with mode set to POLL, polls are initiated -// by sending a PollRequest. The target sends no notifications to the client -// until the first PollRequest is received. The target responds by sending each -// subscribed value once, followed by a sync_response. This process repeats -// for subsequent polls. -// -// Polling mode is optional. If a target does not support the polling mode, it -// must reject a polling subscription request. If a client sends a new poll -// before the previous poll completes, the target should close the stream with -// an error. -// -// If prefix is set then all subscriptions in the list and all notifications -// generated are relative to prefix. -// -// If qos is provided then marking is the QOS marking to use for this session. -// The target should use this QOS marking, if supported. -// -// In the event of overlapping subscription, the most specific subscription for -// a value is used. For example, if the following two subscriptions were made: -// -// /interfaces/interfaces//state -// /interfaces/interfaces//state/counters -// -// Then values in state outside of counters would be subject to the first -// subscription. Values inside of counters would be subject to the second -// subscription. -type SubscriptionList struct { - Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` - Subscription []*Subscription `protobuf:"bytes,2,rep,name=subscription" json:"subscription,omitempty"` - UseAliases bool `protobuf:"varint,3,opt,name=use_aliases,json=useAliases" json:"use_aliases,omitempty"` - Qos *QOSMarking `protobuf:"bytes,4,opt,name=qos" json:"qos,omitempty"` - Mode SubscriptionList_Mode `protobuf:"varint,5,opt,name=mode,enum=openconfig.SubscriptionList_Mode" json:"mode,omitempty"` -} - -func (m *SubscriptionList) Reset() { *m = SubscriptionList{} } -func (m *SubscriptionList) String() string { return proto.CompactTextString(m) } -func (*SubscriptionList) ProtoMessage() {} -func (*SubscriptionList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } - -func (m *SubscriptionList) GetPrefix() *Path { - if m != nil { - return m.Prefix - } - return nil -} - -func (m *SubscriptionList) GetSubscription() []*Subscription { - if m != nil { - return m.Subscription - } - return nil -} - -func (m *SubscriptionList) GetQos() *QOSMarking { - if m != nil { - return m.Qos - } - return nil -} - -// Subscription contains a path as well as information on how two send -// notifications. -// -// A Subscription contains subscription information for a single path. The path -// may be either a leaf node or a directory node in the tree. When subscribing -// for a directory node, all nodes below it are automatically included in the -// subscription. -// -// If mode is ON_CHANGE, then the target must either be able to send -// notifications each time a value changes or reject the subscription. This is -// typically used for events. The sample_interval is ignored when the mode in -// ON_CHANGE. -// -// If mode is SAMPLE, the target must coalesce notifications based on the -// provided sample_interval. This is typically used for aggregating values -// (i.e., counters). The sample_interval, if not 0, is the number of -// nanoseconds between updates. If 0, the interval is selected by the target. -// If the target cannot support the supplied sample_interval, the Subscription -// must be rejected. The sample_interval is only used for subscriptions in -// streaming mode. The sample_interval is ignored if mode is not SAMPLE. -// -// (Setting mode to SAMPLE and sample_interval to 0 is functionally the -// same as setting mode to TARGET_DEFINED.) -// -// The suppress_redundant field, if true, indicates the target should not send -// notifications for fields that are unchanged since. This value is ignored -// if mode is not SAMPLE. -// -// The heartbeat_interval field specifies how frequently an unchanged value must -// be sent regardless of the suppress_redundant field. A value of 0 indicates -// there is no heartbeat_interval and values only need to be sent when changed. -// The target must reject a subscription if it cannot support the requested -// heartbeat_interval. This value is ignored if mode is not SAMPLE. -type Subscription struct { - Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` - Mode SubscriptionMode `protobuf:"varint,2,opt,name=mode,enum=openconfig.SubscriptionMode" json:"mode,omitempty"` - SampleInterval uint64 `protobuf:"varint,3,opt,name=sample_interval,json=sampleInterval" json:"sample_interval,omitempty"` - SuppressRedundant bool `protobuf:"varint,4,opt,name=suppress_redundant,json=suppressRedundant" json:"suppress_redundant,omitempty"` - HeartbeatInterval uint64 `protobuf:"varint,5,opt,name=heartbeat_interval,json=heartbeatInterval" json:"heartbeat_interval,omitempty"` -} - -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } - -func (m *Subscription) GetPath() *Path { - if m != nil { - return m.Path - } - return nil -} - -// A QOSMarking describes the QOS marking to use, if supported by the target. -type QOSMarking struct { - Marking uint32 `protobuf:"varint,1,opt,name=marking" json:"marking,omitempty"` -} - -func (m *QOSMarking) Reset() { *m = QOSMarking{} } -func (m *QOSMarking) String() string { return proto.CompactTextString(m) } -func (*QOSMarking) ProtoMessage() {} -func (*QOSMarking) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } - -// An AliasList represents a list of aliases. -type AliasList struct { - Alias []*Alias `protobuf:"bytes,1,rep,name=alias" json:"alias,omitempty"` -} - -func (m *AliasList) Reset() { *m = AliasList{} } -func (m *AliasList) String() string { return proto.CompactTextString(m) } -func (*AliasList) ProtoMessage() {} -func (*AliasList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } - -func (m *AliasList) GetAlias() []*Alias { - if m != nil { - return m.Alias - } - return nil -} - -// An Alias specifies a preferred client defined alias for a specified path. An -// Alias is only sent from the client to the target. An alias is typically one -// element and is much shorter than the provided path. A target should -// substitute alias for path in Notifications. Targets may ignore Alias -// messages. -// -// The path must be fully expanded and not use an alias. -// -// If alias is set and path is not then the alias must no longer be used by the -// target, once received. A client may still see Notifications using the alias -// that were generated prior to the target receiving the request to stop using -// the alias. -type Alias struct { - Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` - Alias *Path `protobuf:"bytes,2,opt,name=alias" json:"alias,omitempty"` -} - -func (m *Alias) Reset() { *m = Alias{} } -func (m *Alias) String() string { return proto.CompactTextString(m) } -func (*Alias) ProtoMessage() {} -func (*Alias) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } - -func (m *Alias) GetPath() *Path { - if m != nil { - return m.Path - } - return nil -} - -func (m *Alias) GetAlias() *Path { - if m != nil { - return m.Alias - } - return nil -} - -// A PollRequest requests that all values in the subscription be resent. -type PollRequest struct { -} - -func (m *PollRequest) Reset() { *m = PollRequest{} } -func (m *PollRequest) String() string { return proto.CompactTextString(m) } -func (*PollRequest) ProtoMessage() {} -func (*PollRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } - -// Proxies is a list of proxies to use to get to the target. The first proxy -// listed is the the next hop. Actual targets ignore the proxy field (it should -// not be set when the request reaches the target). -// -// The target_name is an optional informational field describing the ultimate -// destination of the subscribe request. Proxies may find it useful to use this -// information in logs and errors. -// -// The client_name is an optional informational field describing the client -// making the subscribe request. Proxies may find it useful to use this -// information in logs and errors. -type Proxies struct { - Proxy []*Proxy `protobuf:"bytes,1,rep,name=proxy" json:"proxy,omitempty"` - TargetName string `protobuf:"bytes,2,opt,name=target_name,json=targetName" json:"target_name,omitempty"` - ClientName string `protobuf:"bytes,3,opt,name=client_name,json=clientName" json:"client_name,omitempty"` -} - -func (m *Proxies) Reset() { *m = Proxies{} } -func (m *Proxies) String() string { return proto.CompactTextString(m) } -func (*Proxies) ProtoMessage() {} -func (*Proxies) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } - -func (m *Proxies) GetProxy() []*Proxy { - if m != nil { - return m.Proxy - } - return nil -} - -// A Proxy represents a proxy service to use when connecting to the target. -type Proxy struct { - Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` -} - -func (m *Proxy) Reset() { *m = Proxy{} } -func (m *Proxy) String() string { return proto.CompactTextString(m) } -func (*Proxy) ProtoMessage() {} -func (*Proxy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } - -// A SubscribeResponse is always sent from the target to the client. -// -// Notifications are sent as described above in SubscribeList. -// -// A sync_response is sent when the target finishes sending all the subscribed -// values at least once. sync_response must be set to true for the client to -// consider the stream synced. -type SubscribeResponse struct { - // Types that are valid to be assigned to Response: - // *SubscribeResponse_Update - // *SubscribeResponse_Heartbeat - // *SubscribeResponse_SyncResponse - Response isSubscribeResponse_Response `protobuf_oneof:"response"` -} - -func (m *SubscribeResponse) Reset() { *m = SubscribeResponse{} } -func (m *SubscribeResponse) String() string { return proto.CompactTextString(m) } -func (*SubscribeResponse) ProtoMessage() {} -func (*SubscribeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } - -type isSubscribeResponse_Response interface { - isSubscribeResponse_Response() -} - -type SubscribeResponse_Update struct { - Update *Notification `protobuf:"bytes,1,opt,name=update,oneof"` -} -type SubscribeResponse_Heartbeat struct { - Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,oneof"` -} -type SubscribeResponse_SyncResponse struct { - SyncResponse bool `protobuf:"varint,3,opt,name=sync_response,json=syncResponse,oneof"` -} - -func (*SubscribeResponse_Update) isSubscribeResponse_Response() {} -func (*SubscribeResponse_Heartbeat) isSubscribeResponse_Response() {} -func (*SubscribeResponse_SyncResponse) isSubscribeResponse_Response() {} - -func (m *SubscribeResponse) GetResponse() isSubscribeResponse_Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *SubscribeResponse) GetUpdate() *Notification { - if x, ok := m.GetResponse().(*SubscribeResponse_Update); ok { - return x.Update - } - return nil -} - -func (m *SubscribeResponse) GetHeartbeat() *Heartbeat { - if x, ok := m.GetResponse().(*SubscribeResponse_Heartbeat); ok { - return x.Heartbeat - } - return nil -} - -func (m *SubscribeResponse) GetSyncResponse() bool { - if x, ok := m.GetResponse().(*SubscribeResponse_SyncResponse); ok { - return x.SyncResponse - } - return false -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*SubscribeResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SubscribeResponse_OneofMarshaler, _SubscribeResponse_OneofUnmarshaler, _SubscribeResponse_OneofSizer, []interface{}{ - (*SubscribeResponse_Update)(nil), - (*SubscribeResponse_Heartbeat)(nil), - (*SubscribeResponse_SyncResponse)(nil), - } -} - -func _SubscribeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*SubscribeResponse) - // response - switch x := m.Response.(type) { - case *SubscribeResponse_Update: - b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Update); err != nil { - return err - } - case *SubscribeResponse_Heartbeat: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Heartbeat); err != nil { - return err - } - case *SubscribeResponse_SyncResponse: - t := uint64(0) - if x.SyncResponse { - t = 1 - } - b.EncodeVarint(3<<3 | proto.WireVarint) - b.EncodeVarint(t) - case nil: - default: - return fmt.Errorf("SubscribeResponse.Response has unexpected type %T", x) - } - return nil -} - -func _SubscribeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*SubscribeResponse) - switch tag { - case 1: // response.update - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Notification) - err := b.DecodeMessage(msg) - m.Response = &SubscribeResponse_Update{msg} - return true, err - case 2: // response.heartbeat - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Heartbeat) - err := b.DecodeMessage(msg) - m.Response = &SubscribeResponse_Heartbeat{msg} - return true, err - case 3: // response.sync_response - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.Response = &SubscribeResponse_SyncResponse{x != 0} - return true, err - default: - return false, nil - } -} - -func _SubscribeResponse_OneofSizer(msg proto.Message) (n int) { - m := msg.(*SubscribeResponse) - // response - switch x := m.Response.(type) { - case *SubscribeResponse_Update: - s := proto.Size(x.Update) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *SubscribeResponse_Heartbeat: - s := proto.Size(x.Heartbeat) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *SubscribeResponse_SyncResponse: - n += proto.SizeVarint(3<<3 | proto.WireVarint) - n += 1 - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// A Heartbeat requests a (possibly repeated) response from the remote side. -type Heartbeat struct { - // interval is the maximum amount of time, in nanoseconds, between subsequent - // messages from the remote side. An empty message may be sent if no other - // messages are pending. If interval is 0 then the remote must immediately - // respond with a (possibly empty) message. - Interval uint64 `protobuf:"varint,1,opt,name=interval" json:"interval,omitempty"` -} - -func (m *Heartbeat) Reset() { *m = Heartbeat{} } -func (m *Heartbeat) String() string { return proto.CompactTextString(m) } -func (*Heartbeat) ProtoMessage() {} -func (*Heartbeat) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } - -// UDPWrapper adds metadata necessary for encapsulating a list of notifications -// into a UDP packet. It adds the ability to identify the target that -// originated the Notifications, detect packet loss, and identify latency -// introduced by the target wrapping notifications. -// -// The target should keep the total size of a serialized UDPWrapper message -// small enough to not cause IP packet fragmentation. -type UDPWrapper struct { - // ID Identifies the target (e.g., Loopback IP address, linecard, ...) - // TODO(borman): Add examples. Perhaps agent/module/submodule for vendor. - Id *Path `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - // Optional Epoch time of when the message is queued for transmit. - // Useful to quantify delay between message generation and transmission. - TransmitTimestamp uint64 `protobuf:"varint,2,opt,name=transmit_timestamp,json=transmitTimestamp" json:"transmit_timestamp,omitempty"` - // The sequence_number must start at 1 and increment by 1 for each new packet - // sent. A client may use this to determine if a packet was lost. - SequenceNumber uint64 `protobuf:"varint,3,opt,name=sequence_number,json=sequenceNumber" json:"sequence_number,omitempty"` - Notification []*Notification `protobuf:"bytes,4,rep,name=notification" json:"notification,omitempty"` -} - -func (m *UDPWrapper) Reset() { *m = UDPWrapper{} } -func (m *UDPWrapper) String() string { return proto.CompactTextString(m) } -func (*UDPWrapper) ProtoMessage() {} -func (*UDPWrapper) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } - -func (m *UDPWrapper) GetId() *Path { - if m != nil { - return m.Id - } - return nil -} - -func (m *UDPWrapper) GetNotification() []*Notification { - if m != nil { - return m.Notification - } - return nil -} - -func init() { - proto.RegisterType((*Notification)(nil), "openconfig.Notification") - proto.RegisterType((*Update)(nil), "openconfig.Update") - proto.RegisterType((*Path)(nil), "openconfig.Path") - proto.RegisterType((*Value)(nil), "openconfig.Value") - proto.RegisterType((*GetModelsRequest)(nil), "openconfig.GetModelsRequest") - proto.RegisterType((*ModelQuery)(nil), "openconfig.ModelQuery") - proto.RegisterType((*GetModelsResponse)(nil), "openconfig.GetModelsResponse") - proto.RegisterType((*ModelData)(nil), "openconfig.ModelData") - proto.RegisterType((*GetRequest)(nil), "openconfig.GetRequest") - proto.RegisterType((*GetResponse)(nil), "openconfig.GetResponse") - proto.RegisterType((*SetRequest)(nil), "openconfig.SetRequest") - proto.RegisterType((*SetResponse)(nil), "openconfig.SetResponse") - proto.RegisterType((*UpdateResponse)(nil), "openconfig.UpdateResponse") - proto.RegisterType((*Error)(nil), "openconfig.Error") - proto.RegisterType((*SubscribeRequest)(nil), "openconfig.SubscribeRequest") - proto.RegisterType((*SubscriptionList)(nil), "openconfig.SubscriptionList") - proto.RegisterType((*Subscription)(nil), "openconfig.Subscription") - proto.RegisterType((*QOSMarking)(nil), "openconfig.QOSMarking") - proto.RegisterType((*AliasList)(nil), "openconfig.AliasList") - proto.RegisterType((*Alias)(nil), "openconfig.Alias") - proto.RegisterType((*PollRequest)(nil), "openconfig.PollRequest") - proto.RegisterType((*Proxies)(nil), "openconfig.Proxies") - proto.RegisterType((*Proxy)(nil), "openconfig.Proxy") - proto.RegisterType((*SubscribeResponse)(nil), "openconfig.SubscribeResponse") - proto.RegisterType((*Heartbeat)(nil), "openconfig.Heartbeat") - proto.RegisterType((*UDPWrapper)(nil), "openconfig.UDPWrapper") - proto.RegisterEnum("openconfig.Type", Type_name, Type_value) - proto.RegisterEnum("openconfig.SubscriptionMode", SubscriptionMode_name, SubscriptionMode_value) - proto.RegisterEnum("openconfig.GetModelsRequest_Type", GetModelsRequest_Type_name, GetModelsRequest_Type_value) - proto.RegisterEnum("openconfig.ModelData_Type", ModelData_Type_name, ModelData_Type_value) - proto.RegisterEnum("openconfig.GetRequest_Type", GetRequest_Type_name, GetRequest_Type_value) - proto.RegisterEnum("openconfig.UpdateResponse_Operation", UpdateResponse_Operation_name, UpdateResponse_Operation_value) - proto.RegisterEnum("openconfig.SubscriptionList_Mode", SubscriptionList_Mode_name, SubscriptionList_Mode_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for OpenConfig service - -type OpenConfigClient interface { - // Get requests a single snapshot of specified data. A Get request may - // contain a hint that the request will be repeated (i.e., polling). - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - // GetModels returns information about the YANG models supported by the - // target. - GetModels(ctx context.Context, in *GetModelsRequest, opts ...grpc.CallOption) (*GetModelsResponse, error) - // Set is the primary function for sending configuration data to the target. - // It sets the paths contained in the SetRequest to the specified values. If - // any of the paths are invalid, or are read-only, the SetResponse will - // return an error. All paths in the SetRequest must be valid or the entire - // request must be rejected. If a path specifies an internal node, rather than - // a leaf, then the value must be the values of the node's children encoded - // in JSON. Binary data in the tree must be base64 encoded, but if a path - // specifies a leaf of binary type, it may be sent as binary. See SetRequest - // for further explanation on the atomicity and idempotency of a Set - // operation. - Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) - // Subscribe subscribes for streaming updates. Streaming updates are provided - // as a series of Notifications, each of which update a portion of the tree. - // The initial SubscribeRequest contains a SubscriptionList, described below. - Subscribe(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SubscribeClient, error) -} - -type openConfigClient struct { - cc *grpc.ClientConn -} - -func NewOpenConfigClient(cc *grpc.ClientConn) OpenConfigClient { - return &openConfigClient{cc} -} - -func (c *openConfigClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - out := new(GetResponse) - err := grpc.Invoke(ctx, "/openconfig.OpenConfig/Get", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *openConfigClient) GetModels(ctx context.Context, in *GetModelsRequest, opts ...grpc.CallOption) (*GetModelsResponse, error) { - out := new(GetModelsResponse) - err := grpc.Invoke(ctx, "/openconfig.OpenConfig/GetModels", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *openConfigClient) Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) { - out := new(SetResponse) - err := grpc.Invoke(ctx, "/openconfig.OpenConfig/Set", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *openConfigClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SubscribeClient, error) { - stream, err := grpc.NewClientStream(ctx, &_OpenConfig_serviceDesc.Streams[0], c.cc, "/openconfig.OpenConfig/Subscribe", opts...) - if err != nil { - return nil, err - } - x := &openConfigSubscribeClient{stream} - return x, nil -} - -type OpenConfig_SubscribeClient interface { - Send(*SubscribeRequest) error - Recv() (*SubscribeResponse, error) - grpc.ClientStream -} - -type openConfigSubscribeClient struct { - grpc.ClientStream -} - -func (x *openConfigSubscribeClient) Send(m *SubscribeRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *openConfigSubscribeClient) Recv() (*SubscribeResponse, error) { - m := new(SubscribeResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for OpenConfig service - -type OpenConfigServer interface { - // Get requests a single snapshot of specified data. A Get request may - // contain a hint that the request will be repeated (i.e., polling). - Get(context.Context, *GetRequest) (*GetResponse, error) - // GetModels returns information about the YANG models supported by the - // target. - GetModels(context.Context, *GetModelsRequest) (*GetModelsResponse, error) - // Set is the primary function for sending configuration data to the target. - // It sets the paths contained in the SetRequest to the specified values. If - // any of the paths are invalid, or are read-only, the SetResponse will - // return an error. All paths in the SetRequest must be valid or the entire - // request must be rejected. If a path specifies an internal node, rather than - // a leaf, then the value must be the values of the node's children encoded - // in JSON. Binary data in the tree must be base64 encoded, but if a path - // specifies a leaf of binary type, it may be sent as binary. See SetRequest - // for further explanation on the atomicity and idempotency of a Set - // operation. - Set(context.Context, *SetRequest) (*SetResponse, error) - // Subscribe subscribes for streaming updates. Streaming updates are provided - // as a series of Notifications, each of which update a portion of the tree. - // The initial SubscribeRequest contains a SubscriptionList, described below. - Subscribe(OpenConfig_SubscribeServer) error -} - -func RegisterOpenConfigServer(s *grpc.Server, srv OpenConfigServer) { - s.RegisterService(&_OpenConfig_serviceDesc, srv) -} - -func _OpenConfig_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OpenConfigServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openconfig.OpenConfig/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OpenConfigServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _OpenConfig_GetModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetModelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OpenConfigServer).GetModels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openconfig.OpenConfig/GetModels", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OpenConfigServer).GetModels(ctx, req.(*GetModelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _OpenConfig_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OpenConfigServer).Set(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/openconfig.OpenConfig/Set", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OpenConfigServer).Set(ctx, req.(*SetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _OpenConfig_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(OpenConfigServer).Subscribe(&openConfigSubscribeServer{stream}) -} - -type OpenConfig_SubscribeServer interface { - Send(*SubscribeResponse) error - Recv() (*SubscribeRequest, error) - grpc.ServerStream -} - -type openConfigSubscribeServer struct { - grpc.ServerStream -} - -func (x *openConfigSubscribeServer) Send(m *SubscribeResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *openConfigSubscribeServer) Recv() (*SubscribeRequest, error) { - m := new(SubscribeRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _OpenConfig_serviceDesc = grpc.ServiceDesc{ - ServiceName: "openconfig.OpenConfig", - HandlerType: (*OpenConfigServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _OpenConfig_Get_Handler, - }, - { - MethodName: "GetModels", - Handler: _OpenConfig_GetModels_Handler, - }, - { - MethodName: "Set", - Handler: _OpenConfig_Set_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Subscribe", - Handler: _OpenConfig_Subscribe_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/openconfig/reference/rpc/openconfig/openconfig.proto", -} - -func init() { - proto.RegisterFile("github.com/openconfig/reference/rpc/openconfig/openconfig.proto", fileDescriptor0) -} - -var fileDescriptor0 = []byte{ - // 1592 bytes of a gzipped FileDescriptorProto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4e, 0x88, 0xc9, - 0x9b, 0x19, 0x09, 0x23, 0x54, 0x87, 0x72, 0xc0, 0x3f, 0x87, 0xcc, 0xac, 0xc4, 0xcc, 0xde, 0xca, - 0x9a, 0x3d, 0xaf, 0xc3, 0xef, 0x29, 0x09, 0x35, 0x7a, 0x40, 0xf7, 0x21, 0xff, 0x66, 0x46, 0x82, - 0xb9, 0x08, 0xff, 0x5a, 0x56, 0x9d, 0xe9, 0xbe, 0xa0, 0x5c, 0xcc, 0x85, 0xf4, 0x9b, 0xa0, 0x30, - 0xad, 0x12, 0x14, 0x7b, 0x83, 0x56, 0xcb, 0xc0, 0xaf, 0xb5, 0x35, 0x04, 0x50, 0xa8, 0x9b, 0x7d, - 0xa3, 0xd1, 0xd4, 0x24, 0xfd, 0x07, 0x80, 0x54, 0x2b, 0x89, 0x45, 0x4a, 0x63, 0xa1, 0x98, 0xa2, - 0xff, 0x43, 0xdf, 0x1a, 0xf1, 0x54, 0xa8, 0x38, 0x25, 0xd0, 0xe4, 0xbe, 0x25, 0x41, 0x68, 0x7b, - 0xae, 0x48, 0x40, 0x7c, 0xd4, 0x0f, 0x60, 0x2b, 0x13, 0x4e, 0xe8, 0x7b, 0x6e, 0x48, 0xd0, 0x03, - 0x28, 0x4c, 0x19, 0x85, 0x3d, 0x45, 0x69, 0xff, 0xff, 0x17, 0xdc, 0xaf, 0x5b, 0x91, 0x85, 0x85, - 0x90, 0xfe, 0x97, 0x04, 0x6a, 0x42, 0xfd, 0x2f, 0xbd, 0xa3, 0xb6, 0xc6, 0x56, 0x64, 0x55, 0x14, - 0xf6, 0xe0, 0xec, 0x1b, 0x7d, 0x0b, 0xc0, 0xee, 0xe5, 0xcf, 0x93, 0x67, 0xcf, 0xb3, 0xbd, 0xd4, - 0x41, 0xfe, 0x2e, 0x2a, 0x93, 0xa6, 0x9f, 0xfa, 0x33, 0x91, 0x67, 0x80, 0x42, 0xab, 0x53, 0x1f, - 0x34, 0x4d, 0x9e, 0xe6, 0x83, 0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0xa7, 0xa1, 0x35, 0xed, 0x30, 0x3a, 0x5e, 0xc3, 0xa9, 0x02, 0x7a, 0x0c, 0xea, - 0x19, 0xb1, 0x82, 0xe8, 0x84, 0x58, 0x91, 0x78, 0x86, 0x85, 0xce, 0x79, 0x1c, 0x33, 0xa9, 0x5a, - 0x22, 0x89, 0x1e, 0x80, 0xe2, 0x7b, 0x8e, 0x23, 0x7c, 0xbe, 0xbe, 0xf0, 0x70, 0x9e, 0xe3, 0x08, - 0xdf, 0x8e, 0xd7, 0x30, 0x13, 0x43, 0x5f, 0x41, 0x91, 0x0d, 0x7a, 0x12, 0xb2, 0x97, 0x39, 0x77, - 0x87, 0x41, 0x59, 0xc2, 0xb5, 0x58, 0x0e, 0x7d, 0x01, 0x79, 0x3f, 0xf0, 0xde, 0xcd, 0x59, 0xb7, - 0x2c, 0xed, 0xff, 0x6f, 0xe1, 0x8a, 0xc0, 0x7b, 0x67, 0x93, 0x10, 0x73, 0x89, 0x03, 0x95, 0x56, - 0x10, 0xbb, 0x50, 0xff, 0x25, 0xcd, 0x50, 0x12, 0xf0, 0x47, 0x00, 0xff, 0x29, 0x94, 0xc3, 0x8c, - 0xb6, 0x00, 0x7f, 0x65, 0x55, 0x3a, 0xf1, 0x82, 0x34, 0xba, 0x09, 0xa5, 0x59, 0x48, 0x86, 0x71, - 0xa4, 0x34, 0x37, 0xeb, 0x18, 0x66, 0x21, 0x31, 0x44, 0x4c, 0x55, 0xc8, 0xbd, 0xf1, 0xe2, 0x14, - 0x2c, 0xcc, 0xd7, 0x17, 0x9d, 0x5e, 0xcb, 0x0a, 0x7e, 0xb4, 0xdd, 0x09, 0xa6, 0x22, 0xe8, 0x31, - 0x28, 0x74, 0x04, 0x88, 0x51, 0x71, 0xeb, 0xb2, 0xf7, 0x64, 0xb3, 0x03, 0x33, 0x71, 0x7d, 0x17, - 0x14, 0x7a, 0xa2, 0xa8, 0xec, 0xf5, 0xb1, 0x69, 0xb4, 0xb4, 0x35, 0xb4, 0x0e, 0x4a, 0xa7, 0x7d, - 0x48, 0x81, 0xbb, 0x0e, 0x4a, 0xb7, 0xd3, 0x6c, 0x6a, 0x32, 0x9d, 0x09, 0xe5, 0xac, 0x9d, 0x0f, - 0x5c, 0x90, 0x1e, 0x0a, 0xaf, 0xf8, 0xda, 0xb2, 0x12, 0x65, 0xa9, 0x43, 0xe8, 0x2e, 0x5c, 0x09, - 0xad, 0xa9, 0xef, 0x64, 0xba, 0x3d, 0x4d, 0x8b, 0x82, 0x37, 0x39, 0x39, 0x6e, 0xf7, 0xe8, 0x01, - 0xa0, 0x70, 0xe6, 0xfb, 0x01, 0x09, 0xc3, 0x61, 0x40, 0xc6, 0x33, 0x77, 0x6c, 0xb9, 0x11, 0xcb, - 0xd4, 0x3a, 0xde, 0x8a, 0x39, 0x38, 0x66, 0x50, 0xf1, 0x04, 0x8c, 0xa9, 0xe9, 0x3c, 0x33, 0xbd, - 0x95, 0x70, 0x92, 0x61, 0xb2, 0x0b, 0x90, 0x66, 0x98, 0x95, 0x22, 0xff, 0x14, 0x15, 0x1a, 0x1f, - 0xf5, 0x47, 0xa0, 0x26, 0x60, 0xa4, 0xeb, 0x20, 0x5f, 0x55, 0xf9, 0xc8, 0xd8, 0xba, 0x00, 0x59, - 0xb1, 0xbd, 0xea, 0x03, 0xc8, 0xb3, 0xf3, 0x07, 0x66, 0x71, 0x37, 0xb6, 0xbb, 0xaa, 0xeb, 0x09, - 0xb3, 0x1b, 0x50, 0xca, 0xd4, 0x92, 0x1e, 0x41, 0x51, 0xe0, 0x9e, 0x7a, 0xc6, 0x6b, 0x63, 0x89, - 0x67, 0x54, 0x66, 0x2e, 0x2a, 0x83, 0x22, 0x32, 0xb2, 0x82, 0x09, 0x89, 0x86, 0x6c, 0xbd, 0xe1, - 0x8d, 0x07, 0x38, 0xa9, 0x4d, 0x97, 0x9c, 0x9b, 0x50, 0x1a, 0x39, 0x36, 0x71, 0x85, 0x00, 0x5f, - 0x65, 0x80, 0x93, 0xa8, 0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0x1a, 0x0c, 0x82, 0xcd, 0xbe, 0x81, 0x8f, - 0xcc, 0xfe, 0xb0, 0x6e, 0x3e, 0x6f, 0xb4, 0xd9, 0x8c, 0xdc, 0x00, 0xb5, 0xd3, 0x1e, 0x1e, 0x1e, - 0x1b, 0xed, 0x23, 0xda, 0x6d, 0x68, 0x0f, 0x32, 0x5a, 0xdd, 0xa6, 0xa9, 0xc9, 0xfb, 0x3f, 0xc9, - 0x00, 0x1d, 0x9f, 0xb8, 0x87, 0xcc, 0x29, 0xf4, 0x04, 0x72, 0x47, 0x24, 0x42, 0xd7, 0x96, 0x2f, - 0x8b, 0xdb, 0xd7, 0x2f, 0xd0, 0x05, 0x7e, 0x8e, 0x41, 0x4d, 0x16, 0x7f, 0x74, 0xe3, 0xb2, 0x9f, - 0x37, 0xdb, 0x9f, 0xaf, 0xe0, 0x0a, 0x4b, 0x4f, 0x20, 0xd7, 0x3b, 0xef, 0x41, 0x6f, 0x85, 0x07, - 0xd9, 0x1d, 0xaa, 0x09, 0x6a, 0x02, 0x6b, 0xb4, 0xac, 0x01, 0x26, 0x73, 0x79, 0xd1, 0x83, 0x0b, - 0xb5, 0x50, 0x95, 0x1e, 0x4a, 0x27, 0x05, 0x36, 0xe3, 0xbf, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, - 0x24, 0xd1, 0x4d, 0x2c, 0xec, 0x0f, 0x00, 0x00, -} diff --git a/rpc/openconfig/openconfig.proto b/rpc/openconfig/openconfig.proto deleted file mode 100644 index 9547dfa..0000000 --- a/rpc/openconfig/openconfig.proto +++ /dev/null @@ -1,609 +0,0 @@ -// -// Copyright 2016 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -syntax = "proto3"; - -import "github.com/golang/protobuf/ptypes/any/any.proto"; - -// Package openconfig defines the gRPC service for getting and setting the -// configuration and state data of a network target based on OpenConfig models. -// -// This package and its contents is a work-in-progress. It is meant as a -// example implementation of the OpenConfig RPC reference specification -// (available at github.com/openconfig/public/tree/master/release/models/rpc) -// but also contains some additional capabilities not included in the base -// RPC specification. -// -package openconfig; - -service OpenConfig { - // Get requests a single snapshot of specified data. A Get request may - // contain a hint that the request will be repeated (i.e., polling). - rpc Get(GetRequest) returns (GetResponse); - - // GetModels returns information about the YANG models supported by the - // target. - rpc GetModels(GetModelsRequest) returns (GetModelsResponse); - - // Set is the primary function for sending configuration data to the target. - // It sets the paths contained in the SetRequest to the specified values. If - // any of the paths are invalid, or are read-only, the SetResponse will - // return an error. All paths in the SetRequest must be valid or the entire - // request must be rejected. If a path specifies an internal node, rather than - // a leaf, then the value must be the values of the node's children encoded - // in JSON. Binary data in the tree must be base64 encoded, but if a path - // specifies a leaf of binary type, it may be sent as binary. See SetRequest - // for further explanation on the atomicity and idempotency of a Set - // operation. - rpc Set(SetRequest) returns (SetResponse); - - // Subscribe subscribes for streaming updates. Streaming updates are provided - // as a series of Notifications, each of which update a portion of the tree. - // The initial SubscribeRequest contains a SubscriptionList, described below. - rpc Subscribe(stream SubscribeRequest) returns (stream SubscribeResponse); -} - -// A Notification is a list of updates to apply. Deletes are a list of paths to -// delete as long as their data is older than timestamp. Deleting nodes deletes -// all values below the node that are older than timestamp. Deletes are -// performed after updates are applied. Delete paths are created by -// concatenating the prefix, if present, with the individual paths. -// -// Timestamps are always represented as nanoseconds since UNIX epoch, -// Jan 1 1970 00:00:00 UTC. Targets which are incapable of generating nanosecond -// resolution are expected to round the timestamp to the highest supported -// resolution. -// -// Update paths are created by concatenating the prefix, if present, with the -// paths contained in the Updates. -// -// It is valid to have a path be in both an update and a delete. The -// deletion will only delete values that are older than this update. -// -// Each notification should contain at most a single update for a given path. -// If a nonconforming implementation does send multiple updates for a given path -// in a single notification, all but the final update should be ignored. -// -// The prefix should normally be the longest common prefix to all the individual -// update and delete paths. This reduces the repetition of the common prefix in -// each update and/or delete. The individual updates and deletes also are a -// Path (repeated list of elements), allowing a notification such as: -// -// prefix: /a/b/c -// update: { -// path: d -// value: x -// } -// update: { -// path: e/f -// value: y -// } -// update: { -// path: e/g -// value: z -// } -// -// The prefix may begin with an alias. An alias is a Path with 1 or more -// elements, which maps to another Path. Aliases may be defined by either the -// target or the client. Target defined aliases are limited to a single -// element. Aliases are client specific (though a target may define the same -// alias for multiple clients). -// -// The target defines an alias by sending a Notification that has alias set and -// a non-empty prefix. When alias is set, a Notification need not provide -// updates or deletes. If the alias was previously defined, it is over ridden -// with the new definition. Once defined, the target may send the value of -// alias as the first element of a prefix. A target must not send target -// defined aliases to clients that do not specify the use_aliases option in the -// initial SubscriptionList message. A target does not need to define aliases -// even if the client does specify the use_aliases option in the initial -// SubscriptionLlist message. -// -// Clients define aliases by sending a SubscriptionRequest with aliases set. -// -// A target should use a defined alias when possible, but is not required to. A -// target may ignore client defined aliases. -// -// -// Clients should not define aliases that are valid paths in the data -// tree. The target must not define aliases that are valid paths in the -// data tree. -// -// If a target sends a notification with alias set, but not prefix, then it is -// indicating it will no longer use this alias. The client may delete this -// alias from its list of aliases. A target may not delete an alias defined by -// the client. It is implementation dependent on what happens if the client -// defines an alias that is also defined by the target. -// -// Aliases must not be used in UDP packets. -// -// If a client sets the use_aliases option, or defines aliases, in the initial -// SubscriptionList message, then it must always check the initial elements of a -// prefix against the list of known aliases, expanding the prefix as needed. -// Aliases must always be defined as fully expanded prefixes. Only single alias -// lookup is needed per Notification. -// -// Target defined aliases may be any unique string. A target may choose to use -// a unique prefix for aliases to make them visually distinct. For example, a -// target might construct all aliases as an @ character followed by a decimal or -// hexadecimal number (perhaps a hashed address in memory). -// -// Example: -// -// Define @42 as an alias: -// -// timestamp: 1439416376123456789 -// prefix: "this_is" -// prefix: "a_long" -// prefix: "prefix" -// alias: "@42 -// -// Use @42 as an alias to set /this_is/a_long/prefix/Ethernet0/0/1/in-octets to -// 17: -// -// timestamp: 1439416376456456456 -// prefix: "@42" -// prefix: "Ethernet0/0/1" -// update: { -// path: { -// element: "in-octets" -// } -// value: 17 -// } -// -// Delete the alias @42: -// -// timestamp: 1439416376987654321 -// alias: @42 -message Notification { - int64 timestamp = 1; - Path prefix = 2; - string alias = 3; - repeated Update update = 4; - repeated Path delete = 5; -} - -// An Update maps a path to a value. -// -// In a Notification, an Update represents a new or updated value for path. The -// absolute path name is the concatenation of the Notification prefix and the -// Update path. Updates are only sent by the target. Path must always specify -// a leaf node. Value should be a scalar value (e.g., if Value is JSON encoded -// then the value 123 is acceptable, but {"x":123} is not). -// -// In a SetRequest, an Update contains a path to a read-write node and an -// optional value. The absolute path name is the concatenation of the -// SetRequest prefix and the Update path The path may reference either a -// directory or leaf node. If value is not present then path, and all its -// subelements, should be removed. If value set and path references a directory -// node, the value is the JSON encoded tree of values below that node, -// otherwise, if the value is a scalar and may be encoded in JSON are as raw -// BYTES. the value -// -// For an example of updating a directory node, consider a tree that has the -// following values: -// -// /a/b/c: 1 -// /a/b/d: 2 -// /a/b/e: 3 -// -// And an Update of -// -// Path: /a/b -// Value: "{c: 4, f: 5}" -// -// The result is that /a/b/d and /a/b/e are removed, /a/b/c now has the value of -// 4, and /a/b/f is added with the value of 5. -message Update { - Path path = 1; - Value value = 2; -} - -// A Path represents an OpenConfig path as a list of strings, one path element -// per string. -message Path { - repeated string element = 1; -} - -// A Value is either raw data or a JSON encoded value. An enumerated value is -// of type JSON, with the numeric value in the value field and the name of the -// enumerated value in the name field. -message Value { - bytes value = 1; - Type type = 2; - string name = 3; -} - -// A Type describes what format a Value's data is encoded in. -enum Type { - JSON = 0; - BYTES = 1; - PROTO = 2; -} - -// GetModelsRequest contains a list of models to return. If no queries are -// specified, all currently support models will be returned. ModelReturnType -// specifies the format of the model to return. By default, only summaries will -// be returned. -message GetModelsRequest { - // Type selects to return only the summary model information or - // the full YANG model as bytes. The caller is responsible for extracting the - // YANG model from the bytes. - enum Type { - SUMMARY = 0; // Request only name, namespace, version information. - DETAIL = 1; // Request the YANG model as well has summary information. - } - Type request_type = 1; - ModelQuery query = 2; -} - -// ModelQuery contains a name and/or namespace regex pattern to match against -// supported models on the system. -message ModelQuery { - string name = 1; // re2 pattern match of the model name. - string namespace = 2; // re2 pattern match of the model namespace. - string version = 3; // re2 pattern match of the model version. -} - -// GetModelsResponse returns a list of models supported by the system. -message GetModelsResponse { - // List of models supported by the system. - repeated ModelData models = 1; -} - -// ModelData contains the summary information for the model as well as the -// actual model data if requested. -message ModelData { - string name = 1; // name of the model. - string namespace = 2; // namespace of the model. - string version = 3; // version supported. - bytes data = 4; // byte data of the YANG text file. - enum Type { - MODULE = 0; // data describes a YANG module - BUNDLE = 1; // data describes a defined bundle - AUGMENTATION = 3; // data describes a YANG module augmentation - DEVIATION = 4; // data describes a YANG module deviation - } - Type model_type = 5; -} - -// A GetRequest requests all the values identified by path be returns in a -// single GetResponse message. -// -// If cache_interval is provided and is non-zero number of nanoseconds, it is -// a hint of when this get request will be repeated in the future. -message GetRequest { - Path prefix = 1; // If set, each path is relative to prefix - repeated Path path = 2; // List of paths to return information for - // Type defines the mode that Get should use (GET_TYPE in the - // RPC specification YANG schema). - enum Type { - ALL = 0; // Return all data - CONFIG = 1; // Only return values in Config containers - STATE = 2; // Only return values in State containers - OPERATIONAL = 3; // Only values in State containers not modeled in Config - } - Type type = 3; // Limit what type of values are returned. - int64 cache_interval = 4; -} - -message GetResponse { - repeated Notification notification = 1; -} - -// A SetRequest contains an optional prefix, a list of zero or more Paths to -// delete, a list of zero or more paths to replace, and a list of zero of more -// paths to update. Deletes should appear to happen first, followed by -// replacements, followed by updates. -// -// If the path lists a node, rather than leaf, the value is presented in JSON. -// When included in replace, it is as if the path was first deleted. When -// included in update, the value augments the existing value, if any. -// -// The target must either apply all the deletes, replacements, and updates or -// return an error. The deletes, replacements, and updates should appear to be -// atomically applied. -// -// Non-existing but otherwise valid paths are valid for all operations. Deletes -// to a non-existing path are a no-op. Updates and replaces to a non-existing -// path will create a path with its values set to values contained in the -// Update. Any unspecified values will be set to system defaults. -// -// Example: -// A SetRequest consisting of a single replace, which has a Path of "/" -// and a Value of the full current configuration of a target, in JSON, should -// not result in any state changes on the system. -message SetRequest { - Path prefix = 1; - repeated Path delete = 2; - repeated Update replace = 3; - repeated Update update = 4; -} - -// A SetResponse contains responses to a SetRequest. The optional prefix is -// applied to all paths in response. Each operation and path in a SetRequest -// requires a response. The target may return additional informational messages -// in the response such as path not found for a delete or update. -message SetResponse { - Path prefix = 1; - repeated UpdateResponse response = 2; -} - -// An UpdateResponse contains the response for a single path Update. -message UpdateResponse { - enum Operation { - NOT_SPECIFIED = 0; - DELETE = 1; - REPLACE = 2; - UPDATE = 3; - } - // The timestamp is the time, in nanoseconds since the epoch, that a Set was - // accepted (i.e., the request was valid). It does not imply the value was - // actually propagated to an underlying datastore. - int64 timestamp = 1; - Path path = 2; // path provided in SetRequest. - // message contains an informational or an error message. Required for - // unsuccessful SetRequest operations. - Error message = 3; - Operation op = 4; // optional operation applied to the path. -} - -// An Error contains information about why a particular request failed. -// Examples of informational errors are included in the RPC specification -// YANG modules. -// -// The canonical error codes are defined for each language. -// -// Go: import "google.golang.org/grpc/codes" -// C++: #include -// Java: import static io.grpc.Status.Code; -// C: #include -// C#: using Grpc.Core; -message Error { - uint32 code = 1; // Canonical gRPC error code - string message = 2; // Human readable error - google.protobuf.Any data = 3; // optional additional information -} - -// A SubscribeRequest is either a subscription request, a change to the -// heartbeat rate, initiating a poll, or defining an alias. It is always sent -// from the client to the target. -message SubscribeRequest { - oneof request { - SubscriptionList subscribe = 1; // See description for SubscriptionList - Heartbeat heartbeat = 2; // See description for Heartbeat - PollRequest poll = 3; // See description for PollRequest - AliasList aliases = 4; // See description for AliasList - } - Proxies proxy = 5; // See description in Proxies -} - -// SubscriptionList contains the list of individual subscriptions. A -// SubscriptionList is only valid if all of the contained subscriptions are -// valid. -// -// A SubscriptionList operates in one of three modes, all of which operate on -// the streaming channel. -// -// STREAM: This is the default mode. The target must send notifications for -// all subscribed values. After each subscribed value as been sent at least -// once, the target must send a sync_response. The target continues to send -// update notifications for the subscribed values as indicated in the -// subscription. -// -// ONCE: This mode is used to send a one-time request for data to the target -// by setting once to true in the SubscriptionRequest. The target sends each -// subscribed value once, followed by a sync_response (indicating all values -// were sent) and then closes the stream. -// -// POLL: This mode provides a method to send periodic requests over a single -// stream similar to conventional polling. In this mode, the client is able to -// control when data is sent by the target, in contrast to the STREAM mode. -// With a single declared subscription, the target need only parse the -// subscription once, and can expect periodic requests for the corresponding -// data. -// -// After sending a SubscriptionList with mode set to POLL, polls are initiated -// by sending a PollRequest. The target sends no notifications to the client -// until the first PollRequest is received. The target responds by sending each -// subscribed value once, followed by a sync_response. This process repeats -// for subsequent polls. -// -// Polling mode is optional. If a target does not support the polling mode, it -// must reject a polling subscription request. If a client sends a new poll -// before the previous poll completes, the target should close the stream with -// an error. -// -// If prefix is set then all subscriptions in the list and all notifications -// generated are relative to prefix. -// -// If qos is provided then marking is the QOS marking to use for this session. -// The target should use this QOS marking, if supported. -// -// In the event of overlapping subscription, the most specific subscription for -// a value is used. For example, if the following two subscriptions were made: -// -// /interfaces/interfaces//state -// /interfaces/interfaces//state/counters -// -// Then values in state outside of counters would be subject to the first -// subscription. Values inside of counters would be subject to the second -// subscription. -message SubscriptionList { - Path prefix = 1; - repeated Subscription subscription = 2; - bool use_aliases = 3; // client accepts target defined aliases - QOSMarking qos = 4; // QOS marking level target should use. - enum Mode { - STREAM = 0; - ONCE = 1; - POLL = 2; - } - Mode mode = 5; -} - -// Subscription contains a path as well as information on how two send -// notifications. -// -// A Subscription contains subscription information for a single path. The path -// may be either a leaf node or a directory node in the tree. When subscribing -// for a directory node, all nodes below it are automatically included in the -// subscription. -// -// If mode is ON_CHANGE, then the target must either be able to send -// notifications each time a value changes or reject the subscription. This is -// typically used for events. The sample_interval is ignored when the mode in -// ON_CHANGE. -// -// If mode is SAMPLE, the target must coalesce notifications based on the -// provided sample_interval. This is typically used for aggregating values -// (i.e., counters). The sample_interval, if not 0, is the number of -// nanoseconds between updates. If 0, the interval is selected by the target. -// If the target cannot support the supplied sample_interval, the Subscription -// must be rejected. The sample_interval is only used for subscriptions in -// streaming mode. The sample_interval is ignored if mode is not SAMPLE. -// -// (Setting mode to SAMPLE and sample_interval to 0 is functionally the -// same as setting mode to TARGET_DEFINED.) -// -// The suppress_redundant field, if true, indicates the target should not send -// notifications for fields that are unchanged since. This value is ignored -// if mode is not SAMPLE. -// -// The heartbeat_interval field specifies how frequently an unchanged value must -// be sent regardless of the suppress_redundant field. A value of 0 indicates -// there is no heartbeat_interval and values only need to be sent when changed. -// The target must reject a subscription if it cannot support the requested -// heartbeat_interval. This value is ignored if mode is not SAMPLE. -message Subscription { - Path path = 1; - SubscriptionMode mode = 2; - uint64 sample_interval = 3; // nanoseconds between updates - bool suppress_redundant = 4; // do not send updates for unchanged values - uint64 heartbeat_interval = 5; // maximum silent period in nanoseconds -} - -// SubscriptionMode mode informs the target how notifications should be -// delivered, as they change or coalesced. When the mode is TARGET_DEFINED the -// target chooses the mode the best suits the value. When the mode is -// ON_CHANGE, the target must send a notification each time the value changes. -// When the mode is SAMPLE, the target send notifications at some sampling -// interval. -enum SubscriptionMode { - TARGET_DEFINED = 0; // target determines mode - ON_CHANGE = 1; // send notification on change (event mode) - SAMPLE = 2; // coalesce values (sampled mode) -} - -// A QOSMarking describes the QOS marking to use, if supported by the target. -message QOSMarking { - uint32 marking = 1; -} - -// An AliasList represents a list of aliases. -message AliasList { - repeated Alias alias = 1; -} - -// An Alias specifies a preferred client defined alias for a specified path. An -// Alias is only sent from the client to the target. An alias is typically one -// element and is much shorter than the provided path. A target should -// substitute alias for path in Notifications. Targets may ignore Alias -// messages. -// -// The path must be fully expanded and not use an alias. -// -// If alias is set and path is not then the alias must no longer be used by the -// target, once received. A client may still see Notifications using the alias -// that were generated prior to the target receiving the request to stop using -// the alias. -message Alias { - Path path = 1; - Path alias = 2; -} - -// A PollRequest requests that all values in the subscription be resent. -message PollRequest { -} - -// Proxies is a list of proxies to use to get to the target. The first proxy -// listed is the the next hop. Actual targets ignore the proxy field (it should -// not be set when the request reaches the target). -// -// The target_name is an optional informational field describing the ultimate -// destination of the subscribe request. Proxies may find it useful to use this -// information in logs and errors. -// -// The client_name is an optional informational field describing the client -// making the subscribe request. Proxies may find it useful to use this -// information in logs and errors. -message Proxies { - repeated Proxy proxy = 1; - string target_name = 2; - string client_name = 3; -} - -// A Proxy represents a proxy service to use when connecting to the target. -message Proxy { - string address = 1; // IP address of the proxy - string name = 2; // optional informational name for the proxy -} - -// A SubscribeResponse is always sent from the target to the client. -// -// Notifications are sent as described above in SubscribeList. -// -// A sync_response is sent when the target finishes sending all the subscribed -// values at least once. sync_response must be set to true for the client to -// consider the stream synced. -message SubscribeResponse { - oneof response { - Notification update = 1; - Heartbeat heartbeat = 2; // See description for Heartbeat - bool sync_response = 3; - } -} - -// A Heartbeat requests a (possibly repeated) response from the remote side. -message Heartbeat { - // interval is the maximum amount of time, in nanoseconds, between subsequent - // messages from the remote side. An empty message may be sent if no other - // messages are pending. If interval is 0 then the remote must immediately - // respond with a (possibly empty) message. - uint64 interval = 1; -} - -// UDPWrapper adds metadata necessary for encapsulating a list of notifications -// into a UDP packet. It adds the ability to identify the target that -// originated the Notifications, detect packet loss, and identify latency -// introduced by the target wrapping notifications. -// -// The target should keep the total size of a serialized UDPWrapper message -// small enough to not cause IP packet fragmentation. -message UDPWrapper { - // ID Identifies the target (e.g., Loopback IP address, linecard, ...) - // TODO(borman): Add examples. Perhaps agent/module/submodule for vendor. - Path id = 1; - - // Optional Epoch time of when the message is queued for transmit. - // Useful to quantify delay between message generation and transmission. - uint64 transmit_timestamp = 2; - - // The sequence_number must start at 1 and increment by 1 for each new packet - // sent. A client may use this to determine if a packet was lost. - uint64 sequence_number = 3; - - repeated Notification notification = 4; -}