Closed GomathiselviS closed 5 months ago
As a user, I want to connect to any gRPC enabled remote device and stream the data constantly in various streaming options provided by HTTP 2, bidirectionally.
This might not be possible and ansible work with request and response model
grpc_nw_get
module can be renamed to grpc_get
since the module will be in netcommon
collection nw
is not required in the name. Applicable for other modules as well.
section
option can be replace with filter
to be in sync with other network modules (eg. netconf_get
)
default_operation
option is applicable for netconf modules. If in case the grpc server doesn't support these options we might able to add that functionality within the module. Can mention this in the module docs
Proposal:
GRPC connection plugin to interact with network devices that support gRPC Author: Gomathi Selvi Srinivasan (@GomathiselviS)
Date: 2021/05/20
Motivation
Describe the reasons for this proposal. Provide GRPC modules to interact with devices that have gRPC services enabled.
Problems
Solution proposal
grpc_get
module: The module fetches configuration and state data from a remote gRPC enabled target host. Options:section
: This argument specifies the string which acts as a filter to restrict the portions of the data to be are retrieved from remote device. If this option is not specified the entire configuration or state data is returned in response provided it is supported by the target host.command
: The option specifies the command to be executed on the target host and returns the response in the result. This option is supported if the gRPC target host supports executing the CLI command over the gRPC connection.display
: This argument specifies an encoding scheme to use when serializing output from the device. The encoding scheme value depends on the capability of the gRPC server running on the target host. The values can be I(json), I(text) etc.data_type
: This argument specifies the type of data that should be fetched from the target host. The value depends on the capability of the gRPC server running on the target host. The values can be I(config), I(oper) etc. based on what is supported by the gRPC server. By default, it will return both configuration and operational state data in response.grpc_config
module: The module will be used to edit the configuration, copy the configuration from one datastore to another or delete a complete configuration datastore on a remote gRPC enabled host. Options:config
: This option specifies the string which acts as a filter to restrict the portions of the data to be retrieved from the target host device. If this option is not specified the entire configuration or state data is returned in response provided it is supported by the target host.state
: The operation that needs to be performed on the candidate datastore. Valid values aremerged
,replaced
, anddeleted
. The default value ismerged
. merged: If the value ismerged
the configuration data in theconfig
option is merged with the configuration at the corresponding level in the target datastore. If the value isreplaced
the configuration data in theconfig
option completely replaces the configuration in the target datastore. If the value isdeleted
the configuration data in theconfig
option is deleted.backup
: This argument will cause the module to create a full backup of the current C(running-config) from the remote device before any changes are made. If the C(backup_options) value is not given, the backup file is written to the C(backup) folder in the playbook root directory or role root directory, if playbook is part of an ansible role. If the directory does not exist, it is created.backup_options:
: This is a dict object containing configurable options related to backup file path. The value of this option is read only when C(backup) is set to I(yes), if C(backup) is set to I(no) this option will be silently ignored.Testing (optional)
grpc_config
module.grpc_get
module.Documentation (optional)
grpc_get
,grpc_config