RestconfSession

class ydk.path.RestconfSession(repo, address, username, password, port=80, encoding=EncodingFormat.JSON, config_url_root='/data', state_url_root='/data')
param repo

(Repository) Defines location of YANG model repository.

param address

(str) IP address or DNC name of the device supporting Netconf interface.

param username

(str) Username to log in to the device.

param password

(str) Password to log in to the device.

param port

(int) Type of encoding to be used for the payload. Default is 80.

param encoding

(EncodingFormat) Encoding Format, default is JSON.

param config_url_root

(str) To provider backwards compatibility with older drafts of Restconf RFC, this can be “/config” or “/data” (which is the default).

param state_url_root

(str) To provider backwards compatibility with older drafts of Restconf RFC, this can be “/operational” or “/data” (which is the default)

get_root_schema()

Returns the RootSchemaNode tree supported by this instance of the RestconfSession.

Returns

Pointer to the RootSchemaNode or None, if one was not created.

invoke(rpc)

Invokes or executes the given rpc and returns a DataNode pointer if the Rpc has an output modelled in YANG.

Parameters

rpc – (Rpc)

Returns

Pointer to the DataNode representing the output.

get_capabilities()

Returns a list of capabilities for the Restconf server.

Returns

A list of str representing the Restconf server capabilities.