gRPC Client

class Client(host=None, auth=None, certificate=None, port=443, channel=None)[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

INSECURE_CHANNEL_FACTORY(*args, **kw)

SECURE_CHANNEL_FACTORY(*args, **kw)

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()

Close the GRPC channel associated with the Client.

health(timeout=None)

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

Example

>>> from descarteslabs.client.grpc import GrpcClient
>>> GrpcClient().health() 
SERVING
DEFAULT_TIMEOUT = 5
INSECURE_CHANNEL_FACTORY(*args, **kw) → Any
SECURE_CHANNEL_FACTORY(*args, **kw) → Any
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.