openconfig

package
v0.0.0-...-d002785 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package openconfig is a generated protocol buffer package.

Package openconfig defines the gRPC service for getting and setting the OpenConfig configuration and state of a network device.

This package and its contents have not been ratified by OpenConfig. It is a working proposal by Google.

It is generated from these files:

openconfig.proto

It has these top-level messages:

Path
Value
Update
Notification
UDPWrapper
Error
SubscribeRequest
SubscribeResponse
SubscriptionList
Subscription
AliasList
Alias
Heartbeat
SyncRequest
GetRequest
GetResponse
SetRequest
SetResponse
UpdateResponse

Index

Constants

This section is empty.

Variables

View Source
var Type_name = map[int32]string{
	0: "JSON",
	1: "BYTES",
}
View Source
var Type_value = map[string]int32{
	"JSON":  0,
	"BYTES": 1,
}

Functions

func NotificationToJSONDocument

func NotificationToJSONDocument(notification *Notification,
	escape EscapeFunc) ([]byte, error)

NotificationToJSONDocument maps a Notification into a single JSON document

func NotificationToMap

func NotificationToMap(notification *Notification,
	escape EscapeFunc) (map[string]interface{}, error)

NotificationToMap maps a Notification into a nested map of entities

func RegisterOpenConfigServer

func RegisterOpenConfigServer(s *grpc.Server, srv OpenConfigServer)

func SubscribeResponseToJSON

func SubscribeResponseToJSON(resp *SubscribeResponse) (string, error)

SubscribeResponseToJSON converts a SubscribeResponse into a JSON string

Types

type 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"`
}

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.

func (*Alias) Descriptor

func (*Alias) Descriptor() ([]byte, []int)

func (*Alias) GetAlias

func (m *Alias) GetAlias() *Path

func (*Alias) GetPath

func (m *Alias) GetPath() *Path

func (*Alias) ProtoMessage

func (*Alias) ProtoMessage()

func (*Alias) Reset

func (m *Alias) Reset()

func (*Alias) String

func (m *Alias) String() string

type AliasList

type AliasList struct {
	Alias []*Alias `protobuf:"bytes,1,rep,name=alias" json:"alias,omitempty"`
}

An AliasList represents a list of aliases.

func (*AliasList) Descriptor

func (*AliasList) Descriptor() ([]byte, []int)

func (*AliasList) GetAlias

func (m *AliasList) GetAlias() []*Alias

func (*AliasList) ProtoMessage

func (*AliasList) ProtoMessage()

func (*AliasList) Reset

func (m *AliasList) Reset()

func (*AliasList) String

func (m *AliasList) String() string

type Error

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"`
}

An Error contains information about why a particular request failed.

The canonical error codes are defined for each language.

Go:   import "google.golang.org/grpc/codes"
C++:  #include <grpc++/status_code_enum.h>
Java: import static io.grpc.Status.Code;
C:    #include <grpc/status.h>
C#:   using Grpc.Core;

func (*Error) Descriptor

func (*Error) Descriptor() ([]byte, []int)

func (*Error) GetData

func (m *Error) GetData() *google_protobuf.Any

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

type EscapeFunc

type EscapeFunc func(k string) string

EscapeFunc is the escaping method for attribute names

type GetRequest

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"`
	// 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.
	CacheInterval int64 `protobuf:"varint,3,opt,name=cache_interval,json=cacheInterval" json:"cache_interval,omitempty"`
}

func (*GetRequest) Descriptor

func (*GetRequest) Descriptor() ([]byte, []int)

func (*GetRequest) GetPath

func (m *GetRequest) GetPath() []*Path

func (*GetRequest) GetPrefix

func (m *GetRequest) GetPrefix() *Path

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Notification []*Notification `protobuf:"bytes,1,rep,name=notification" json:"notification,omitempty"`
}

func (*GetResponse) Descriptor

func (*GetResponse) Descriptor() ([]byte, []int)

func (*GetResponse) GetNotification

