Skip to main content

targets

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

Overview

Nametargets
TypeResource
Idgoogle.clouddeploy.targets

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Name of the Target. Format is projects/{project}/locations/{location}/targets/{target}. The target component must match [a-z]([a-z0-9-]{0,61}[a-z0-9])?
annotationsobjectOptional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations for more details such as format and size limitations.
anthosClusterobjectOptional. Information specifying an Anthos Cluster. (id: AnthosCluster)
associatedEntitiesobjectOptional. Map of entity IDs to their associated entities. Associated entities allows specifying places other than the deployment target for specific features. For example, the Gateway API canary can be configured to deploy the HTTPRoute to a different cluster(s) than the deployment cluster using associated entities. An entity ID must consist of lower-case letters, numbers, and hyphens, start with a letter and end with a letter or a number, and have a max length of 63 characters. In other words, it must match the following regex: ^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$.
createTimestring (google-datetime)Output only. Time at which the Target was created.
customTargetobjectOptional. Information specifying a Custom Target. (id: CustomTarget)
deployParametersobjectOptional. The deploy parameters to use for this target.
descriptionstringOptional. Description of the Target. Max length is 255 characters.
etagstringOptional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
executionConfigsarrayOptional. Configurations for all execution that relates to this Target. Each ExecutionEnvironmentUsage value may only be used in a single configuration; using the same value multiple times is an error. When one or more configurations are specified, they must include the RENDER and DEPLOY ExecutionEnvironmentUsage values. When no configurations are specified, execution will use the default specified in DefaultPool.
gkeobjectOptional. Information specifying a GKE Cluster. (id: GkeCluster)
labelsobjectOptional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 128 bytes.
multiTargetobjectOptional. Information specifying a multiTarget. (id: MultiTarget)
requireApprovalbooleanOptional. Whether or not the Target requires approval.
runobjectOptional. Information specifying a Cloud Run deployment target. (id: CloudRunLocation)
targetIdstringOutput only. Resource id of the Target.
uidstringOutput only. Unique identifier of the Target.
updateTimestring (google-datetime)Output only. Most recent time at which the Target was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, targetsIdGets details of a single Target.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists Targets in a given project and location.
createinsertprojectsId, locationsIdtargetId, requestId, validateOnlyCreates a new Target in a given project and location.
patchupdateprojectsId, locationsId, targetsIdupdateMask, requestId, allowMissing, validateOnlyUpdates the parameters of a single Target.
deletedeleteprojectsId, locationsId, targetsIdrequestId, allowMissing, validateOnly, etagDeletes a single Target.

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
targetsIdstring
allowMissingboolean
etagstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
targetIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Gets details of a single Target.

SELECT
name,
annotations,
anthosCluster,
associatedEntities,
createTime,
customTarget,
deployParameters,
description,
etag,
executionConfigs,
gke,
labels,
multiTarget,
requireApproval,
run,
targetId,
uid,
updateTime
FROM google.clouddeploy.targets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND targetsId = '{{ targetsId }}' -- required;

INSERT examples

Creates a new Target in a given project and location.

INSERT INTO google.clouddeploy.targets (
data__name,
data__description,
data__annotations,
data__labels,
data__requireApproval,
data__gke,
data__anthosCluster,
data__run,
data__multiTarget,
data__customTarget,
data__associatedEntities,
data__etag,
data__executionConfigs,
data__deployParameters,
projectsId,
locationsId,
targetId,
requestId,
validateOnly
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ annotations }}',
'{{ labels }}',
{{ requireApproval }},
'{{ gke }}',
'{{ anthosCluster }}',
'{{ run }}',
'{{ multiTarget }}',
'{{ customTarget }}',
'{{ associatedEntities }}',
'{{ etag }}',
'{{ executionConfigs }}',
'{{ deployParameters }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ targetId }}',
'{{ requestId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single Target.

UPDATE google.clouddeploy.targets
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__annotations = '{{ annotations }}',
data__labels = '{{ labels }}',
data__requireApproval = {{ requireApproval }},
data__gke = '{{ gke }}',
data__anthosCluster = '{{ anthosCluster }}',
data__run = '{{ run }}',
data__multiTarget = '{{ multiTarget }}',
data__customTarget = '{{ customTarget }}',
data__associatedEntities = '{{ associatedEntities }}',
data__etag = '{{ etag }}',
data__executionConfigs = '{{ executionConfigs }}',
data__deployParameters = '{{ deployParameters }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND targetsId = '{{ targetsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND allowMissing = {{ allowMissing}}
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single Target.

DELETE FROM google.clouddeploy.targets
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND targetsId = '{{ targetsId }}' --required
AND requestId = '{{ requestId }}'
AND allowMissing = '{{ allowMissing }}'
AND validateOnly = '{{ validateOnly }}'
AND etag = '{{ etag }}';