path

package
v0.0.0-...-b5e1584 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCState

func AddCState(state *errors.State)

AddCState creates and adds cstate to *errors.State.

func CleanUpErrorState

func CleanUpErrorState(state *errors.State)

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 CreateDataNode(dn types.DataNode, path string, value interface{}) types.DataNode

func CreateRootDataNode

func CreateRootDataNode(rsn types.RootSchemaNode, path string) types.DataNode

func CreateRpc

func CreateRpc(rsn types.RootSchemaNode, yangpath string) types.Rpc

func DatanodeToEntity

func DatanodeToEntity(node C.DataNode) types.Entity

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 GetCState

func GetCState(state *errors.State) *C.YDKStatePtr

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

func GetSessionCapabilities(session types.Session) []string

GetSessionCapabilities returns list of capabilities supported by Session

func GetTopEntity

func GetTopEntity(entity types.Entity) types.Entity

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

func ReadDatanode(filter types.Entity, readDataNode types.DataNode) types.Entity

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) Connect

func (ns *NetconfSession) Connect()

Connect to Netconf Session

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) Connect

func (rs *RestconfSession) Connect()

Connect to Restconf Session

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

Jump to

Keyboard shortcuts

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