Service Providers

import "github.com/CiscoDevNet/ydk-go/ydk/providers"

Open Daylight

struct ydk/providers/OpendaylightServiceProvider

OpenDaylightServiceProvider is a service provider to be used to communicate with an OpenDaylight instance: https://www.opendaylight.org

Path

A Go string that represents the path

Address

A Go string that represents the IP address of the device supporting a open daylight interface

Username

A Go string that represents the username to log in to the device

Password

A Go string that represents the password to log in to the device

Port

An int that represents the device port used to access the open daylight interface.

(provider *OpenDaylightServiceProvider) Connect()

Connect to OpenDaylightServiceProvider using Path/Address/Username/Password/Port

(provider *OpenDaylightServiceProvider) GetNodeIDs()
Returns:OpenDaylightServiceProvider Node IDs
Return type:[]string
(provider *OpenDaylightServiceProvider) GetNodeProvider(nodeID string)
Returns:Node provider by ID
Return type:ServiceProvider
(provider *OpenDaylightServiceProvider) Disconnect()

Disconnect from OpenDaylightServiceProvider

Netconf

struct ydk/providers/NetconfServiceProvider

NetconfServiceProvider Implementation of ServiceProvider for the NETCONF protocol: https://tools.ietf.org/html/rfc6241

Repo

An instance of Repository This attribute represents the repository of YANG models.

Address

A Go string that represents the IP address of the device supporting a netconf interface

Username

A Go string that represents the username to log in to the device

Password

A Go string that represents the password to log in to the device

Port

An int that represents the device port used to access the netconf interface.

(provider *NetconfServiceProvider) Connect()

Implementation of ServiceProvider interface. Connects to Netconf Server using Repo/Address/Username/Password/Port.

(provider *NetconfServiceProvider) Disconnect()

Implementation of ServiceProvider interface. Disconnects from Netconf Server.

(provider *NetconfServiceProvider) GetState() *errors.State

Implementation of ServiceProvider interface. Returns error state for the NetconfServiceProvider.

(provider *NetconfServiceProvider) ExecuteRpc(oper string, ent Entity, options map[string]string) DataNode

Implementation of ServiceProvider interface, which is designed specifically for CRUD operations. Sends RPC to Netconf server and gets response.

Parameters:
  • oper – Go string containing requested operation; one of values create, read, update, delete.
  • ent – YDK Entity (single entity) or EntityCollection (multiple entities) representing data model.
  • options – Go map[string]string to hold options for operations. Currently is used only for read operation: key - mode, values - config, state.
Returns:

YDK data node, containing requested data (gnmi-get RPC) or nil.

Return type:

DataNode

(provider *NetconfServiceProvider) GetCapabilities()

Gets the capabilities supported by NetconfServiceProvider

Returns:The list of capabilities.
Return type:[]string

Restconf

struct ydk/providers/RestconfServiceProvider

RestconfServiceProvider Implementation of ServiceProvider for the RESTCONF protocol: https://tools.ietf.org/html/draft-ietf-netconf-restconf-18

Path

A Go string that represents the path

Address

A Go string that represents the IP address of the device supporting a restconf interface

Username

A Go string that represents the username to log in to the device

Password

A Go string that represents the password to log in to the device

Port

An int that represents the device port used to access the restconfs interface.

Encoding

An instance of Encoding Format

StateURLRoot

A Go string. This attribute provides backwards compatibility with older drafts of restconf RFC, this can be “/operational” or “/data”

ConfigURLRoot

A Go string. This attribute provides backwards compatibility with older drafts of restconf RFC, this can be “/config” or “/data” (which is the default)

(provider *RestconfServiceProvider) Connect()

Implementation of ServiceProvider interface. Connects to Restconf Server using Path/Address/Username/Password/Port.

(provider *RestconfServiceProvider) Disconnect

Implementation of ServiceProvider interface. Disconnects from Restconf Server.

(provider *RestconfServiceProvider) GetState() *errors.State

Implementation of ServiceProvider interface. Returns error state for the RestconfServiceProvider.

(provider *RestconfServiceProvider) ExecuteRpc(oper string, ent Entity, options map[string]string) DataNode

Implementation of ServiceProvider interface, which is designed specifically for CRUD operations. Sends RPC to Restconf server and gets response.

Parameters:
  • oper – Go string containing requested operation; one of values create, read, update, delete.
  • ent – YDK Entity (single entity) or EntityCollection (multiple entities) representing data model.
  • options – Go map[string]string to hold options for operations. Currently is used only for read operation: key - mode, values - config, state.
Returns:

YDK data node, containing requested data (gnmi-get RPC) or nil.

Return type:

DataNode

gNMI

struct ydk/providers/GnmiServiceProvider

Implementation of ServiceProvider for the gNMI protocol.

Repo

An instance of Repository This attribute represents the repository of YANG models.

Address

A Go string that represents the IP address of the device supporting a netconf interface.

Username

A Go string that represents the username to log in to the device.

Password

A Go string that represents the password to log in to the device.

Port

An int that represents the device port used to access the gRPC interface.

ServerCert

A Go string that represents full path to a file containing gNMI server certificate of authorization (public key). If not specified the service provider creates non-secure connection to the gNMI server.

PrivateKey

A Go string that represents full path to a file containing private key of YDK application host. If not specified and ServerCert attribute is defined (secure connection) the gRPC protocol uses its own private key.

(provider *GnmiServiceProvider) GetPrivate() interface{}

Implementation of ServiceProvider interface. Returns private interface value.

(provider *GnmiServiceProvider) Connect()

Implementation of ServiceProvider interface. Connects to gNMI server using Repo/Address/Username/Password/Port.

(provider *GnmiServiceProvider) Disconnect()

Implementation of ServiceProvider interface. Disconnects from gNMI server.

(provider *GnmiServiceProvider) GetState() *errors.State

Implementation of ServiceProvider interface. Returns error state for the GnmiServiceProvider.

(provider *GnmiServiceProvider) ExecuteRpc(oper string, ent Entity, options map[string]string) DataNode

Implementation of ServiceProvider interface, which is designed specifically for CRUD operations. Sends RPC to gNMI server and gets response.

Parameters:
  • oper – Go string containing requested operation; one of values create, read, update, delete.
  • ent – YDK Entity (single entity) or EntityCollection (multiple entities) representing data model.
  • options – Go map[string]string to hold options for operations. Currently is used only for read operation: key - mode, values - CONFIG, STATE, OPEARATIONAL, or ALL.
Returns:

YDK data node, containing requested data (gnmi-get RPC) or nil.

Return type:

DataNode

(provider *GnmiServiceProvider) GetSession() *path.GnmiSession

Gets pointer to GnmiSession structure

Returns:Pointer to GnmiSession structure.
Return type:*path.GnmiSession

Codec

struct ydk/providers/CodecServiceProvider

CodecServiceProvider Encode and decode to XML/JSON format

Repo

An instance of Repository This attribute represents the repository of YANG models.

Encoding

An instance of Encoding Format

RootSchemaTable

An instance of map[string]RootSchemaNode (see docs for RootSchemaNode)

(provider *CodecServiceProvider) Initialize()

Initialize the CodecServiceProvider

(provider *CodecServiceProvider) GetEncoding()
Returns:the encoding format for CodecServiceProvider
Return type:Encoding Format
(provider *CodecServiceProvider) GetRootSchemaNode(entity types.Entity)
Returns:root schema node for entity
Return type:RootSchemaNode