github.com/psiphon-labs/goarista@v0.0.0-20160825065156-d002785f4c67/openconfig/openconfig.pb.go (about) 1 // Copyright 2015 Google, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // Code generated by protoc-gen-go. 15 // source: openconfig.proto 16 // DO NOT EDIT! 17 18 /* 19 Package openconfig is a generated protocol buffer package. 20 21 Package openconfig defines the gRPC service for getting and setting the 22 OpenConfig configuration and state of a network device. 23 24 This package and its contents have not been ratified by OpenConfig. It is 25 a working proposal by Google. 26 27 It is generated from these files: 28 openconfig.proto 29 30 It has these top-level messages: 31 Path 32 Value 33 Update 34 Notification 35 UDPWrapper 36 Error 37 SubscribeRequest 38 SubscribeResponse 39 SubscriptionList 40 Subscription 41 AliasList 42 Alias 43 Heartbeat 44 SyncRequest 45 GetRequest 46 GetResponse 47 SetRequest 48 SetResponse 49 UpdateResponse 50 */ 51 package openconfig 52 53 import proto "github.com/golang/protobuf/proto" 54 import fmt "fmt" 55 import math "math" 56 import google_protobuf "github.com/golang/protobuf/ptypes/any" 57 58 import ( 59 context "golang.org/x/net/context" 60 grpc "google.golang.org/grpc" 61 ) 62 63 // Reference imports to suppress errors if they are not otherwise used. 64 var _ = proto.Marshal 65 var _ = fmt.Errorf 66 var _ = math.Inf 67 68 // This is a compile-time assertion to ensure that this generated file 69 // is compatible with the proto package it is being compiled against. 70 // A compilation error at this line likely means your copy of the 71 // proto package needs to be updated. 72 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 73 74 // A Type describes what format a Value's data is encoded in. 75 type Type int32 76 77 const ( 78 Type_JSON Type = 0 79 Type_BYTES Type = 1 80 ) 81 82 var Type_name = map[int32]string{ 83 0: "JSON", 84 1: "BYTES", 85 } 86 var Type_value = map[string]int32{ 87 "JSON": 0, 88 "BYTES": 1, 89 } 90 91 func (x Type) String() string { 92 return proto.EnumName(Type_name, int32(x)) 93 } 94 func (Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 95 96 // A Path represents an open config path as a list of strings, one element 97 // per string. 98 type Path struct { 99 Element []string `protobuf:"bytes,1,rep,name=element" json:"element,omitempty"` 100 } 101 102 func (m *Path) Reset() { *m = Path{} } 103 func (m *Path) String() string { return proto.CompactTextString(m) } 104 func (*Path) ProtoMessage() {} 105 func (*Path) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 106 107 // A Value is either raw data or a JSON encoded value. An enumerated value is 108 // of type JSON, with the numeric value in the value field and the name of the 109 // enumerated value in the name field. 110 type Value struct { 111 Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` 112 Type Type `protobuf:"varint,2,opt,name=type,enum=openconfig.Type" json:"type,omitempty"` 113 Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` 114 } 115 116 func (m *Value) Reset() { *m = Value{} } 117 func (m *Value) String() string { return proto.CompactTextString(m) } 118 func (*Value) ProtoMessage() {} 119 func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 120 121 // An Update maps a path to a value. 122 // 123 // In a Notification, an Update represents a new or updated value for path. The 124 // absolute path name is the concatenation of the Notification prefix and the 125 // Update path. Updates are only sent by the target. Path must always specify 126 // a leaf node. Value should be a scalar value (e.g., if Value is JSON encoded 127 // then the value 123 is acceptable, but {"x":123} is not). 128 // 129 // In a SetRequest, an Update contains a path to a read-write node and an 130 // optional value. The absolute path name is the concatenation of the 131 // SetRequest prefix and the Update path The path may reference either a 132 // directory or leaf node. If value is not present then path, and all its 133 // subelements, should be removed. If value set and path references a directory 134 // node, the value is the JSON encoded tree of values below that node, 135 // otherwise, if the value is a scalar and may be encoded in JSON are as raw 136 // BYTES. the value 137 // 138 // For an example of updating a directory node, consider a tree that has the 139 // following values: 140 // 141 // /a/b/c: 1 142 // /a/b/d: 2 143 // /a/b/e: 3 144 // 145 // And an Update of 146 // 147 // Path: /a/b 148 // Value: "{c: 4, f: 5}" 149 // 150 // The result is that /a/b/d and /a/b/e are removed, /a/b/c now has the value of 151 // 4, and /a/b/f is added with the value of 5. 152 type Update struct { 153 Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` 154 Value *Value `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` 155 } 156 157 func (m *Update) Reset() { *m = Update{} } 158 func (m *Update) String() string { return proto.CompactTextString(m) } 159 func (*Update) ProtoMessage() {} 160 func (*Update) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 161 162 func (m *Update) GetPath() *Path { 163 if m != nil { 164 return m.Path 165 } 166 return nil 167 } 168 169 func (m *Update) GetValue() *Value { 170 if m != nil { 171 return m.Value 172 } 173 return nil 174 } 175 176 // A Notification is a list of updates to apply. Deletes are a list of paths to 177 // delete as long as their data is older than timestamp. Deleting nodes deletes 178 // all values below the node that are older than timestamp. Deletes are 179 // performed after updates are applied. Delete paths are created by 180 // concatenating the prefix, if present, with the individual paths. 181 // 182 // Update paths are created by concatenating the prefix, if present, with the 183 // paths contained in the Updates. 184 // 185 // It is valid to have a path be both in an update and match a delete. The 186 // deletion will only delete values that are older than this update. 187 // 188 // Each notification should contain at most a single update for a given path. 189 // If a nonconforming implementation does send multiple updates for a given path 190 // in a single notification, all but the final update should be ignored. 191 // 192 // The prefix should normally be the longest common prefix to all the individual 193 // update and delete path. This reduces the repetition of the common prefix in 194 // each update and/or delete. The individual updates and deletes also are a 195 // Path (repeated list of elements), allowing a notification such as: 196 // 197 // prefix: /a/b/c 198 // update: { 199 // path: d 200 // value: x 201 // } 202 // update: { 203 // path: e/f 204 // value: y 205 // } 206 // update: { 207 // path: e/g 208 // value: z 209 // } 210 // 211 // The prefix may begin with an alias. An alias is a Path with 1 or more 212 // elements, which maps to another Path. Aliases may be defined by either the 213 // target or the client. Target defined aliases are limited to a single 214 // element. Aliases are client specific (though a target may define the same 215 // alias for multiple clients). 216 // 217 // The target defines an alias by sending a Notification that has alias set and 218 // a non-empty prefix. When alias is set, a Notification need not provide 219 // updates or deletes. If the alias was previously defined, it is over ridden 220 // with the new definition. Once defined, the target may send the value of 221 // alias as the first element of a prefix. A target must not send target 222 // defined aliases to clients that do not specify the use_aliases option in the 223 // initial SubscriptionList message. A target does not need to define aliases 224 // even if the client does specify the use_aliases option in the initial 225 // SubscriptionLlist message. 226 // 227 // Clients define aliases by sending a SubscriptionRequest with aliases set. 228 // 229 // A target should use a define alias when possible, but is not required to. A 230 // target may ignore client defined aliases. 231 // 232 // Clients should not define aliases that valid paths in the data tree. The 233 // target must not define aliases that valid paths in the dat tree. 234 // 235 // If a target sends a notification with alias set, but not prefix, then it is 236 // indicating it will no longer use this alias. The client may delete this 237 // alias from its list of aliases. A target may not delete an alias defined by 238 // the client. It is implementation dependent on what happens if the client 239 // defines an alias that is also defined by the target. 240 // 241 // Aliases must not be used in UDP packets. 242 // 243 // If a client sets the use_aliases option, or defines aliases, in the initial 244 // SubscriptionList message, then it must always check the initial elements of a 245 // prefix against the list of known aliases, expanding the prefix as needed. 246 // Aliases must always be defined as fully expanded prefixes. Only single alias 247 // lookup is needed per Notification. 248 // 249 // Target defined aliases may be any unique string. A target may choose to use 250 // a unique prefix for aliases to make them visually distinct. For example, a 251 // target might construct all aliases as an @ character followed by a decimal or 252 // hexadecimal number (perhaps a hashed address in memory). 253 // 254 // Example: 255 // 256 // Define @42 as an alias: 257 // 258 // timestamp: 1439416376123456789 259 // prefix: "this_is" 260 // prefix: "a_long" 261 // prefix: "prefix" 262 // alias: "@42 263 // 264 // Use @42 as an alias to set /this_is/a_long/prefix/Ethernet0/0/1/in-octets to 265 // 17: 266 // 267 // timestamp: 1439416376456456456 268 // prefix: "@42" 269 // prefix: "Ethernet0/0/1" 270 // update: { 271 // path: { 272 // element: "in-octets" 273 // } 274 // value: 17 275 // } 276 // 277 // Delete the alias @42: 278 // 279 // timestamp: 1439416376987654321 280 // alias: @42 281 type Notification struct { 282 Timestamp int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` 283 Prefix *Path `protobuf:"bytes,2,opt,name=prefix" json:"prefix,omitempty"` 284 Alias string `protobuf:"bytes,3,opt,name=alias" json:"alias,omitempty"` 285 Update []*Update `protobuf:"bytes,4,rep,name=update" json:"update,omitempty"` 286 Delete []*Path `protobuf:"bytes,5,rep,name=delete" json:"delete,omitempty"` 287 } 288 289 func (m *Notification) Reset() { *m = Notification{} } 290 func (m *Notification) String() string { return proto.CompactTextString(m) } 291 func (*Notification) ProtoMessage() {} 292 func (*Notification) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } 293 294 func (m *Notification) GetPrefix() *Path { 295 if m != nil { 296 return m.Prefix 297 } 298 return nil 299 } 300 301 func (m *Notification) GetUpdate() []*Update { 302 if m != nil { 303 return m.Update 304 } 305 return nil 306 } 307 308 func (m *Notification) GetDelete() []*Path { 309 if m != nil { 310 return m.Delete 311 } 312 return nil 313 } 314 315 // UDPWrapper adds metadata necessary for encapsulating a list of notifications 316 // into a UDP packet. It adds the ability to identify the agent that originated 317 // the Notifications, detect packet loss, and identify latency introduced by 318 // the target wrapping notifications. 319 // 320 // The target should keep the total size of a serialized UDPWrapper message 321 // small enough to not cause IP packet fragmentation. 322 type UDPWrapper struct { 323 // ID Identifies the device (e.g., Loopback IP address, linecard, ...) 324 // TODO(borman): Add examples. Perhaps Agent/module/submodule for juniper. 325 Id *Path `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` 326 // Optional Epoch time of when the message is queued for transmit. 327 // Useful to quantify delay between message generation and transmission. 328 TransmitTimestamp uint64 `protobuf:"varint,2,opt,name=transmit_timestamp,json=transmitTimestamp" json:"transmit_timestamp,omitempty"` 329 // The sequence_number must start at 1 and increment by 1 for each new packet 330 // sent. A client may use this to determine if a packet was lost. 331 SequenceNumber uint64 `protobuf:"varint,3,opt,name=sequence_number,json=sequenceNumber" json:"sequence_number,omitempty"` 332 Notification []*Notification `protobuf:"bytes,4,rep,name=notification" json:"notification,omitempty"` 333 } 334 335 func (m *UDPWrapper) Reset() { *m = UDPWrapper{} } 336 func (m *UDPWrapper) String() string { return proto.CompactTextString(m) } 337 func (*UDPWrapper) ProtoMessage() {} 338 func (*UDPWrapper) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } 339 340 func (m *UDPWrapper) GetId() *Path { 341 if m != nil { 342 return m.Id 343 } 344 return nil 345 } 346 347 func (m *UDPWrapper) GetNotification() []*Notification { 348 if m != nil { 349 return m.Notification 350 } 351 return nil 352 } 353 354 // An Error contains information about why a particular request failed. 355 // 356 // The canonical error codes are defined for each language. 357 // 358 // Go: import "google.golang.org/grpc/codes" 359 // C++: #include <grpc++/status_code_enum.h> 360 // Java: import static io.grpc.Status.Code; 361 // C: #include <grpc/status.h> 362 // C#: using Grpc.Core; 363 type Error struct { 364 Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` 365 Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` 366 Data *google_protobuf.Any `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"` 367 } 368 369 func (m *Error) Reset() { *m = Error{} } 370 func (m *Error) String() string { return proto.CompactTextString(m) } 371 func (*Error) ProtoMessage() {} 372 func (*Error) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } 373 374 func (m *Error) GetData() *google_protobuf.Any { 375 if m != nil { 376 return m.Data 377 } 378 return nil 379 } 380 381 // A SubscribeRequest is either a subscription request, a change to the 382 // heartbeat rate, or a request for resynchronization of data. It is always 383 // sent from the client to the target. 384 // 385 // Proxy is a list of proxies to use to get to the target. The first proxy 386 // listed is the address of the next hop. Targets ignore the proxy field (it 387 // should not be set). 388 type SubscribeRequest struct { 389 // Types that are valid to be assigned to Request: 390 // *SubscribeRequest_Subscribe 391 // *SubscribeRequest_Heartbeat 392 // *SubscribeRequest_Sync 393 // *SubscribeRequest_Aliases 394 Request isSubscribeRequest_Request `protobuf_oneof:"request"` 395 Proxy []string `protobuf:"bytes,5,rep,name=proxy" json:"proxy,omitempty"` 396 } 397 398 func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} } 399 func (m *SubscribeRequest) String() string { return proto.CompactTextString(m) } 400 func (*SubscribeRequest) ProtoMessage() {} 401 func (*SubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } 402 403 type isSubscribeRequest_Request interface { 404 isSubscribeRequest_Request() 405 } 406 407 type SubscribeRequest_Subscribe struct { 408 Subscribe *SubscriptionList `protobuf:"bytes,1,opt,name=subscribe,oneof"` 409 } 410 type SubscribeRequest_Heartbeat struct { 411 Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,oneof"` 412 } 413 type SubscribeRequest_Sync struct { 414 Sync *SyncRequest `protobuf:"bytes,3,opt,name=sync,oneof"` 415 } 416 type SubscribeRequest_Aliases struct { 417 Aliases *AliasList `protobuf:"bytes,4,opt,name=aliases,oneof"` 418 } 419 420 func (*SubscribeRequest_Subscribe) isSubscribeRequest_Request() {} 421 func (*SubscribeRequest_Heartbeat) isSubscribeRequest_Request() {} 422 func (*SubscribeRequest_Sync) isSubscribeRequest_Request() {} 423 func (*SubscribeRequest_Aliases) isSubscribeRequest_Request() {} 424 425 func (m *SubscribeRequest) GetRequest() isSubscribeRequest_Request { 426 if m != nil { 427 return m.Request 428 } 429 return nil 430 } 431 432 func (m *SubscribeRequest) GetSubscribe() *SubscriptionList { 433 if x, ok := m.GetRequest().(*SubscribeRequest_Subscribe); ok { 434 return x.Subscribe 435 } 436 return nil 437 } 438 439 func (m *SubscribeRequest) GetHeartbeat() *Heartbeat { 440 if x, ok := m.GetRequest().(*SubscribeRequest_Heartbeat); ok { 441 return x.Heartbeat 442 } 443 return nil 444 } 445 446 func (m *SubscribeRequest) GetSync() *SyncRequest { 447 if x, ok := m.GetRequest().(*SubscribeRequest_Sync); ok { 448 return x.Sync 449 } 450 return nil 451 } 452 453 func (m *SubscribeRequest) GetAliases() *AliasList { 454 if x, ok := m.GetRequest().(*SubscribeRequest_Aliases); ok { 455 return x.Aliases 456 } 457 return nil 458 } 459 460 // XXX_OneofFuncs is for the internal use of the proto package. 461 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{}) { 462 return _SubscribeRequest_OneofMarshaler, _SubscribeRequest_OneofUnmarshaler, _SubscribeRequest_OneofSizer, []interface{}{ 463 (*SubscribeRequest_Subscribe)(nil), 464 (*SubscribeRequest_Heartbeat)(nil), 465 (*SubscribeRequest_Sync)(nil), 466 (*SubscribeRequest_Aliases)(nil), 467 } 468 } 469 470 func _SubscribeRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 471 m := msg.(*SubscribeRequest) 472 // request 473 switch x := m.Request.(type) { 474 case *SubscribeRequest_Subscribe: 475 b.EncodeVarint(1<<3 | proto.WireBytes) 476 if err := b.EncodeMessage(x.Subscribe); err != nil { 477 return err 478 } 479 case *SubscribeRequest_Heartbeat: 480 b.EncodeVarint(2<<3 | proto.WireBytes) 481 if err := b.EncodeMessage(x.Heartbeat); err != nil { 482 return err 483 } 484 case *SubscribeRequest_Sync: 485 b.EncodeVarint(3<<3 | proto.WireBytes) 486 if err := b.EncodeMessage(x.Sync); err != nil { 487 return err 488 } 489 case *SubscribeRequest_Aliases: 490 b.EncodeVarint(4<<3 | proto.WireBytes) 491 if err := b.EncodeMessage(x.Aliases); err != nil { 492 return err 493 } 494 case nil: 495 default: 496 return fmt.Errorf("SubscribeRequest.Request has unexpected type %T", x) 497 } 498 return nil 499 } 500 501 func _SubscribeRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 502 m := msg.(*SubscribeRequest) 503 switch tag { 504 case 1: // request.subscribe 505 if wire != proto.WireBytes { 506 return true, proto.ErrInternalBadWireType 507 } 508 msg := new(SubscriptionList) 509 err := b.DecodeMessage(msg) 510 m.Request = &SubscribeRequest_Subscribe{msg} 511 return true, err 512 case 2: // request.heartbeat 513 if wire != proto.WireBytes { 514 return true, proto.ErrInternalBadWireType 515 } 516 msg := new(Heartbeat) 517 err := b.DecodeMessage(msg) 518 m.Request = &SubscribeRequest_Heartbeat{msg} 519 return true, err 520 case 3: // request.sync 521 if wire != proto.WireBytes { 522 return true, proto.ErrInternalBadWireType 523 } 524 msg := new(SyncRequest) 525 err := b.DecodeMessage(msg) 526 m.Request = &SubscribeRequest_Sync{msg} 527 return true, err 528 case 4: // request.aliases 529 if wire != proto.WireBytes { 530 return true, proto.ErrInternalBadWireType 531 } 532 msg := new(AliasList) 533 err := b.DecodeMessage(msg) 534 m.Request = &SubscribeRequest_Aliases{msg} 535 return true, err 536 default: 537 return false, nil 538 } 539 } 540 541 func _SubscribeRequest_OneofSizer(msg proto.Message) (n int) { 542 m := msg.(*SubscribeRequest) 543 // request 544 switch x := m.Request.(type) { 545 case *SubscribeRequest_Subscribe: 546 s := proto.Size(x.Subscribe) 547 n += proto.SizeVarint(1<<3 | proto.WireBytes) 548 n += proto.SizeVarint(uint64(s)) 549 n += s 550 case *SubscribeRequest_Heartbeat: 551 s := proto.Size(x.Heartbeat) 552 n += proto.SizeVarint(2<<3 | proto.WireBytes) 553 n += proto.SizeVarint(uint64(s)) 554 n += s 555 case *SubscribeRequest_Sync: 556 s := proto.Size(x.Sync) 557 n += proto.SizeVarint(3<<3 | proto.WireBytes) 558 n += proto.SizeVarint(uint64(s)) 559 n += s 560 case *SubscribeRequest_Aliases: 561 s := proto.Size(x.Aliases) 562 n += proto.SizeVarint(4<<3 | proto.WireBytes) 563 n += proto.SizeVarint(uint64(s)) 564 n += s 565 case nil: 566 default: 567 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 568 } 569 return n 570 } 571 572 // A SubscribeResponse is always sent from the target to the client. 573 type SubscribeResponse struct { 574 // Types that are valid to be assigned to Response: 575 // *SubscribeResponse_Update 576 // *SubscribeResponse_Heartbeat 577 // *SubscribeResponse_SyncResponse 578 Response isSubscribeResponse_Response `protobuf_oneof:"response"` 579 } 580 581 func (m *SubscribeResponse) Reset() { *m = SubscribeResponse{} } 582 func (m *SubscribeResponse) String() string { return proto.CompactTextString(m) } 583 func (*SubscribeResponse) ProtoMessage() {} 584 func (*SubscribeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } 585 586 type isSubscribeResponse_Response interface { 587 isSubscribeResponse_Response() 588 } 589 590 type SubscribeResponse_Update struct { 591 Update *Notification `protobuf:"bytes,1,opt,name=update,oneof"` 592 } 593 type SubscribeResponse_Heartbeat struct { 594 Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,oneof"` 595 } 596 type SubscribeResponse_SyncResponse struct { 597 SyncResponse uint64 `protobuf:"varint,3,opt,name=sync_response,json=syncResponse,oneof"` 598 } 599 600 func (*SubscribeResponse_Update) isSubscribeResponse_Response() {} 601 func (*SubscribeResponse_Heartbeat) isSubscribeResponse_Response() {} 602 func (*SubscribeResponse_SyncResponse) isSubscribeResponse_Response() {} 603 604 func (m *SubscribeResponse) GetResponse() isSubscribeResponse_Response { 605 if m != nil { 606 return m.Response 607 } 608 return nil 609 } 610 611 func (m *SubscribeResponse) GetUpdate() *Notification { 612 if x, ok := m.GetResponse().(*SubscribeResponse_Update); ok { 613 return x.Update 614 } 615 return nil 616 } 617 618 func (m *SubscribeResponse) GetHeartbeat() *Heartbeat { 619 if x, ok := m.GetResponse().(*SubscribeResponse_Heartbeat); ok { 620 return x.Heartbeat 621 } 622 return nil 623 } 624 625 func (m *SubscribeResponse) GetSyncResponse() uint64 { 626 if x, ok := m.GetResponse().(*SubscribeResponse_SyncResponse); ok { 627 return x.SyncResponse 628 } 629 return 0 630 } 631 632 // XXX_OneofFuncs is for the internal use of the proto package. 633 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{}) { 634 return _SubscribeResponse_OneofMarshaler, _SubscribeResponse_OneofUnmarshaler, _SubscribeResponse_OneofSizer, []interface{}{ 635 (*SubscribeResponse_Update)(nil), 636 (*SubscribeResponse_Heartbeat)(nil), 637 (*SubscribeResponse_SyncResponse)(nil), 638 } 639 } 640 641 func _SubscribeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 642 m := msg.(*SubscribeResponse) 643 // response 644 switch x := m.Response.(type) { 645 case *SubscribeResponse_Update: 646 b.EncodeVarint(1<<3 | proto.WireBytes) 647 if err := b.EncodeMessage(x.Update); err != nil { 648 return err 649 } 650 case *SubscribeResponse_Heartbeat: 651 b.EncodeVarint(2<<3 | proto.WireBytes) 652 if err := b.EncodeMessage(x.Heartbeat); err != nil { 653 return err 654 } 655 case *SubscribeResponse_SyncResponse: 656 b.EncodeVarint(3<<3 | proto.WireVarint) 657 b.EncodeVarint(uint64(x.SyncResponse)) 658 case nil: 659 default: 660 return fmt.Errorf("SubscribeResponse.Response has unexpected type %T", x) 661 } 662 return nil 663 } 664 665 func _SubscribeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 666 m := msg.(*SubscribeResponse) 667 switch tag { 668 case 1: // response.update 669 if wire != proto.WireBytes { 670 return true, proto.ErrInternalBadWireType 671 } 672 msg := new(Notification) 673 err := b.DecodeMessage(msg) 674 m.Response = &SubscribeResponse_Update{msg} 675 return true, err 676 case 2: // response.heartbeat 677 if wire != proto.WireBytes { 678 return true, proto.ErrInternalBadWireType 679 } 680 msg := new(Heartbeat) 681 err := b.DecodeMessage(msg) 682 m.Response = &SubscribeResponse_Heartbeat{msg} 683 return true, err 684 case 3: // response.sync_response 685 if wire != proto.WireVarint { 686 return true, proto.ErrInternalBadWireType 687 } 688 x, err := b.DecodeVarint() 689 m.Response = &SubscribeResponse_SyncResponse{x} 690 return true, err 691 default: 692 return false, nil 693 } 694 } 695 696 func _SubscribeResponse_OneofSizer(msg proto.Message) (n int) { 697 m := msg.(*SubscribeResponse) 698 // response 699 switch x := m.Response.(type) { 700 case *SubscribeResponse_Update: 701 s := proto.Size(x.Update) 702 n += proto.SizeVarint(1<<3 | proto.WireBytes) 703 n += proto.SizeVarint(uint64(s)) 704 n += s 705 case *SubscribeResponse_Heartbeat: 706 s := proto.Size(x.Heartbeat) 707 n += proto.SizeVarint(2<<3 | proto.WireBytes) 708 n += proto.SizeVarint(uint64(s)) 709 n += s 710 case *SubscribeResponse_SyncResponse: 711 n += proto.SizeVarint(3<<3 | proto.WireVarint) 712 n += proto.SizeVarint(uint64(x.SyncResponse)) 713 case nil: 714 default: 715 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 716 } 717 return n 718 } 719 720 // SubscriptionList contains the list of individual subscriptions. A 721 // SubscriptionList is only valid if all of the contained subscriptions are 722 // valid. Setting once to false or poll_interval to 0 is the equivalent of the 723 // mode not being set (i.e., streaming). 724 // 725 // If prefix is set then all subscriptions in the list and all notifications 726 // generated are relative to prefix. 727 // 728 // If poll_interval is not set, then a SubscriptionList must only be sent once. 729 // If poll_interval is set, the SubscriptionLists following the initial 730 // SubscriptionList must only contain a poll_interval. 731 type SubscriptionList struct { 732 // Types that are valid to be assigned to Mode: 733 // *SubscriptionList_Once 734 // *SubscriptionList_PollInterval 735 Mode isSubscriptionList_Mode `protobuf_oneof:"mode"` 736 Subscription []*Subscription `protobuf:"bytes,1,rep,name=subscription" json:"subscription,omitempty"` 737 Prefix *Path `protobuf:"bytes,2,opt,name=prefix" json:"prefix,omitempty"` 738 Options *SubscriptionList_Options `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` 739 } 740 741 func (m *SubscriptionList) Reset() { *m = SubscriptionList{} } 742 func (m *SubscriptionList) String() string { return proto.CompactTextString(m) } 743 func (*SubscriptionList) ProtoMessage() {} 744 func (*SubscriptionList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } 745 746 type isSubscriptionList_Mode interface { 747 isSubscriptionList_Mode() 748 } 749 750 type SubscriptionList_Once struct { 751 Once bool `protobuf:"varint,10,opt,name=once,oneof"` 752 } 753 type SubscriptionList_PollInterval struct { 754 PollInterval uint64 `protobuf:"varint,11,opt,name=poll_interval,json=pollInterval,oneof"` 755 } 756 757 func (*SubscriptionList_Once) isSubscriptionList_Mode() {} 758 func (*SubscriptionList_PollInterval) isSubscriptionList_Mode() {} 759 760 func (m *SubscriptionList) GetMode() isSubscriptionList_Mode { 761 if m != nil { 762 return m.Mode 763 } 764 return nil 765 } 766 767 func (m *SubscriptionList) GetOnce() bool { 768 if x, ok := m.GetMode().(*SubscriptionList_Once); ok { 769 return x.Once 770 } 771 return false 772 } 773 774 func (m *SubscriptionList) GetPollInterval() uint64 { 775 if x, ok := m.GetMode().(*SubscriptionList_PollInterval); ok { 776 return x.PollInterval 777 } 778 return 0 779 } 780 781 func (m *SubscriptionList) GetSubscription() []*Subscription { 782 if m != nil { 783 return m.Subscription 784 } 785 return nil 786 } 787 788 func (m *SubscriptionList) GetPrefix() *Path { 789 if m != nil { 790 return m.Prefix 791 } 792 return nil 793 } 794 795 func (m *SubscriptionList) GetOptions() *SubscriptionList_Options { 796 if m != nil { 797 return m.Options 798 } 799 return nil 800 } 801 802 // XXX_OneofFuncs is for the internal use of the proto package. 803 func (*SubscriptionList) 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{}) { 804 return _SubscriptionList_OneofMarshaler, _SubscriptionList_OneofUnmarshaler, _SubscriptionList_OneofSizer, []interface{}{ 805 (*SubscriptionList_Once)(nil), 806 (*SubscriptionList_PollInterval)(nil), 807 } 808 } 809 810 func _SubscriptionList_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 811 m := msg.(*SubscriptionList) 812 // mode 813 switch x := m.Mode.(type) { 814 case *SubscriptionList_Once: 815 t := uint64(0) 816 if x.Once { 817 t = 1 818 } 819 b.EncodeVarint(10<<3 | proto.WireVarint) 820 b.EncodeVarint(t) 821 case *SubscriptionList_PollInterval: 822 b.EncodeVarint(11<<3 | proto.WireVarint) 823 b.EncodeVarint(uint64(x.PollInterval)) 824 case nil: 825 default: 826 return fmt.Errorf("SubscriptionList.Mode has unexpected type %T", x) 827 } 828 return nil 829 } 830 831 func _SubscriptionList_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 832 m := msg.(*SubscriptionList) 833 switch tag { 834 case 10: // mode.once 835 if wire != proto.WireVarint { 836 return true, proto.ErrInternalBadWireType 837 } 838 x, err := b.DecodeVarint() 839 m.Mode = &SubscriptionList_Once{x != 0} 840 return true, err 841 case 11: // mode.poll_interval 842 if wire != proto.WireVarint { 843 return true, proto.ErrInternalBadWireType 844 } 845 x, err := b.DecodeVarint() 846 m.Mode = &SubscriptionList_PollInterval{x} 847 return true, err 848 default: 849 return false, nil 850 } 851 } 852 853 func _SubscriptionList_OneofSizer(msg proto.Message) (n int) { 854 m := msg.(*SubscriptionList) 855 // mode 856 switch x := m.Mode.(type) { 857 case *SubscriptionList_Once: 858 n += proto.SizeVarint(10<<3 | proto.WireVarint) 859 n += 1 860 case *SubscriptionList_PollInterval: 861 n += proto.SizeVarint(11<<3 | proto.WireVarint) 862 n += proto.SizeVarint(uint64(x.PollInterval)) 863 case nil: 864 default: 865 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 866 } 867 return n 868 } 869 870 type SubscriptionList_Options struct { 871 UseAliases bool `protobuf:"varint,1,opt,name=use_aliases,json=useAliases" json:"use_aliases,omitempty"` 872 } 873 874 func (m *SubscriptionList_Options) Reset() { *m = SubscriptionList_Options{} } 875 func (m *SubscriptionList_Options) String() string { return proto.CompactTextString(m) } 876 func (*SubscriptionList_Options) ProtoMessage() {} 877 func (*SubscriptionList_Options) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8, 0} } 878 879 // Subscription contains a path as well as the target side coalesce_interval for 880 // aggregating values, typically counters. If the target cannot support the 881 // interval the subscription must be rejected. The coalesce_interval is only 882 // used for subscriptions in streaming mode. If the coalesce_interval is 0 then 883 // the coalesce_interval is target specified. 884 type Subscription struct { 885 Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` 886 CoalesceInterval uint64 `protobuf:"varint,2,opt,name=coalesce_interval,json=coalesceInterval" json:"coalesce_interval,omitempty"` 887 } 888 889 func (m *Subscription) Reset() { *m = Subscription{} } 890 func (m *Subscription) String() string { return proto.CompactTextString(m) } 891 func (*Subscription) ProtoMessage() {} 892 func (*Subscription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } 893 894 func (m *Subscription) GetPath() *Path { 895 if m != nil { 896 return m.Path 897 } 898 return nil 899 } 900 901 // An AliasList represents a list of aliases. 902 type AliasList struct { 903 Alias []*Alias `protobuf:"bytes,1,rep,name=alias" json:"alias,omitempty"` 904 } 905 906 func (m *AliasList) Reset() { *m = AliasList{} } 907 func (m *AliasList) String() string { return proto.CompactTextString(m) } 908 func (*AliasList) ProtoMessage() {} 909 func (*AliasList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } 910 911 func (m *AliasList) GetAlias() []*Alias { 912 if m != nil { 913 return m.Alias 914 } 915 return nil 916 } 917 918 // An Alias specifies a preferred client defined alias for a specified path. An 919 // Alias is only sent from the client to the target. An alias is typically one 920 // element and is much shorter than the provided path. A target should 921 // substitute alias for path in Notifications. Targets may ignore Alias 922 // messages. 923 // 924 // The path must be fully expanded and not use an alias. 925 // 926 // If alias is set and path is not then the alias must no longer be used by the 927 // target, once received. A client may still see Notifications using the alias 928 // that were generated prior to the target receiving the request to stop using 929 // the alias. 930 type Alias struct { 931 Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` 932 Alias *Path `protobuf:"bytes,2,opt,name=alias" json:"alias,omitempty"` 933 } 934 935 func (m *Alias) Reset() { *m = Alias{} } 936 func (m *Alias) String() string { return proto.CompactTextString(m) } 937 func (*Alias) ProtoMessage() {} 938 func (*Alias) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } 939 940 func (m *Alias) GetPath() *Path { 941 if m != nil { 942 return m.Path 943 } 944 return nil 945 } 946 947 func (m *Alias) GetAlias() *Path { 948 if m != nil { 949 return m.Alias 950 } 951 return nil 952 } 953 954 // A Heartbeat requests a (possibly repeated) response from the remote side. 955 type Heartbeat struct { 956 // interval is the maximum amount of time, in nanoseconds, between subsequent 957 // messages from the remote side. An empty message may be sent if no other 958 // messages are pending. If interval is 0 then the remote must immediately 959 // respond with a (possibly empty) message. 960 Interval uint64 `protobuf:"varint,1,opt,name=interval" json:"interval,omitempty"` 961 } 962 963 func (m *Heartbeat) Reset() { *m = Heartbeat{} } 964 func (m *Heartbeat) String() string { return proto.CompactTextString(m) } 965 func (*Heartbeat) ProtoMessage() {} 966 func (*Heartbeat) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } 967 968 // A SyncRequest requests that all values identified by path be resent. The 969 // target should respond with a series of updates and then a sync_response with 970 // the provided id, which should not be zero. 971 // 972 // A target is suggested to keep a timestamp of when the SyncRequest starts, 973 // followed by notifications, all of which are past the starting timestamp. 974 // Before sending the sync_response, a delete for each of the paths should be 975 // made with the starting timestamp. This will assure the client removes all 976 // stale data that was not part of the update. 977 // 978 // If prefix is set, each path is relative to prefix. 979 type SyncRequest struct { 980 Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` 981 Prefix *Path `protobuf:"bytes,2,opt,name=prefix" json:"prefix,omitempty"` 982 Path []*Path `protobuf:"bytes,3,rep,name=path" json:"path,omitempty"` 983 } 984 985 func (m *SyncRequest) Reset() { *m = SyncRequest{} } 986 func (m *SyncRequest) String() string { return proto.CompactTextString(m) } 987 func (*SyncRequest) ProtoMessage() {} 988 func (*SyncRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } 989 990 func (m *SyncRequest) GetPrefix() *Path { 991 if m != nil { 992 return m.Prefix 993 } 994 return nil 995 } 996 997 func (m *SyncRequest) GetPath() []*Path { 998 if m != nil { 999 return m.Path 1000 } 1001 return nil 1002 } 1003 1004 type GetRequest struct { 1005 Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` 1006 Path []*Path `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` 1007 // If cache_interval is provided and is non-zero number of nanoseconds, it is 1008 // a hint of when this get request will be repeated in the future. 1009 CacheInterval int64 `protobuf:"varint,3,opt,name=cache_interval,json=cacheInterval" json:"cache_interval,omitempty"` 1010 } 1011 1012 func (m *GetRequest) Reset() { *m = GetRequest{} } 1013 func (m *GetRequest) String() string { return proto.CompactTextString(m) } 1014 func (*GetRequest) ProtoMessage() {} 1015 func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } 1016 1017 func (m *GetRequest) GetPrefix() *Path { 1018 if m != nil { 1019 return m.Prefix 1020 } 1021 return nil 1022 } 1023 1024 func (m *GetRequest) GetPath() []*Path { 1025 if m != nil { 1026 return m.Path 1027 } 1028 return nil 1029 } 1030 1031 type GetResponse struct { 1032 Notification []*Notification `protobuf:"bytes,1,rep,name=notification" json:"notification,omitempty"` 1033 } 1034 1035 func (m *GetResponse) Reset() { *m = GetResponse{} } 1036 func (m *GetResponse) String() string { return proto.CompactTextString(m) } 1037 func (*GetResponse) ProtoMessage() {} 1038 func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } 1039 1040 func (m *GetResponse) GetNotification() []*Notification { 1041 if m != nil { 1042 return m.Notification 1043 } 1044 return nil 1045 } 1046 1047 // A SetRequest contains an optional prefix, a list of zero or more Paths to 1048 // delete and a list of zero or more Updates. The delete and update paths are 1049 // relative to prefix. Deletes should appear to happen prior to updates being 1050 // applied. This supports delete, update, and replace: 1051 // 1052 // delete - a path is listed in the delete field 1053 // update - a path is listed in the update field 1054 // replace - a path is listed in both the delete field and the update field. 1055 // 1056 // The target must either apply all the deletes and updates or return an error. 1057 // The deletes and updates should appear to be atomically applied. 1058 type SetRequest struct { 1059 Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` 1060 Delete []*Path `protobuf:"bytes,2,rep,name=delete" json:"delete,omitempty"` 1061 Update []*Update `protobuf:"bytes,3,rep,name=update" json:"update,omitempty"` 1062 } 1063 1064 func (m *SetRequest) Reset() { *m = SetRequest{} } 1065 func (m *SetRequest) String() string { return proto.CompactTextString(m) } 1066 func (*SetRequest) ProtoMessage() {} 1067 func (*SetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } 1068 1069 func (m *SetRequest) GetPrefix() *Path { 1070 if m != nil { 1071 return m.Prefix 1072 } 1073 return nil 1074 } 1075 1076 func (m *SetRequest) GetDelete() []*Path { 1077 if m != nil { 1078 return m.Delete 1079 } 1080 return nil 1081 } 1082 1083 func (m *SetRequest) GetUpdate() []*Update { 1084 if m != nil { 1085 return m.Update 1086 } 1087 return nil 1088 } 1089 1090 // A SetResponse contains responses to a SetRequest. The optional prefix is 1091 // applied to all paths in response. Each path provided by a SetRequest needs a 1092 // response, but there need not be a 1:1 correspondence between SetRequests and 1093 // SetResponses (e.g., the target may issue a single response to multiple 1094 // requests, or multiple responses to a single request). 1095 type SetResponse struct { 1096 Prefix *Path `protobuf:"bytes,1,opt,name=prefix" json:"prefix,omitempty"` 1097 Response []*UpdateResponse `protobuf:"bytes,2,rep,name=response" json:"response,omitempty"` 1098 } 1099 1100 func (m *SetResponse) Reset() { *m = SetResponse{} } 1101 func (m *SetResponse) String() string { return proto.CompactTextString(m) } 1102 func (*SetResponse) ProtoMessage() {} 1103 func (*SetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } 1104 1105 func (m *SetResponse) GetPrefix() *Path { 1106 if m != nil { 1107 return m.Prefix 1108 } 1109 return nil 1110 } 1111 1112 func (m *SetResponse) GetResponse() []*UpdateResponse { 1113 if m != nil { 1114 return m.Response 1115 } 1116 return nil 1117 } 1118 1119 // An UpdateResponse contains the response for a single path Update. 1120 type UpdateResponse struct { 1121 Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` 1122 Error *Error `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"` 1123 // The timestamp is the time, in nanoseconds since the epoch, that a Set was 1124 // accepted (i.e., the request was valid). It does not imply the value was 1125 // actually propagated to an underlying datastore. 1126 Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` 1127 } 1128 1129 func (m *UpdateResponse) Reset() { *m = UpdateResponse{} } 1130 func (m *UpdateResponse) String() string { return proto.CompactTextString(m) } 1131 func (*UpdateResponse) ProtoMessage() {} 1132 func (*UpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } 1133 1134 func (m *UpdateResponse) GetPath() *Path { 1135 if m != nil { 1136 return m.Path 1137 } 1138 return nil 1139 } 1140 1141 func (m *UpdateResponse) GetError() *Error { 1142 if m != nil { 1143 return m.Error 1144 } 1145 return nil 1146 } 1147 1148 func init() { 1149 proto.RegisterType((*Path)(nil), "openconfig.Path") 1150 proto.RegisterType((*Value)(nil), "openconfig.Value") 1151 proto.RegisterType((*Update)(nil), "openconfig.Update") 1152 proto.RegisterType((*Notification)(nil), "openconfig.Notification") 1153 proto.RegisterType((*UDPWrapper)(nil), "openconfig.UDPWrapper") 1154 proto.RegisterType((*Error)(nil), "openconfig.Error") 1155 proto.RegisterType((*SubscribeRequest)(nil), "openconfig.SubscribeRequest") 1156 proto.RegisterType((*SubscribeResponse)(nil), "openconfig.SubscribeResponse") 1157 proto.RegisterType((*SubscriptionList)(nil), "openconfig.SubscriptionList") 1158 proto.RegisterType((*SubscriptionList_Options)(nil), "openconfig.SubscriptionList.Options") 1159 proto.RegisterType((*Subscription)(nil), "openconfig.Subscription") 1160 proto.RegisterType((*AliasList)(nil), "openconfig.AliasList") 1161 proto.RegisterType((*Alias)(nil), "openconfig.Alias") 1162 proto.RegisterType((*Heartbeat)(nil), "openconfig.Heartbeat") 1163 proto.RegisterType((*SyncRequest)(nil), "openconfig.SyncRequest") 1164 proto.RegisterType((*GetRequest)(nil), "openconfig.GetRequest") 1165 proto.RegisterType((*GetResponse)(nil), "openconfig.GetResponse") 1166 proto.RegisterType((*SetRequest)(nil), "openconfig.SetRequest") 1167 proto.RegisterType((*SetResponse)(nil), "openconfig.SetResponse") 1168 proto.RegisterType((*UpdateResponse)(nil), "openconfig.UpdateResponse") 1169 proto.RegisterEnum("openconfig.Type", Type_name, Type_value) 1170 } 1171 1172 // Reference imports to suppress errors if they are not otherwise used. 1173 var _ context.Context 1174 var _ grpc.ClientConn 1175 1176 // This is a compile-time assertion to ensure that this generated file 1177 // is compatible with the grpc package it is being compiled against. 1178 const _ = grpc.SupportPackageIsVersion3 1179 1180 // Client API for OpenConfig service 1181 1182 type OpenConfigClient interface { 1183 // Subscribe subscribes for streaming updates. Streaming updates are provided 1184 // as a series of Notifications, each of which update a portion of the tree. 1185 // The target must send the current values of all subscribed paths at the 1186 // start of the stream, followed by a sync_response of 0. 1187 // 1188 // A Subscription operates in one of three modes. 1189 // 1190 // Streaming: This is the default mode. The target sends continual updates 1191 // of each value as specified by each subscription's coalesce_interval. The 1192 // client may request the target to resend the current value of a set of paths 1193 // by sending a SyncRequest. 1194 // 1195 // Once: This mode is specified by setting once to true in the 1196 // SubscriptionRequest. The target must close the stream after sending 1197 // the sync_response of 0. The target should only send each value once. 1198 // 1199 // Poll: This mode is the equivalent of periodic Once requests but sent over a 1200 // single stream. Polling is specified by setting poll_interval in the 1201 // SubscriptionRequest to the expected number of nanoseconds between polls. 1202 // The target stops sending updates after sending the sync_response of 0. 1203 // After the polling interval, the client sends a new SubscriptionRequest with 1204 // only the poll_interval set. The target must respond by sending the current 1205 // values of all subscribed paths, once again followed with a sync_response of 1206 // 0. This process then repeats until the client closes the request stream. 1207 Subscribe(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SubscribeClient, error) 1208 // Get requests a single snapshot of the requested data. A Get request may 1209 // contain a hint that the request will be repeated (i.e., polling). A Get is 1210 // the equivalent of a Subscribe with once set, with the exception that all 1211 // the key value pairs will be returned in a single response. 1212 Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) 1213 // Set sets the paths contained in the SetRequest to the values If a path does 1214 // not exist, or is read-only the SetResponse will return an error. All paths 1215 // in the SetRequest must be valid or the entire request must be rejected. If 1216 // a path specifies a node, rather than the leaf, then the value must be the 1217 // values of the node's children encoded in JSON. Binary data in the tree 1218 // must be base64 encoded. 1219 Set(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SetClient, error) 1220 } 1221 1222 type openConfigClient struct { 1223 cc *grpc.ClientConn 1224 } 1225 1226 func NewOpenConfigClient(cc *grpc.ClientConn) OpenConfigClient { 1227 return &openConfigClient{cc} 1228 } 1229 1230 func (c *openConfigClient) Subscribe(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SubscribeClient, error) { 1231 stream, err := grpc.NewClientStream(ctx, &_OpenConfig_serviceDesc.Streams[0], c.cc, "/openconfig.OpenConfig/Subscribe", opts...) 1232 if err != nil { 1233 return nil, err 1234 } 1235 x := &openConfigSubscribeClient{stream} 1236 return x, nil 1237 } 1238 1239 type OpenConfig_SubscribeClient interface { 1240 Send(*SubscribeRequest) error 1241 Recv() (*SubscribeResponse, error) 1242 grpc.ClientStream 1243 } 1244 1245 type openConfigSubscribeClient struct { 1246 grpc.ClientStream 1247 } 1248 1249 func (x *openConfigSubscribeClient) Send(m *SubscribeRequest) error { 1250 return x.ClientStream.SendMsg(m) 1251 } 1252 1253 func (x *openConfigSubscribeClient) Recv() (*SubscribeResponse, error) { 1254 m := new(SubscribeResponse) 1255 if err := x.ClientStream.RecvMsg(m); err != nil { 1256 return nil, err 1257 } 1258 return m, nil 1259 } 1260 1261 func (c *openConfigClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { 1262 out := new(GetResponse) 1263 err := grpc.Invoke(ctx, "/openconfig.OpenConfig/Get", in, out, c.cc, opts...) 1264 if err != nil { 1265 return nil, err 1266 } 1267 return out, nil 1268 } 1269 1270 func (c *openConfigClient) Set(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SetClient, error) { 1271 stream, err := grpc.NewClientStream(ctx, &_OpenConfig_serviceDesc.Streams[1], c.cc, "/openconfig.OpenConfig/Set", opts...) 1272 if err != nil { 1273 return nil, err 1274 } 1275 x := &openConfigSetClient{stream} 1276 return x, nil 1277 } 1278 1279 type OpenConfig_SetClient interface { 1280 Send(*SetRequest) error 1281 Recv() (*SetResponse, error) 1282 grpc.ClientStream 1283 } 1284 1285 type openConfigSetClient struct { 1286 grpc.ClientStream 1287 } 1288 1289 func (x *openConfigSetClient) Send(m *SetRequest) error { 1290 return x.ClientStream.SendMsg(m) 1291 } 1292 1293 func (x *openConfigSetClient) Recv() (*SetResponse, error) { 1294 m := new(SetResponse) 1295 if err := x.ClientStream.RecvMsg(m); err != nil { 1296 return nil, err 1297 } 1298 return m, nil 1299 } 1300 1301 // Server API for OpenConfig service 1302 1303 type OpenConfigServer interface { 1304 // Subscribe subscribes for streaming updates. Streaming updates are provided 1305 // as a series of Notifications, each of which update a portion of the tree. 1306 // The target must send the current values of all subscribed paths at the 1307 // start of the stream, followed by a sync_response of 0. 1308 // 1309 // A Subscription operates in one of three modes. 1310 // 1311 // Streaming: This is the default mode. The target sends continual updates 1312 // of each value as specified by each subscription's coalesce_interval. The 1313 // client may request the target to resend the current value of a set of paths 1314 // by sending a SyncRequest. 1315 // 1316 // Once: This mode is specified by setting once to true in the 1317 // SubscriptionRequest. The target must close the stream after sending 1318 // the sync_response of 0. The target should only send each value once. 1319 // 1320 // Poll: This mode is the equivalent of periodic Once requests but sent over a 1321 // single stream. Polling is specified by setting poll_interval in the 1322 // SubscriptionRequest to the expected number of nanoseconds between polls. 1323 // The target stops sending updates after sending the sync_response of 0. 1324 // After the polling interval, the client sends a new SubscriptionRequest with 1325 // only the poll_interval set. The target must respond by sending the current 1326 // values of all subscribed paths, once again followed with a sync_response of 1327 // 0. This process then repeats until the client closes the request stream. 1328 Subscribe(OpenConfig_SubscribeServer) error 1329 // Get requests a single snapshot of the requested data. A Get request may 1330 // contain a hint that the request will be repeated (i.e., polling). A Get is 1331 // the equivalent of a Subscribe with once set, with the exception that all 1332 // the key value pairs will be returned in a single response. 1333 Get(context.Context, *GetRequest) (*GetResponse, error) 1334 // Set sets the paths contained in the SetRequest to the values If a path does 1335 // not exist, or is read-only the SetResponse will return an error. All paths 1336 // in the SetRequest must be valid or the entire request must be rejected. If 1337 // a path specifies a node, rather than the leaf, then the value must be the 1338 // values of the node's children encoded in JSON. Binary data in the tree 1339 // must be base64 encoded. 1340 Set(OpenConfig_SetServer) error 1341 } 1342 1343 func RegisterOpenConfigServer(s *grpc.Server, srv OpenConfigServer) { 1344 s.RegisterService(&_OpenConfig_serviceDesc, srv) 1345 } 1346 1347 func _OpenConfig_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { 1348 return srv.(OpenConfigServer).Subscribe(&openConfigSubscribeServer{stream}) 1349 } 1350 1351 type OpenConfig_SubscribeServer interface { 1352 Send(*SubscribeResponse) error 1353 Recv() (*SubscribeRequest, error) 1354 grpc.ServerStream 1355 } 1356 1357 type openConfigSubscribeServer struct { 1358 grpc.ServerStream 1359 } 1360 1361 func (x *openConfigSubscribeServer) Send(m *SubscribeResponse) error { 1362 return x.ServerStream.SendMsg(m) 1363 } 1364 1365 func (x *openConfigSubscribeServer) Recv() (*SubscribeRequest, error) { 1366 m := new(SubscribeRequest) 1367 if err := x.ServerStream.RecvMsg(m); err != nil { 1368 return nil, err 1369 } 1370 return m, nil 1371 } 1372 1373 func _OpenConfig_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1374 in := new(GetRequest) 1375 if err := dec(in); err != nil { 1376 return nil, err 1377 } 1378 if interceptor == nil { 1379 return srv.(OpenConfigServer).Get(ctx, in) 1380 } 1381 info := &grpc.UnaryServerInfo{ 1382 Server: srv, 1383 FullMethod: "/openconfig.OpenConfig/Get", 1384 } 1385 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1386 return srv.(OpenConfigServer).Get(ctx, req.(*GetRequest)) 1387 } 1388 return interceptor(ctx, in, info, handler) 1389 } 1390 1391 func _OpenConfig_Set_Handler(srv interface{}, stream grpc.ServerStream) error { 1392 return srv.(OpenConfigServer).Set(&openConfigSetServer{stream}) 1393 } 1394 1395 type OpenConfig_SetServer interface { 1396 Send(*SetResponse) error 1397 Recv() (*SetRequest, error) 1398 grpc.ServerStream 1399 } 1400 1401 type openConfigSetServer struct { 1402 grpc.ServerStream 1403 } 1404 1405 func (x *openConfigSetServer) Send(m *SetResponse) error { 1406 return x.ServerStream.SendMsg(m) 1407 } 1408 1409 func (x *openConfigSetServer) Recv() (*SetRequest, error) { 1410 m := new(SetRequest) 1411 if err := x.ServerStream.RecvMsg(m); err != nil { 1412 return nil, err 1413 } 1414 return m, nil 1415 } 1416 1417 var _OpenConfig_serviceDesc = grpc.ServiceDesc{ 1418 ServiceName: "openconfig.OpenConfig", 1419 HandlerType: (*OpenConfigServer)(nil), 1420 Methods: []grpc.MethodDesc{ 1421 { 1422 MethodName: "Get", 1423 Handler: _OpenConfig_Get_Handler, 1424 }, 1425 }, 1426 Streams: []grpc.StreamDesc{ 1427 { 1428 StreamName: "Subscribe", 1429 Handler: _OpenConfig_Subscribe_Handler, 1430 ServerStreams: true, 1431 ClientStreams: true, 1432 }, 1433 { 1434 StreamName: "Set", 1435 Handler: _OpenConfig_Set_Handler, 1436 ServerStreams: true, 1437 ClientStreams: true, 1438 }, 1439 }, 1440 Metadata: fileDescriptor0, 1441 } 1442 1443 func init() { proto.RegisterFile("openconfig.proto", fileDescriptor0) } 1444 1445 var fileDescriptor0 = []byte{ 1446 // 998 bytes of a gzipped FileDescriptorProto 1447 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x56, 0xcb, 0x6e, 0x23, 0x45, 1448 0x17, 0x9e, 0xb6, 0xdb, 0x97, 0x3e, 0x76, 0xfc, 0xdb, 0xa5, 0xf9, 0x19, 0x63, 0x06, 0x11, 0xb5, 1449 0x06, 0x12, 0x05, 0xe1, 0x01, 0x73, 0x59, 0x20, 0x84, 0x94, 0xc0, 0x88, 0x01, 0x46, 0xc9, 0xa8, 1450 0x9c, 0x30, 0x62, 0x65, 0x95, 0x9d, 0x4a, 0xd2, 0x92, 0xdd, 0xdd, 0x74, 0xb5, 0xd1, 0x78, 0xc1, 1451 0x8a, 0x1d, 0xe2, 0x4d, 0x58, 0xf1, 0x0a, 0x88, 0x35, 0xcf, 0xc4, 0xa9, 0x5b, 0x77, 0x39, 0x89, 1452 0x83, 0x67, 0x76, 0x5d, 0xe7, 0x7e, 0xbe, 0xf3, 0xf5, 0xa9, 0x82, 0x6e, 0x92, 0xf2, 0x78, 0x96, 1453 0xc4, 0x17, 0xd1, 0xe5, 0x30, 0xcd, 0x92, 0x3c, 0x21, 0x50, 0x4a, 0x06, 0x6f, 0x5e, 0x26, 0xc9, 1454 0xe5, 0x9c, 0x3f, 0x56, 0x9a, 0xe9, 0xf2, 0xe2, 0x31, 0x8b, 0x57, 0xda, 0x2c, 0xdc, 0x05, 0xff, 1455 0x39, 0xcb, 0xaf, 0x48, 0x1f, 0x1a, 0x7c, 0xce, 0x17, 0x3c, 0xce, 0xfb, 0xde, 0x6e, 0x75, 0x3f, 1456 0xa0, 0xf6, 0x18, 0xbe, 0x80, 0xda, 0x0f, 0x6c, 0xbe, 0xe4, 0xe4, 0x3e, 0xd4, 0x7e, 0x96, 0x1f, 1457 0x68, 0xe0, 0xed, 0xb7, 0xa9, 0x3e, 0x90, 0x47, 0xe0, 0xe7, 0xab, 0x94, 0xf7, 0x2b, 0x28, 0xec, 1458 0x8c, 0xba, 0x43, 0xa7, 0x90, 0x53, 0x94, 0x53, 0xa5, 0x25, 0x04, 0xfc, 0x98, 0x2d, 0x78, 0xbf, 1459 0x8a, 0x56, 0x01, 0x55, 0xdf, 0x18, 0xb8, 0x7e, 0x96, 0x9e, 0xb3, 0x5c, 0xc5, 0x48, 0xb1, 0x08, 1460 0x15, 0xb8, 0xb5, 0x1e, 0x43, 0x16, 0x47, 0x95, 0x96, 0xec, 0xd9, 0xfc, 0x15, 0x65, 0xd6, 0x73, 1461 0xcd, 0x54, 0x85, 0xa6, 0xa4, 0xf0, 0x2f, 0x0f, 0xda, 0xc7, 0x49, 0x1e, 0x5d, 0x44, 0x33, 0x96, 1462 0x47, 0x49, 0x4c, 0x1e, 0x42, 0x90, 0x47, 0x0b, 0x2e, 0x72, 0xb6, 0x48, 0x55, 0x92, 0x2a, 0x2d, 1463 0x05, 0x64, 0x1f, 0xea, 0x69, 0xc6, 0x2f, 0xa2, 0x97, 0x26, 0xf0, 0xcd, 0xfc, 0x46, 0x2f, 0x11, 1464 0x60, 0xf3, 0x88, 0x09, 0xd3, 0x86, 0x3e, 0x90, 0x03, 0xa8, 0x2f, 0x55, 0x1f, 0x7d, 0x1f, 0x91, 1465 0x6b, 0x8d, 0x88, 0xeb, 0xaf, 0x3b, 0xa4, 0xc6, 0x42, 0xe6, 0x3a, 0x47, 0x60, 0xd1, 0xb6, 0xa6, 1466 0x6c, 0x6f, 0xc9, 0xa5, 0xf5, 0xe1, 0xdf, 0x1e, 0xc0, 0xd9, 0xd7, 0xcf, 0x5f, 0x64, 0x2c, 0x4d, 1467 0x79, 0x46, 0x76, 0xa1, 0x12, 0x9d, 0x6f, 0x04, 0x08, 0x75, 0xe4, 0x03, 0x20, 0x79, 0xc6, 0x62, 1468 0xb1, 0x88, 0xf2, 0x49, 0xd9, 0xad, 0x6c, 0xc9, 0xa7, 0x3d, 0xab, 0x39, 0x2d, 0xba, 0xde, 0x83, 1469 0xff, 0x09, 0xfe, 0xd3, 0x12, 0xe3, 0xf0, 0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