Skip to main content

worker_pools

Creates, updates, deletes, gets or lists a worker_pools resource.

Overview

Nameworker_pools
TypeResource
Idgoogle.run.worker_pools

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe fully qualified name of this WorkerPool. In CreateWorkerPoolRequest, this field is ignored, and instead composed from CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id. Format: projects/{project}/locations/{location}/workerPools/{worker_id}
annotationsobjectOptional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects. Cloud Run API v2 does not support annotations with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected in new resources. All system annotations in v1 now have a corresponding field in v2 WorkerPool. This field follows Kubernetes annotations' namespacing, limits, and rules.
binaryAuthorizationobjectOptional. Settings for the Binary Authorization feature. (id: GoogleCloudRunV2BinaryAuthorization)
clientstringArbitrary identifier for the API client.
clientVersionstringArbitrary version identifier for the API client.
conditionsarrayOutput only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the WorkerPool does not reach its Serving state. See comments in reconciling for additional information on reconciliation process in Cloud Run.
createTimestring (google-datetime)Output only. The creation time.
creatorstringOutput only. Email address of the authenticated creator.
customAudiencesarrayOne or more custom audiences that you want this worker pool to support. Specify each custom audience as the full URL in a string. The custom audiences are encoded in the token and used to authenticate requests. For more information, see https://cloud.google.com/run/docs/configuring/custom-audiences.
deleteTimestring (google-datetime)Output only. The deletion time. It is only populated as a response to a Delete request.
descriptionstringUser-provided description of the WorkerPool. This field currently has a 512-character limit.
etagstringOptional. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.
expireTimestring (google-datetime)Output only. For a deleted resource, the time after which it will be permamently deleted.
generationstring (int64)Output only. A number that monotonically increases every time the user modifies the desired state. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.
instanceSplitStatusesarrayOutput only. Detailed status information for corresponding instance splits. See comments in reconciling for additional information on reconciliation process in Cloud Run.
instanceSplitsarrayOptional. Specifies how to distribute instances over a collection of Revisions belonging to the WorkerPool. If instance split is empty or not provided, defaults to 100% instances assigned to the latest Ready Revision.
labelsobjectOptional. Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels. Cloud Run API v2 does not support labels with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 WorkerPool.
lastModifierstringOutput only. Email address of the last authenticated modifier.
latestCreatedRevisionstringOutput only. Name of the last created revision. See comments in reconciling for additional information on reconciliation process in Cloud Run.
latestReadyRevisionstringOutput only. Name of the latest revision that is serving workloads. See comments in reconciling for additional information on reconciliation process in Cloud Run.
launchStagestringOptional. The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed. Set the launch stage to a preview stage on input to allow use of preview features in that stage. On read (or output), describes whether the resource uses preview features. For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output.
observedGenerationstring (int64)Output only. The generation of this WorkerPool currently serving workloads. See comments in reconciling for additional information on reconciliation process in Cloud Run. Please note that unlike v1, this is an int64 value. As with most Google APIs, its JSON representation will be a string instead of an integer.
reconcilingbooleanOutput only. Returns true if the WorkerPool is currently being acted upon by the system to bring it into the desired state. When a new WorkerPool is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the WorkerPool to the desired serving state. This process is called reconciliation. While reconciliation is in process, observed_generation, latest_ready_revison, instance_split_statuses, and uri will have transient values that might mismatch the intended state: Once reconciliation is over (and this field is false), there are two possible outcomes: reconciliation succeeded and the serving state matches the WorkerPool, or there was an error, and reconciliation failed. This state can be found in terminal_condition.state. If reconciliation succeeded, the following fields will match: instance_splits and instance_split_statuses, observed_generation and generation, latest_ready_revision and latest_created_revision. If reconciliation failed, instance_split_statuses, observed_generation, and latest_ready_revision will have the state of the last serving revision, or empty for newly created WorkerPools. Additional information on the failure can be found in terminal_condition and conditions.
satisfiesPzsbooleanOutput only. Reserved for future use.
scalingobjectOptional. Specifies worker-pool-level scaling settings (id: GoogleCloudRunV2WorkerPoolScaling)
templateobjectRequired. The template used to create revisions for this WorkerPool. (id: GoogleCloudRunV2WorkerPoolRevisionTemplate)
terminalConditionobjectDefines a status condition for a resource. (id: GoogleCloudRunV2Condition)
uidstringOutput only. Server assigned unique identifier for the trigger. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.
updateTimestring (google-datetime)Output only. The last-modified time.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, workerPoolsIdGets information about a WorkerPool.
listselectprojectsId, locationsIdpageSize, pageToken, showDeletedLists WorkerPools. Results are sorted by creation time, descending.
createinsertprojectsId, locationsIdworkerPoolId, validateOnlyCreates a new WorkerPool in a given project and location.
patchupdateprojectsId, locationsId, workerPoolsIdupdateMask, validateOnly, allowMissing, forceNewRevisionUpdates a WorkerPool.
deletedeleteprojectsId, locationsId, workerPoolsIdvalidateOnly, etagDeletes a WorkerPool.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
workerPoolsIdstring
allowMissingboolean
etagstring
forceNewRevisionboolean
pageSizeinteger (int32)
pageTokenstring
showDeletedboolean
updateMaskstring (google-fieldmask)
validateOnlyboolean
workerPoolIdstring

SELECT examples

Gets information about a WorkerPool.

SELECT
name,
annotations,
binaryAuthorization,
client,
clientVersion,
conditions,
createTime,
creator,
customAudiences,
deleteTime,
description,
etag,
expireTime,
generation,
instanceSplitStatuses,
instanceSplits,
labels,
lastModifier,
latestCreatedRevision,
latestReadyRevision,
launchStage,
observedGeneration,
reconciling,
satisfiesPzs,
scaling,
template,
terminalCondition,
uid,
updateTime
FROM google.run.worker_pools
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND workerPoolsId = '{{ workerPoolsId }}' -- required;

INSERT examples

Creates a new WorkerPool in a given project and location.

INSERT INTO google.run.worker_pools (
data__name,
data__description,
data__labels,
data__annotations,
data__client,
data__clientVersion,
data__launchStage,
data__binaryAuthorization,
data__template,
data__instanceSplits,
data__scaling,
data__customAudiences,
data__etag,
projectsId,
locationsId,
workerPoolId,
validateOnly
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ annotations }}',
'{{ client }}',
'{{ clientVersion }}',
'{{ launchStage }}',
'{{ binaryAuthorization }}',
'{{ template }}',
'{{ instanceSplits }}',
'{{ scaling }}',
'{{ customAudiences }}',
'{{ etag }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ workerPoolId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a WorkerPool.

UPDATE google.run.worker_pools
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__annotations = '{{ annotations }}',
data__client = '{{ client }}',
data__clientVersion = '{{ clientVersion }}',
data__launchStage = '{{ launchStage }}',
data__binaryAuthorization = '{{ binaryAuthorization }}',
data__template = '{{ template }}',
data__instanceSplits = '{{ instanceSplits }}',
data__scaling = '{{ scaling }}',
data__customAudiences = '{{ customAudiences }}',
data__etag = '{{ etag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workerPoolsId = '{{ workerPoolsId }}' --required
AND updateMask = '{{ updateMask}}'
AND validateOnly = {{ validateOnly}}
AND allowMissing = {{ allowMissing}}
AND forceNewRevision = {{ forceNewRevision}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a WorkerPool.

DELETE FROM google.run.worker_pools
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND workerPoolsId = '{{ workerPoolsId }}' --required
AND validateOnly = '{{ validateOnly }}'
AND etag = '{{ etag }}';