func (m *GetResponse) GetNotification() []*Notification

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) String

func (m *GetResponse) String() string

type Heartbeat

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"`
}

A Heartbeat requests a (possibly repeated) response from the remote side.

func (*Heartbeat) Descriptor

func (*Heartbeat) Descriptor() ([]byte, []int)

func (*Heartbeat) ProtoMessage

func (*Heartbeat) ProtoMessage()

func (*Heartbeat) Reset

func (m *Heartbeat) Reset()

func (*Heartbeat) String

func (m *Heartbeat) String() string

type Notification

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"`
}

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.

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 both in an update and match 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 path. 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 define alias when possible, but is not required to. A target may ignore client defined aliases.

Clients should not define aliases that valid paths in the data tree. The target must not define aliases that valid paths in the dat 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

func (*Notification) Descriptor

func (*Notification) Descriptor() ([]byte, []int)

func (*Notification) GetDelete

func (m *Notification) GetDelete() []*Path

func (*Notification) GetPrefix

func (m *Notification) GetPrefix() *Path

func (*Notification) GetUpdate

func (m *Notification) GetUpdate() []*Update

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) Reset

func (m *Notification) Reset()

func (*Notification) String

func (m *Notification) String() string

type OpenConfigClient

type OpenConfigClient interface {
	// Subscribe subscribes for streaming updates.  Streaming updates are provided
	// as a series of Notifications, each of which update a portion of the tree.
	// The target must send the current values of all subscribed paths at the
	// start of the stream, followed by a sync_response of 0.
	//
	// A Subscription operates in one of three modes.
	//
	// Streaming:  This is the default mode.  The target sends continual updates
	// of each value as specified by each subscription's coalesce_interval.  The
	// client may request the target to resend the current value of a set of paths
	// by sending a SyncRequest.
	//
	// Once: This mode is specified by setting once to true in the
	// SubscriptionRequest.  The target must close the stream after sending
	// the sync_response of 0.  The target should only send each value once.
	//
	// Poll: This mode is the equivalent of periodic Once requests but sent over a
	// single stream.  Polling is specified by setting poll_interval in the
	// SubscriptionRequest to the expected number of nanoseconds between polls.
	// The target stops sending updates after sending the sync_response of 0.
	// After the polling interval, the client sends a new SubscriptionRequest with
	// only the poll_interval set.  The target must respond by sending the current
	// values of all subscribed paths, once again followed with a sync_response of
	// 0.  This process then repeats until the client closes the request stream.
	Subscribe(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SubscribeClient, error)
	// Get requests a single snapshot of the requested data.  A Get request may
	// contain a hint that the request will be repeated (i.e., polling).  A Get is
	// the equivalent of a Subscribe with once set, with the exception that all
	// the key value pairs will be returned in a single response.
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Set sets the paths contained in the SetRequest to the values If a path does
	// not exist, or is 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 a node, rather than the 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.
	Set(ctx context.Context, opts ...grpc.CallOption) (OpenConfig_SetClient, error)
}

func NewOpenConfigClient

func NewOpenConfigClient(cc *grpc.ClientConn) OpenConfigClient

type OpenConfigServer

