Skip to main content

targets

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

Overview

Nametargets
TypeResource
Idgoogle.clouddeploy.targets

Fields

NameDatatypeDescription
namestringOptional. 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])?
descriptionstringOptional. Description of the Target. Max length is 255 characters.
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.
anthosClusterobjectInformation specifying an Anthos Cluster.
createTimestringOutput only. Time at which the Target was created.
customTargetobjectInformation specifying a Custom Target.
deployParametersobjectOptional. The deploy parameters to use for this target.
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.
executionConfigsarrayConfigurations 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.
gkeobjectInformation specifying a GKE Cluster.
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.
multiTargetobjectInformation specifying a multiTarget.
requireApprovalbooleanOptional. Whether or not the Target requires approval.
runobjectInformation specifying where to deploy a Cloud Run Service.
targetIdstringOutput only. Resource id of the Target.
uidstringOutput only. Unique identifier of the Target.
updateTimestringOutput only. Most recent time at which the Target was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, targetsIdGets details of a single Target.
listSELECTlocationsId, projectsIdLists Targets in a given project and location.
createINSERTlocationsId, projectsIdCreates a new Target in a given project and location.
deleteDELETElocationsId, projectsId, targetsIdDeletes a single Target.
patchUPDATElocationsId, projectsId, targetsIdUpdates the parameters of a single Target.

SELECT examples

Lists Targets in a given project and location.

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

INSERT example

Use the following StackQL query and manifest file to create a new targets resource.

/*+ create */
INSERT INTO google.clouddeploy.targets (
locationsId,
projectsId,
name,
description,
annotations,
labels,
requireApproval,
gke,
anthosCluster,
run,
multiTarget,
customTarget,
etag,
executionConfigs,
deployParameters
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ annotations }}',
'{{ labels }}',
{{ requireApproval }},
'{{ gke }}',
'{{ anthosCluster }}',
'{{ run }}',
'{{ multiTarget }}',
'{{ customTarget }}',
'{{ etag }}',
'{{ executionConfigs }}',
'{{ deployParameters }}'
;

UPDATE example

Updates a targets resource.

/*+ update */
UPDATE google.clouddeploy.targets
SET
name = '{{ name }}',
description = '{{ description }}',
annotations = '{{ annotations }}',
labels = '{{ labels }}',
requireApproval = true|false,
gke = '{{ gke }}',
anthosCluster = '{{ anthosCluster }}',
run = '{{ run }}',
multiTarget = '{{ multiTarget }}',
customTarget = '{{ customTarget }}',
etag = '{{ etag }}',
executionConfigs = '{{ executionConfigs }}',
deployParameters = '{{ deployParameters }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND targetsId = '{{ targetsId }}';

DELETE example

Deletes the specified targets resource.

/*+ delete */
DELETE FROM google.clouddeploy.targets
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND targetsId = '{{ targetsId }}';