Documentation ¶
Overview ¶
Package services implements support for Go services.
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 ¶
- type CodecService
- type CrudService
- func (c *CrudService) Create(provider types.ServiceProvider, entity types.Entity) bool
- func (c *CrudService) Delete(provider types.ServiceProvider, entity types.Entity) bool
- func (c *CrudService) Read(provider types.ServiceProvider, filter types.Entity) types.Entity
- func (c *CrudService) ReadConfig(provider types.ServiceProvider, filter types.Entity) types.Entity
- func (c *CrudService) Update(provider types.ServiceProvider, entity types.Entity) bool
- type ExecutorService
- type NetconfService
- func (ns *NetconfService) CancelCommit(provider types.ServiceProvider, persistID int) bool
- func (ns *NetconfService) CloseSession(provider types.ServiceProvider) bool
- func (ns *NetconfService) Commit(provider types.ServiceProvider, confirmed bool, ...) bool
- func (ns *NetconfService) CopyConfig(provider types.ServiceProvider, target, sourceDS datastore.DataStore, ...) bool
- func (ns *NetconfService) DeleteConfig(provider types.ServiceProvider, target datastore.DataStore, url string) bool
- func (ns *NetconfService) DiscardChanges(provider types.ServiceProvider) bool
- func (ns *NetconfService) EditConfig(provider types.ServiceProvider, target datastore.DataStore, ...) bool
- func (ns *NetconfService) Get(provider types.ServiceProvider, filter types.Entity) types.Entity
- func (ns *NetconfService) GetConfig(provider types.ServiceProvider, source datastore.DataStore, ...) types.Entity
- func (ns *NetconfService) KillSession(provider types.ServiceProvider, sessionID int) bool
- func (ns *NetconfService) Lock(provider types.ServiceProvider, target datastore.DataStore) bool
- func (ns *NetconfService) Unlock(provider types.ServiceProvider, target datastore.DataStore) bool
- func (ns *NetconfService) Validate(provider types.ServiceProvider, sourceDS datastore.DataStore, ...) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodecService ¶
type CodecService struct { }
CodecService supports encoding and decoding Go model API objects of type
func (*CodecService) Decode ¶
func (c *CodecService) Decode( provider types.CodecServiceProvider, payload string) types.Entity
Decode converts XML/JSON object to entity object
func (*CodecService) Encode ¶
func (c *CodecService) Encode( provider types.CodecServiceProvider, entity types.Entity) string
Encode converts entity object to XML/JSON payload
type CrudService ¶
type CrudService struct { }
CrudService supports CRUD operations on entities.
func (*CrudService) Create ¶
func (c *CrudService) Create( provider types.ServiceProvider, entity types.Entity) bool
Create the entity. Returns whether the operation was successful or not (bool)
func (*CrudService) Delete ¶
func (c *CrudService) Delete( provider types.ServiceProvider, entity types.Entity) bool
Delete the entity. Returns whether the operation was successful or not (bool)
func (*CrudService) Read ¶
func (c *CrudService) Read( provider types.ServiceProvider, filter types.Entity) types.Entity
Read the entity. Returns the entity as identified by the given filter (types.Entity)
func (*CrudService) ReadConfig ¶
func (c *CrudService) ReadConfig( provider types.ServiceProvider, filter types.Entity) types.Entity
ReadConfig only reads config. Returns the entity as identified by the given filter (types.Entity)
func (*CrudService) Update ¶
func (c *CrudService) Update( provider types.ServiceProvider, entity types.Entity) bool
Update the entity. Returns whether the operation was successful or not (bool)
type ExecutorService ¶
type ExecutorService struct { }
ExecutorService provides the functionality to execute RPCs
func (*ExecutorService) ExecuteRpc ¶
func (es *ExecutorService) ExecuteRpc( provider types.ServiceProvider, rpcEntity, topEntity types.Entity) types.Entity
ExecuteRpc creates the entity represented by rpcEntity Any expected return data uses topEntity as a filter
type NetconfService ¶
type NetconfService struct { }
NetconfService implements the NETCONF Protocol Operations: https://tools.ietf.org/html/rfc6241
func (*NetconfService) CancelCommit ¶
func (ns *NetconfService) CancelCommit( provider types.ServiceProvider, persistID int) bool
CancelCommit cancels an ongoing confirmed commit. If persistID < 1, the operation MUST be issued on the same session that issued the confirmed commit. Returns whether the operation is successful or not
func (*NetconfService) CloseSession ¶
func (ns *NetconfService) CloseSession(provider types.ServiceProvider) bool
CloseSession requests graceful termination of a NETCONF session Returns whether the operation is successful or not
func (*NetconfService) Commit ¶
func (ns *NetconfService) Commit( provider types.ServiceProvider, confirmed bool, confirmTimeOut, persist, persistID int) bool
Commit instructs the device to implement the configuration data contained in the candidate configuration. Returns whether the operation is successful or not
func (*NetconfService) CopyConfig ¶
func (ns *NetconfService) CopyConfig( provider types.ServiceProvider, target, sourceDS datastore.DataStore, sourceEntity types.Entity, url string) bool
CopyConfig creates or replaces an entire configuration DataStore with the contents of another complete configuration DataStore. If the target DataStore exists, it is overwritten. Otherwise, a new one is created, if allowed. Parameters:
sourceEntity should be nil OR sourceDS should be nil, but not neither or both. url is ignored unless target/sourceDS is set to Url.
Returns whether the operation is successful or not
func (*NetconfService) DeleteConfig ¶
func (ns *NetconfService) DeleteConfig( provider types.ServiceProvider, target datastore.DataStore, url string) bool
DeleteConfig deletes a configuration DataStore. The CANDIDATE and RUNNING DataStores cannot be deleted. Returns whether the operation is successful or not
func (*NetconfService) DiscardChanges ¶
func (ns *NetconfService) DiscardChanges(provider types.ServiceProvider) bool
DiscardChanges reverts the candidate configuration to the current running configuration. Returns whether the operation is successful or not
func (*NetconfService) EditConfig ¶
func (ns *NetconfService) EditConfig( provider types.ServiceProvider, target datastore.DataStore, config types.Entity, defaultOper, testOp, errorOp string) bool
EditConfig loads all or part of a specified configuration to the specified target configuration datastore. It allows the new configuration to be expressed using a local file, a remote file, or inline. If the target configuration datastore does not exist, it will be created. Returns whether the operation is successful or not
func (*NetconfService) Get ¶
func (ns *NetconfService) Get( provider types.ServiceProvider, filter types.Entity) types.Entity
Get the running configuration and device state information. Returns the requested data in Entity instance
func (*NetconfService) GetConfig ¶
func (ns *NetconfService) GetConfig( provider types.ServiceProvider, source datastore.DataStore, filter types.Entity) types.Entity
GetConfig retrieves all or part of a specified configuration datastore Returns the requested data in Entity instance
func (*NetconfService) KillSession ¶
func (ns *NetconfService) KillSession( provider types.ServiceProvider, sessionID int) bool
KillSession forces the termination of a NETCONF session. Returns whether the operation is successful or not
func (*NetconfService) Lock ¶
func (ns *NetconfService) Lock( provider types.ServiceProvider, target datastore.DataStore) bool
Lock allows the client to lock the entire configuration datastore system of a device. Returns whether the operation is successful or not
func (*NetconfService) Unlock ¶
func (ns *NetconfService) Unlock( provider types.ServiceProvider, target datastore.DataStore) bool
Unlock a configuration lock, previously obtained with the LOCK operation. Returns whether the operation is successful or not
func (*NetconfService) Validate ¶
func (ns *NetconfService) Validate( provider types.ServiceProvider, sourceDS datastore.DataStore, sourceEntity types.Entity, url string) bool
Validate the contents of the specified configuration Parameters:
sourceEntity should be nil OR sourceDS should be nil, but not neither or both. url is ignored unless target/sourceDS is set to Url.
Returns whether the operation is successful or not