type OpenConfigServer interface {
	// Subscribe subscribes for streaming updates.  Streaming updates are provided
	// as a series of Notifications, each of which update a portion of the tree.
	// The target must send the current values of all subscribed paths at the
	// start of the stream, followed by a sync_response of 0.
	//
	// A Subscription operates in one of three modes.
	//
	// Streaming:  This is the default mode.  The target sends continual updates
	// of each value as specified by each subscription's coalesce_interval.  The
	// client may request the target to resend the current value of a set of paths
	// by sending a SyncRequest.
	//
	// Once: This mode is specified by setting once to true in the
	// SubscriptionRequest.  The target must close the stream after sending
	// the sync_response of 0.  The target should only send each value once.
	//
	// Poll: This mode is the equivalent of periodic Once requests but sent over a
	// single stream.  Polling is specified by setting poll_interval in the
	// SubscriptionRequest to the expected number of nanoseconds between polls.
	// The target stops sending updates after sending the sync_response of 0.
	// After the polling interval, the client sends a new SubscriptionRequest with
	// only the poll_interval set.  The target must respond by sending the current
	// values of all subscribed paths, once again followed with a sync_response of
	// 0.  This process then repeats until the client closes the request stream.
	Subscribe(OpenConfig_SubscribeServer) error
	// Get requests a single snapshot of the requested data.  A Get request may
	// contain a hint that the request will be repeated (i.e., polling).  A Get is
	// the equivalent of a Subscribe with once set, with the exception that all
	// the key value pairs will be returned in a single response.
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// Set sets the paths contained in the SetRequest to the values If a path does
	// not exist, or is 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 a node, rather than the 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.
	Set(OpenConfig_SetServer) error
}

type OpenConfig_SetClient

type OpenConfig_SetClient interface {
	Send(*SetRequest) error
	Recv() (*SetResponse, error)
	grpc.ClientStream
}

type OpenConfig_SetServer

type OpenConfig_SetServer interface {
	Send(*SetResponse) error
	Recv() (*SetRequest, error)
	grpc.ServerStream
}

type OpenConfig_SubscribeClient

type OpenConfig_SubscribeClient interface {
	Send(*SubscribeRequest) error
	Recv() (*SubscribeResponse, error)
	grpc.ClientStream
}

type OpenConfig_SubscribeServer

type OpenConfig_SubscribeServer interface {
	Send(*SubscribeResponse) error
	Recv() (*SubscribeRequest, error)
	grpc.ServerStream
}

type Path

type Path struct {
	Element []string `protobuf:"bytes,1,rep,name=element" json:"element,omitempty"`
}

A Path represents an open config path as a list of strings, one element per string.

func (*Path) Descriptor

func (*Path) Descriptor() ([]byte, []int)

func (*Path) ProtoMessage

func (*Path) ProtoMessage()

func (*Path) Reset

func (m *Path) Reset()

func (*Path) String

func (m *Path) String() string

type SetRequest

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"`
	Update []*Update `protobuf:"bytes,3,rep,name=update" json:"update,omitempty"`
}

A SetRequest contains an optional prefix, a list of zero or more Paths to delete and a list of zero or more Updates. The delete and update paths are relative to prefix. Deletes should appear to happen prior to updates being applied. This supports delete, update, and replace:

delete - a path is listed in the delete field
update - a path is listed in the update field
replace - a path is listed in both the delete field and the update field.

The target must either apply all the deletes and updates or return an error. The deletes and updates should appear to be atomically applied.

func (*SetRequest) Descriptor

func (*SetRequest) Descriptor() ([]byte, []int)

func (*SetRequest) GetDelete

func (m *SetRequest) GetDelete() []*Path

func (*SetRequest) GetPrefix

func (m *SetRequest) GetPrefix() *Path

func (*SetRequest) GetUpdate

func (m *SetRequest) GetUpdate() []*Update

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) Reset

func (m *SetRequest) Reset()

func (*SetRequest) String

func (m *SetRequest) String() string

type SetResponse

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"`
}

A SetResponse contains responses to a SetRequest. The optional prefix is applied to all paths in response. Each path provided by a SetRequest needs a response, but there need not be a 1:1 correspondence between SetRequests and SetResponses (e.g., the target may issue a single response to multiple requests, or multiple responses to a single request).

func (*SetResponse) Descriptor

func (*SetResponse) Descriptor() ([]byte, []int)

func (*SetResponse) GetPrefix

func (m *SetResponse) GetPrefix() *Path

func (*SetResponse) GetResponse

func (m *SetResponse) GetResponse() []*UpdateResponse

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) Reset

func (m *SetResponse) Reset()

func (*SetResponse) String

func (m *SetResponse) String() string

type SubscribeRequest

