Tenants are entities that own any jobs and companies objects assigned to them. They create a middle layer of organization between a Google Cloud project and your uploaded data. Tenants allow you to isolate different groupings of your data without the need for multiple projects by preventing any data from being shared across tenancy barriers. Multi-tenancy is useful in situations where you may have more than one customer and don't want to share data between them, but would like to maintain a single Google Cloud project for internal billing and reporting. For example:
- Job site providers building job sites for organizations with multiple subsidiary companies.
- Hiring agencies building applicant tracking systems for multiple businesses.
Each Google Cloud project is assigned a tenant_id
for a single default
tenant. Optionally, you can change the default by creating more than one tenant
within a given project.
Tenants are fully isolated from one another. All APIs ask for only a single tenant to prevent data being queried across multiple tenants in a single API call. Machine learning (ML) similarly treats tenants as discrete units and does not cross tenancy barriers. A project can support as many tenants as required.
Default tenants
In Job Search v4beta1 and newer, a Tenant entity is required. All projects are
assigned a tenant_id
for a single default tenant. If you don't want to use
multiple tenants, you can either:
Use your project's default tenant (Recommended). You don't need to reference the tenant specifically in order to do this. You can use the format
projects/{project_id}/jobs/{job_id}
and the Cloud Talent Solution backend will assume that you're using the default tenant.Create a single tenant and use it in place of the default tenant. If you create your own tenant, you need to reference it:
projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}
.
The default tenant_id
is unique to each project and is never overwritten or
replaced if you create additional tenants. You cannot call CRUD methods on the
default tenant.
Created tenants (optional)
Creating your own tenants is optional. Each Job Search project is assigned a default tenant by the CTS backend. If you do not want to use multi-tenancy to separate subdivisions of your data, we recommend that you use the default tenant.
Create a tenant
You are required to create a unique externalId
value and assign it to the new
tenant. The call then returns a unique name
assigned by our backend system,
also assigned to that tenant. Be sure to record and store both the name
and
externalId
values, as they are used to update/delete/reference.
The code sample below creates a new tenant:
Java
To learn how to install and use the client library for CTS, see CTS client libraries. For more information, see the CTS Java API reference documentation.
To authenticate to CTS, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Retrieve a tenant
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
List tenants
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Delete a tenant
Java
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.
Python
For more on installing and creating a Cloud Talent Solution client, see Cloud Talent Solution Client Libraries.