class documentation

Client for accessing Temporal Cloud Operations API.

Warning

This client and the API are experimental

Most users will use connect to create a client. The cloud_service property provides access to a raw gRPC cloud service client.

Clients are not thread-safe and should only be used in the event loop they are first connected in. If a client needs to be used from another thread than where it was created, make sure the event loop where it was created is captured, and then call asyncio.run_coroutine_threadsafe with the client call and that event loop.

Clients do not work across forks since runtimes do not work across forks.

Async Static Method connect Connect to a Temporal Cloud Operations API.
Method __init__ Create a Temporal Cloud Operations client from a service client.
Method api_key.setter Update the API key for this client.
Method rpc_metadata.setter Update the headers for this client.
Property api_key API key for every call made by this client.
Property cloud_service Raw gRPC cloud service client.
Property identity Identity used in calls by this client.
Property rpc_metadata Headers for every call made by this client.
Property service_client Raw gRPC service client.
Instance Variable _service_client Undocumented
@staticmethod
async def connect(*, api_key: Optional[str] = None, version: Optional[str] = None, target_host: str = 'saas-api.tmprl.cloud:443', tls: Union[bool, TLSConfig] = True, retry_config: Optional[RetryConfig] = None, keep_alive_config: Optional[KeepAliveConfig] = KeepAliveConfig.default, rpc_metadata: Mapping[str, str] = {}, identity: Optional[str] = None, lazy: bool = False, runtime: Optional[temporalio.runtime.Runtime] = None, http_connect_proxy_config: Optional[HttpConnectProxyConfig] = None) -> CloudOperationsClient: (source)

Connect to a Temporal Cloud Operations API.

Warning

This client and the API are experimental

Parameters
api_key:Optional[str]API key for Temporal. This becomes the "Authorization" HTTP header with "Bearer " prepended. This is only set if RPC metadata doesn't already have an "authorization" key. This is essentially required for access to the cloud API.
version:Optional[str]Version header for safer mutations. May or may not be required depending on cloud settings.
target_host:strhost:port for the Temporal server. The default is to the common cloud endpoint.
tls:Union[bool, TLSConfig]If true, the default, use system default TLS configuration. If false, the default, do not use TLS. If TLS configuration present, that TLS configuration will be used. The default is usually required to access the API.
retry_config:Optional[RetryConfig]Retry configuration for direct service calls (when opted in) or all high-level calls made by this client (which all opt-in to retries by default). If unset, a default retry configuration is used.
keep_alive_config:Optional[KeepAliveConfig]Keep-alive configuration for the client connection. Default is to check every 30s and kill the connection if a response doesn't come back in 15s. Can be set to None to disable.
rpc_metadata:Mapping[str, str]Headers to use for all calls to the server. Keys here can be overriden by per-call RPC metadata keys.
identity:Optional[str]Identity for this client. If unset, a default is created based on the version of the SDK.
lazy:boolIf true, the client will not connect until the first call is attempted or a worker is created with it. Lazy clients cannot be used for workers.
runtime:Optional[temporalio.runtime.Runtime]The runtime for this client, or the default if unset.
http_connect_proxy_config:Optional[HttpConnectProxyConfig]Configuration for HTTP CONNECT proxy.
Returns
CloudOperationsClientUndocumented
def __init__(self, service_client: temporalio.service.ServiceClient): (source)

Create a Temporal Cloud Operations client from a service client.

Warning

This client and the API are experimental

Parameters
service_client:temporalio.service.ServiceClientExisting service client to use.
@api_key.setter
def api_key(self, value: Optional[str]): (source)

Update the API key for this client.

This is only set if RPCmetadata doesn't already have an "authorization" key.

@rpc_metadata.setter
def rpc_metadata(self, value: Mapping[str, str]): (source)

Update the headers for this client.

Do not mutate this mapping after set. Rather, set an entirely new mapping if changes are needed. Currently this must be set with the temporal-cloud-api-version header if it is needed.

API key for every call made by this client.

Raw gRPC cloud service client.

Identity used in calls by this client.

Headers for every call made by this client.

Do not use mutate this mapping. Rather, set this property with an entirely new mapping to change the headers. This may include the temporal-cloud-api-version header if set.

Raw gRPC service client.

_service_client = (source)

Undocumented