type SubscribeRequest struct {
	// Types that are valid to be assigned to Request:
	//	*SubscribeRequest_Subscribe
	//	*SubscribeRequest_Heartbeat
	//	*SubscribeRequest_Sync
	//	*SubscribeRequest_Aliases
	Request isSubscribeRequest_Request `protobuf_oneof:"request"`
	Proxy   []string                   `protobuf:"bytes,5,rep,name=proxy" json:"proxy,omitempty"`
}

A SubscribeRequest is either a subscription request, a change to the heartbeat rate, or a request for resynchronization of data. It is always sent from the client to the target.

Proxy is a list of proxies to use to get to the target. The first proxy listed is the address of the next hop. Targets ignore the proxy field (it should not be set).

func (*SubscribeRequest) Descriptor

func (*SubscribeRequest) Descriptor() ([]byte, []int)

func (*SubscribeRequest) GetAliases

func (m *SubscribeRequest) GetAliases() *AliasList

func (*SubscribeRequest) GetHeartbeat

func (m *SubscribeRequest) GetHeartbeat() *Heartbeat

func (*SubscribeRequest) GetRequest

func (m *SubscribeRequest) GetRequest() isSubscribeRequest_Request

func (*SubscribeRequest) GetSubscribe

func (m *SubscribeRequest) GetSubscribe() *SubscriptionList

func (*SubscribeRequest) GetSync

func (m *SubscribeRequest) GetSync() *SyncRequest

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) Reset

func (m *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (m *SubscribeRequest) String() string

func (*SubscribeRequest) XXX_OneofFuncs

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{})

XXX_OneofFuncs is for the internal use of the proto package.

type SubscribeRequest_Aliases

type SubscribeRequest_Aliases struct {
	Aliases *AliasList `protobuf:"bytes,4,opt,name=aliases,oneof"`
}

type SubscribeRequest_Heartbeat

type SubscribeRequest_Heartbeat struct {
	Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,oneof"`
}

type SubscribeRequest_Subscribe

type SubscribeRequest_Subscribe struct {
	Subscribe *SubscriptionList `protobuf:"bytes,1,opt,name=subscribe,oneof"`
}

type SubscribeRequest_Sync

type SubscribeRequest_Sync struct {
	Sync *SyncRequest `protobuf:"bytes,3,opt,name=sync,oneof"`
}

type SubscribeResponse

type SubscribeResponse struct {
	// Types that are valid to be assigned to Response:
	//	*SubscribeResponse_Update
	//	*SubscribeResponse_Heartbeat
	//	*SubscribeResponse_SyncResponse
	Response isSubscribeResponse_Response `protobuf_oneof:"response"`
}

A SubscribeResponse is always sent from the target to the client.

func (*SubscribeResponse) Descriptor

func (*SubscribeResponse) Descriptor() ([]byte, []int)

func (*SubscribeResponse) GetHeartbeat

func (m *SubscribeResponse) GetHeartbeat() *Heartbeat

func (*SubscribeResponse) GetResponse

func (m *SubscribeResponse) GetResponse() isSubscribeResponse_Response

func (*SubscribeResponse) GetSyncResponse

func (m *SubscribeResponse) GetSyncResponse() uint64

func (*SubscribeResponse) GetUpdate

func (m *SubscribeResponse) GetUpdate() *Notification

func (*SubscribeResponse) ProtoMessage

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) Reset

func (m *SubscribeResponse) Reset()

func (*SubscribeResponse) String

func (m *SubscribeResponse) String() string

func (*SubscribeResponse) XXX_OneofFuncs

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{})

XXX_OneofFuncs is for the internal use of the proto package.

type SubscribeResponse_Heartbeat

type SubscribeResponse_Heartbeat struct {
	Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,oneof"`
}

type SubscribeResponse_SyncResponse

type SubscribeResponse_SyncResponse struct {
	SyncResponse uint64 `protobuf:"varint,3,opt,name=sync_response,json=syncResponse,oneof"`
}

