GrpcOperator

GRPC

Calls a gRPC endpoint to execute an action

View Source

Last Updated: Apr. 2, 2021

Access Instructions

Install the GRPC provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

stub_classgRPC stub class generated from proto fileThe stub client to use for this gRPC call
call_funcgRPC client function name for the endpoint generated from proto file, strThe client function name to call the gRPC endpoint
grpc_conn_idstrThe connection to run the operator against
dataA dict with key value pairs as kwargs of the call_funcThe data to pass to the rpc call
interceptorsA list of gRPC interceptor objects, has to be initializedA list of gRPC interceptor objects to be used on the channel
custom_connection_funcA python function that returns channel object, take in a connection object, can be a partial functionThe customized connection function to return channel object
streamingbooleanA flag to indicate if the call is a streaming call
response_callbackA python function that process the response from gRPC call, takes in response object and context object, context object can be used to perform push xcom or other after task actionsThe callback function to process the response from gRPC call
log_responsebooleanA flag to indicate if we need to log the response

Documentation

Calls a gRPC endpoint to execute an action

Example DAGs

Improve this module by creating an example DAG.

View Source
  1. Add an `example_dags` directory to the top-level source of the provider package with an empty `__init__.py` file.
  2. Add your DAG to this directory. Be sure to include a well-written and descriptive docstring
  3. Create a pull request against the source code. Once the package gets released, your DAG will show up on the Registry.

Was this page helpful?