Documentation
¶
Index ¶
- func AddCState(state *errors.State)
- func CleanUpErrorState(state *errors.State)
- func CodecDecode(rootSchema types.RootSchemaNode, payload string, ...) types.DataNode
- func CodecEncode(datanode types.DataNode, encoding encodingFormat.EncodingFormat, pretty bool) string
- func CodecServiceDecode(state *errors.State, rootSchema types.RootSchemaNode, payload string, ...) types.Entity
- func CodecServiceEncode(state *errors.State, entity types.Entity, rootSchema types.RootSchemaNode, ...) string
- func ConnectToNetconfProvider(state *errors.State, repo types.Repository, address, username, password string, ...) types.CServiceProvider
- func ConnectToOpenDaylightProvider(state *errors.State, Path, Address, Username, Password string, port int, ...) types.COpenDaylightServiceProvider
- func ConnectToRestconfProvider(state *errors.State, Path, Address, Username, Password string, port int, ...) types.CServiceProvider
- func CreateDataNode(dn types.DataNode, path string, value interface{}) types.DataNode
- func CreateRootDataNode(rsn types.RootSchemaNode, path string) types.DataNode
- func CreateRpc(rsn types.RootSchemaNode, yangpath string) types.Rpc
- func DatanodeToEntity(node C.DataNode) types.Entity
- func DisconnectFromNetconfProvider(provider types.CServiceProvider)
- func DisconnectFromOpenDaylightProvider(provider types.COpenDaylightServiceProvider)
- func DisconnectFromRestconfProvider(provider types.CServiceProvider)
- func ExecuteRPC(provider types.ServiceProvider, rpcTag string, data map[string]interface{}, ...) types.DataNode
- func ExecuteRPCEntity(provider types.ServiceProvider, rpcEntity, topEntity types.Entity) types.Entity
- func GetCState(state *errors.State) *C.YDKStatePtr
- func GetDataPayload(state *errors.State, entity types.Entity, rootSchema C.RootSchemaNode, ...) *C.char
- func GetRootSchemaNode(provider types.CServiceProvider) types.RootSchemaNode
- func GetSessionCapabilities(session types.Session) []string
- func GetTopEntity(entity types.Entity) types.Entity
- func InitCodecServiceProvider(state *errors.State, entity types.Entity, repo types.Repository) types.RootSchemaNode
- func OpenDaylightServiceProviderGetNodeIDs(state *errors.State, provider types.COpenDaylightServiceProvider) []string
- func OpenDaylightServiceProviderGetNodeProvider(state *errors.State, provider types.COpenDaylightServiceProvider, ...) types.CServiceProvider
- func PanicOnCStateError(cstate *C.YDKStatePtr)
- func ReadDatanode(filter types.Entity, readDataNode types.DataNode) types.Entity
- func ServiceProviderGetSession(provider types.CServiceProvider) types.Session
- type NetconfSession
- func (ns *NetconfSession) Connect()
- func (ns *NetconfSession) Disconnect()
- func (ns *NetconfSession) ExecuteRpc(rpc types.Rpc) types.DataNode
- func (ns *NetconfSession) GetCapabilities() []string
- func (ns *NetconfSession) GetRootSchemaNode() types.RootSchemaNode
- func (ns *NetconfSession) GetState() *errors.State
- type RestconfSession
- func (rs *RestconfSession) Connect()
- func (ns *RestconfSession) Disconnect()
- func (rs *RestconfSession) ExecuteRpc(rpc types.Rpc) types.DataNode
- func (rs *RestconfSession) GetCapabilities() []string
- func (rs *RestconfSession) GetRootSchemaNode() types.RootSchemaNode
- func (rs *RestconfSession) GetState() *errors.State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUpErrorState ¶
CleanUpErrorState cleans up memory for CState.
func CodecDecode ¶
func CodecDecode(rootSchema types.RootSchemaNode, payload string, encoding encodingFormat.EncodingFormat) types.DataNode
CodecDecode decodes XML or JSON encoded payload Returns DanaNode.
func CodecEncode ¶
func CodecEncode(datanode types.DataNode, encoding encodingFormat.EncodingFormat, pretty bool) string
CodecEncode encodes datanode to XML or JSON payload Returns the resulting payload (string).
func CodecServiceDecode ¶
func CodecServiceDecode( state *errors.State, rootSchema types.RootSchemaNode, payload string, encoding encodingFormat.EncodingFormat, topEntity types.Entity) types.Entity
CodecServiceDecode decodes XML/JSON payloads passed in to entity. Returns the top level entity (types.Entity) from resulting data node.
func CodecServiceEncode ¶
func CodecServiceEncode( state *errors.State, entity types.Entity, rootSchema types.RootSchemaNode, encoding encodingFormat.EncodingFormat) string
CodecServiceEncode encodes entity to XML/JSON payloads based on encoding format passed in. Returns the resulting payload (string).
func ConnectToNetconfProvider ¶
func ConnectToNetconfProvider( state *errors.State, repo types.Repository, address, username, password string, port int, protocol string, onDemand, commonCache bool, timeout int, serverCertPath, privateKeyPath string) types.CServiceProvider
ConnectToNetconfProvider connects to NETCONF service provider by creating a connection to the provider using given address, username, password, and port. Returns the connected service provider (types.CServiceProvider).
func ConnectToOpenDaylightProvider ¶
func ConnectToOpenDaylightProvider( state *errors.State, Path, Address, Username, Password string, port int, encoding encodingFormat.EncodingFormat, proto protocol.Protocol) types.COpenDaylightServiceProvider
ConnectToOpenDaylightProvider connects to OpenDaylight device. Returns the connected service provider (types.COpenDaylightServiceProvier).
func ConnectToRestconfProvider ¶
func ConnectToRestconfProvider( state *errors.State, Path, Address, Username, Password string, port int, encoding encodingFormat.EncodingFormat, stateURLRoot, configURLRoot string) types.CServiceProvider
ConnectToRestconfProvider connects to the RESTCONF device by creating a connection to the provider using given path, address, username, password, and port. Returns the connected service provider (types.CServiceProvider).
func CreateDataNode ¶
func CreateRootDataNode ¶
func CreateRootDataNode(rsn types.RootSchemaNode, path string) types.DataNode
func DisconnectFromNetconfProvider ¶
func DisconnectFromNetconfProvider(provider types.CServiceProvider)
DisconnectFromNetconfProvider disconnects from NETCONF device and frees the given service provider.
func DisconnectFromOpenDaylightProvider ¶
func DisconnectFromOpenDaylightProvider( provider types.COpenDaylightServiceProvider)
DisconnectFromOpenDaylightProvider disconnects from OpenDaylight device and frees allocated memory.
func DisconnectFromRestconfProvider ¶
func DisconnectFromRestconfProvider(provider types.CServiceProvider)
DisconnectFromRestconfProvider disconnects from RESTCONF device and frees the given service provider.
func ExecuteRPC ¶
func ExecuteRPC( provider types.ServiceProvider, rpcTag string, data map[string]interface{}, setConfigFlag bool) types.DataNode
ExecuteRPC executes payload converted from entity for CRUD/Netconf services. Returns a data node (types.DataNode) representing the result of the executed rpc.
func ExecuteRPCEntity ¶
func ExecuteRPCEntity( provider types.ServiceProvider, rpcEntity, topEntity types.Entity) types.Entity
ExecuteRPCEntity provides the functionality to execute RPCs with executor service using an RPC class defined under a ydk.models subpackage Optional args: topEntity to be passed in only when expecting return data Returns nil or an instance of types.Entity when expecting return data
func GetDataPayload ¶
func GetDataPayload( state *errors.State, entity types.Entity, rootSchema C.RootSchemaNode, provider types.ServiceProvider) *C.char
func GetRootSchemaNode ¶
func GetRootSchemaNode(provider types.CServiceProvider) types.RootSchemaNode
func GetSessionCapabilities ¶
GetSessionCapabilities returns list of capabilities supported by Session
func GetTopEntity ¶
GetTopEntity traverses the entity hierarchy up to the top-level entity. Develops error if Parent for non-top-level entity is not set.
func InitCodecServiceProvider ¶
func InitCodecServiceProvider( state *errors.State, entity types.Entity, repo types.Repository) types.RootSchemaNode
InitCodecServiceProvider initializes CodecServiceProvider. Returns root schema node (types.RootSchemaNode) parsed from repository.
func OpenDaylightServiceProviderGetNodeIDs ¶
func OpenDaylightServiceProviderGetNodeIDs( state *errors.State, provider types.COpenDaylightServiceProvider) []string
OpenDaylightServiceProviderGetNodeIDs is a getter function for the node ids given the opendaylight service provider. Returns node ids available ([]string).
func OpenDaylightServiceProviderGetNodeProvider ¶
func OpenDaylightServiceProviderGetNodeProvider( state *errors.State, provider types.COpenDaylightServiceProvider, nodeID string) types.CServiceProvider
OpenDaylightServiceProviderGetNodeProvider is a getter function for the node provider given the opendaylight service provider and node id. Returns service provider (types.CServiceProvider) based on given node id.
func PanicOnCStateError ¶
func PanicOnCStateError(cstate *C.YDKStatePtr)
func ReadDatanode ¶
ReadDatanode populates entity by reading the top level entity from a given data node. Returns the top entity (types.Entity) from readDataNode.
func ServiceProviderGetSession ¶
func ServiceProviderGetSession(provider types.CServiceProvider) types.Session
Types ¶
type NetconfSession ¶
type NetconfSession struct { Repo types.Repository Address string Username string Password string Port int Protocol string OnDemand bool CommonCache bool Timeout int ServerCert string PrivateKey string Private interface{} State errors.State }
NetconfSession declaration and methods
func (*NetconfSession) Disconnect ¶
func (ns *NetconfSession) Disconnect()
Disconnect from gNMI Session
func (*NetconfSession) ExecuteRpc ¶
func (ns *NetconfSession) ExecuteRpc(rpc types.Rpc) types.DataNode
Execute RPC
func (*NetconfSession) GetCapabilities ¶
func (ns *NetconfSession) GetCapabilities() []string
GetCapabilities returns list of capabilities supported by NetconfSession
func (*NetconfSession) GetRootSchemaNode ¶
func (ns *NetconfSession) GetRootSchemaNode() types.RootSchemaNode
Get root schema node
func (*NetconfSession) GetState ¶
func (ns *NetconfSession) GetState() *errors.State
GetState returns error state from NetconfSession
type RestconfSession ¶
type RestconfSession struct { Repo types.Repository Address string Username string Password string Port int Encoding encoding.EncodingFormat ConfigRoot string StateRoot string Private interface{} State errors.State }
RestconfSession declaration and methods
func (*RestconfSession) Disconnect ¶
func (ns *RestconfSession) Disconnect()
Disconnect from gNMI Session
func (*RestconfSession) ExecuteRpc ¶
func (rs *RestconfSession) ExecuteRpc(rpc types.Rpc) types.DataNode
Execute RPC
func (*RestconfSession) GetCapabilities ¶
func (rs *RestconfSession) GetCapabilities() []string
GetCapabilities returns list of capabilities supported by RestconfSession
func (*RestconfSession) GetRootSchemaNode ¶
func (rs *RestconfSession) GetRootSchemaNode() types.RootSchemaNode
Get root schema node
func (*RestconfSession) GetState ¶
func (rs *RestconfSession) GetState() *errors.State
GetState returns error state from RestconfSession