type SubscribeResponse_Update

type SubscribeResponse_Update struct {
	Update *Notification `protobuf:"bytes,1,opt,name=update,oneof"`
}

type Subscription

type Subscription struct {
	Path             *Path  `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
	CoalesceInterval uint64 `protobuf:"varint,2,opt,name=coalesce_interval,json=coalesceInterval" json:"coalesce_interval,omitempty"`
}

Subscription contains a path as well as the target side coalesce_interval for aggregating values, typically counters. If the target cannot support the interval the subscription must be rejected. The coalesce_interval is only used for subscriptions in streaming mode. If the coalesce_interval is 0 then the coalesce_interval is target specified.

func (*Subscription) Descriptor

func (*Subscription) Descriptor() ([]byte, []int)

func (*Subscription) GetPath

func (m *Subscription) GetPath() *Path

func (*Subscription) ProtoMessage

func (*Subscription) ProtoMessage()

func (*Subscription) Reset

func (m *Subscription) Reset()

func (*Subscription) String

func (m *Subscription) String() string

type SubscriptionList

type SubscriptionList struct {
	// Types that are valid to be assigned to Mode:
	//	*SubscriptionList_Once
	//	*SubscriptionList_PollInterval
	Mode         isSubscriptionList_Mode   `protobuf_oneof:"mode"`
	Subscription []*Subscription           `protobuf:"bytes,1,rep,name=subscription" json:"subscription,omitempty"`
	Prefix       *Path                     `protobuf:"bytes,2,opt,name=prefix" json:"prefix,omitempty"`
	Options      *SubscriptionList_Options `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
}

SubscriptionList contains the list of individual subscriptions. A SubscriptionList is only valid if all of the contained subscriptions are valid. Setting once to false or poll_interval to 0 is the equivalent of the mode not being set (i.e., streaming).

If prefix is set then all subscriptions in the list and all notifications generated are relative to prefix.

If poll_interval is not set, then a SubscriptionList must only be sent once. If poll_interval is set, the SubscriptionLists following the initial SubscriptionList must only contain a poll_interval.

func (*SubscriptionList) Descriptor

func (*SubscriptionList) Descriptor() ([]byte, []int)

func (*SubscriptionList) GetMode

func (m *SubscriptionList) GetMode() isSubscriptionList_Mode

func (*SubscriptionList) GetOnce

func (m *SubscriptionList) GetOnce() bool

func (*SubscriptionList) GetOptions

func (m *SubscriptionList) GetOptions() *SubscriptionList_Options

func (*SubscriptionList) GetPollInterval

func (m *SubscriptionList) GetPollInterval() uint64

func (*SubscriptionList) GetPrefix

func (m *SubscriptionList) GetPrefix() *Path

func (*SubscriptionList) GetSubscription

func (m *SubscriptionList) GetSubscription() []*Subscription

func (*SubscriptionList) ProtoMessage

func (*SubscriptionList) ProtoMessage()

func (*SubscriptionList) Reset

func (m *SubscriptionList) Reset()

func (*SubscriptionList) String

func (m *SubscriptionList) String() string

func (*SubscriptionList) XXX_OneofFuncs

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{})

XXX_OneofFuncs is for the internal use of the proto package.

type SubscriptionList_Once

type SubscriptionList_Once struct {
	Once bool `protobuf:"varint,10,opt,name=once,oneof"`
}

type SubscriptionList_Options

type SubscriptionList_Options struct {
	UseAliases bool `protobuf:"varint,1,opt,name=use_aliases,json=useAliases" json:"use_aliases,omitempty"`
}

func (*SubscriptionList_Options) Descriptor

func (*SubscriptionList_Options) Descriptor() ([]byte, []int)

func (*SubscriptionList_Options) ProtoMessage

func (*SubscriptionList_Options) ProtoMessage()

func (*SubscriptionList_Options) Reset

func (m *SubscriptionList_Options) Reset()

func (*SubscriptionList_Options) String

