gNMIServiceProvider

class ydk::gNMIServiceProvider : public ydk::ServiceProvider

Implementation of ServiceProvider for the gNMI protocol.

gNMIServiceProvider(path::Repository &repo, std::string &address, int port, std::string &username, std::string &password, std::string &server_certificate = "", std::string &private_key = "")

Constructs an instance of gNMIServiceProvider using the provided repository, connects to gNMI server and retrieves server capabilities.

Parameters:
  • repository – Reference to an instance of Repository.
  • address – IP address of the device supporting gNMI protocol.
  • port – Device port used to access the gNMI server.
  • username – Username to log in to the device.
  • password – Password to log in to the device.
  • server_certificate – Full path to a file, which contains server certificate of authorization (public key). If not specified, it is assumed non-secure connection to gNMI server.
  • private_key – Full path to a file, which contains private key of the application host. If not specified and server_certificate is defined (secure connection), the GRPC internally defined private key is used.
Raises:

YServiceError, if connection error occured.

EncodingFormat get_encoding() const

Returns the type of encoding supported by the service provider. In the case of gNMI service provider, EncodingFormat::JSON is always returned.

std::vector<std::string> get_capabilities() const

Returns gNMI server capabilities as vector of strings.