Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): Add experimental support for Cloud Operations API #1538

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

mjameswh
Copy link
Contributor

@mjameswh mjameswh commented Sep 30, 2024

What was changed

Details

  • Introduced a new NPM package: @temporalio/cloud

  • Introduced a new "high level Client" class, CloudOperationsClient. That needs to be distinct from the Client class, as Cloud Operations API goes through a different endpoint and requires different metadata.

  • For now, the client provides no "high level" API. Users may use the low level, raw gRPC interface. They are responsible for providing the "temporal-cloud-api-version" metadata when doing so.

  • Example usage:

  const apiVersion = '2024-05-13-00';

  // Note that this `connection` can't be shared with a `Client` object, they are distinct things
  const connection = await CloudOperationsConnection.connect({
    address: 'saas-api.tmprl.cloud:443',
    apiKey,
    tls: true,
  });
  const client = new CloudOperationsClient({ connection, apiVersion });

  // This part will get simplified when we add high level operations to the client
  const metadata: Metadata = { ['temporal-cloud-api-version']: apiVersion }
  const response = await client.withMetadata(metadata, async () => {
    return client.cloudService.getNamespace({ namespace });
  });

@mjameswh mjameswh marked this pull request as ready for review October 1, 2024 19:47
@mjameswh mjameswh requested a review from a team as a code owner October 1, 2024 19:47
packages/client/src/connection.ts Outdated Show resolved Hide resolved
packages/client/src/connection.ts Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Outdated Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Outdated Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Show resolved Hide resolved
packages/cloud/src/cloud-operations-client.ts Show resolved Hide resolved
@mjameswh mjameswh merged commit 600a06f into temporalio:main Oct 15, 2024
70 checks passed
@mjameswh mjameswh deleted the cloud-ops-client branch October 15, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Cloud Operations API Client
2 participants