func (m *SubscriptionList_Options) String() string

type SubscriptionList_PollInterval

type SubscriptionList_PollInterval struct {
	PollInterval uint64 `protobuf:"varint,11,opt,name=poll_interval,json=pollInterval,oneof"`
}

type SyncRequest

type SyncRequest struct {
	Id     uint64  `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	Prefix *Path   `protobuf:"bytes,2,opt,name=prefix" json:"prefix,omitempty"`
	Path   []*Path `protobuf:"bytes,3,rep,name=path" json:"path,omitempty"`
}

A SyncRequest requests that all values identified by path be resent. The target should respond with a series of updates and then a sync_response with the provided id, which should not be zero.

A target is suggested to keep a timestamp of when the SyncRequest starts, followed by notifications, all of which are past the starting timestamp. Before sending the sync_response, a delete for each of the paths should be made with the starting timestamp. This will assure the client removes all stale data that was not part of the update.

If prefix is set, each path is relative to prefix.

func (*SyncRequest) Descriptor

func (*SyncRequest) Descriptor() ([]byte, []int)

func (*SyncRequest) GetPath

func (m *SyncRequest) GetPath() []*Path

func (*SyncRequest) GetPrefix

func (m *SyncRequest) GetPrefix() *Path

func (*SyncRequest) ProtoMessage

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) Reset

func (m *SyncRequest) Reset()

func (*SyncRequest) String

func (m *SyncRequest) String() string

type Type

type Type int32

A Type describes what format a Value's data is encoded in.

const (
	Type_JSON  Type = 0
	Type_BYTES Type = 1
)

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

type UDPWrapper

type UDPWrapper struct {
	// ID Identifies the device (e.g., Loopback IP address, linecard, ...)
	// TODO(borman): Add examples.  Perhaps Agent/module/submodule for juniper.
	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"`
}

UDPWrapper adds metadata necessary for encapsulating a list of notifications into a UDP packet. It adds the ability to identify the agent 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.

func (*UDPWrapper) Descriptor

func (*UDPWrapper) Descriptor() ([]byte, []int)

func (*UDPWrapper) GetId

func (m *UDPWrapper) GetId() *Path

func (*UDPWrapper) GetNotification

func (m *UDPWrapper) GetNotification() []*Notification

func (*UDPWrapper) ProtoMessage

func (*UDPWrapper) ProtoMessage()

func (*UDPWrapper) Reset

func (m *UDPWrapper) Reset()

func (*UDPWrapper) String

func (m *UDPWrapper) String() string

type Update

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"`
}

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.

func (*Update) Descriptor

func (*Update) Descriptor() ([]byte, []int)

func (*Update) GetPath

func (m *Update) GetPath() *Path

func (*Update) GetValue

func (m *Update) GetValue() *Value

func (*Update) ProtoMessage

func (*Update) ProtoMessage()

func (*Update) Reset

func (m *Update) Reset()

func (*Update) String

func (m *Update) String() string

type UpdateResponse

type UpdateResponse struct {
	Path  *Path  `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
	Error *Error `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
	// 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,3,opt,name=timestamp" json:"timestamp,omitempty"`
}

An UpdateResponse contains the response for a single path Update.

func (*UpdateResponse) Descriptor

func (*UpdateResponse) Descriptor() ([]byte, []int)

func (*UpdateResponse) GetError

func (m *UpdateResponse) GetError() *Error

func (*UpdateResponse) GetPath

func (m *UpdateResponse) GetPath() *Path

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) Reset

func (m *UpdateResponse) Reset()

func (*UpdateResponse) String

func (m *UpdateResponse) String() string

type Value

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"`
}

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.

func (*Value) Descriptor

func (*Value) Descriptor() ([]byte, []int)

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) Reset

func (m *Value) Reset()

func (*Value) String

func (m *Value) String() string

Directories

Path Synopsis
Package client provides helper functions for OpenConfig CLI tools.
Package client provides helper functions for OpenConfig CLI tools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL