gRPC Client

class Client(host=None, auth=None, certificate=None, port=443)[source]

Low-level gRPC client for interacting with the Workflows backend. Not intended for users to use directly.

Examples

Attributes

DEFAULT_TIMEOUT

int([x]) -> integer

STREAM_TIMEOUT

int([x]) -> integer

api

The available Client operations, as a dict.

certificate

The Client SSL certificate.

channel

The GRPC channel of the Client.

token

The Client token.

Methods

close()

Close the GRPC channel associated with the Client.

health([timeout])

Check the health of the GRPC server (SERVING, NOT_SERVING, UNKNOWN).

>>> from descarteslabs.workflows import Client, Int
>>> my_client = Client(auth=non_default_auth) 
>>> Int(1).compute(client=my_client) 
1
>>> Int(1).publish("One", client=my_client) 
<descarteslabs.workflows.models.workflow.Workflow object at 0x...>
close()[source]

Close the GRPC channel associated with the Client.

health(timeout=None)[source]

Check the health of the GRPC server (SERVING, NOT_SERVING, UNKNOWN).

Example

>>> from descarteslabs.workflows import Client
>>> Client().health() 
SERVING
DEFAULT_TIMEOUT = 5
STREAM_TIMEOUT = 86400
property api

The available Client operations, as a dict.

property certificate

The Client SSL certificate.

property channel

The GRPC channel of the Client.

property token

The Client token.