partnerClient.
Create a tenant
CreateTenant creates a new tenant for a customer.
Output
CreateTenant fails with a FailedPrecondition error instead of returning it.
That makes it a good fit for a signup flow that should run only once per customer, where a duplicate means something went wrong.
Get or create a tenant
EnsureTenantForExternalAccount returns the tenant for an external account ID, creating it if it does not exist yet.
Because it is safe to call repeatedly, you can call it whenever you need a customer’s tenant, for example at the start of every job you run for them.
CreateTenant. Calling it again with the same external account ID returns the same tenant.
Choose an external account ID
Namespace treats the external account ID as an opaque string, so use whatever identifies the customer in your own system, such as an account ID from your database. It cannot be changed after the tenant is created, so avoid values that might change, such as an email address.Set limits when you create a tenant
Both calls acceptpolicies, which limit what the tenant can use, such as how many instances it can run at once.
Tenant policies explains the policies you can set. They work the same at creation as when you set them later.
Next steps
List and find tenants
Look up the tenants your platform owns.
Tenant tokens
Act inside the new tenant.