path

package
v0.0.0-...-fac1166 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package path provides a new interface in the form of Path API, which can be used to write apps using a generic API, using xpath-like path expressions to create and access YANG data nodes. The nodes created using the YDK model API are converted to Path API data nodes for validation and encoding to respective protocol payloads.

YANG Development Kit Copyright 2017 Cisco Systems. All rights reserved. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

func GetCapabilitesFromNetconfProvider(provider types.CServiceProvider) []string

GetCapabilitesFromNetconfProvider gets the capabilities supported by the provider. Returns the list of capabilities.

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

This section is empty.

Jump to

Keyboard shortcuts

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