REST Resource: projects.locations.targets

Resource: Target

A Target resource in the Cloud Deploy API.

A Target defines a location to which a Skaffold configuration can be deployed.

JSON representation
{
  "name": string,
  "targetId": string,
  "uid": string,
  "description": string,
  "annotations": {
    string: string,
    ...
  },
  "labels": {
    string: string,
    ...
  },
  "requireApproval": boolean,
  "createTime": string,
  "updateTime": string,
  "etag": string,
  "executionConfigs": [
    {
      object (ExecutionConfig)
    }
  ],
  "deployParameters": {
    string: string,
    ...
  },

  // Union field deployment_target can be only one of the following:
  "gke": {
    object (GkeCluster)
  },
  "anthosCluster": {
    object (AnthosCluster)
  },
  "run": {
    object (CloudRunLocation)
  },
  "multiTarget": {
    object (MultiTarget)
  },
  "customTarget": {
    object (CustomTarget)
  }
  // End of list of possible types for union field deployment_target.
}
Fields
name

string

Optional. Name of the Target. Format is projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}.

targetId

string

Output only. Resource id of the Target.

uid

string

Output only. Unique identifier of the Target.

description

string

Optional. Description of the Target. Max length is 255 characters.

annotations

map (key: string, value: string)

Optional. 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.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

labels

map (key: string, value: string)

Optional. 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.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

requireApproval

boolean

Optional. Whether or not the Target requires approval.

createTime

string (Timestamp format)

Output only. Time at which the Target was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Most recent time at which the Target was updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

etag

string

Optional. 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.

executionConfigs[]

object (ExecutionConfig)

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.

deployParameters

map (key: string, value: string)

Optional. The deploy parameters to use for this target.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Union field deployment_target. Destination to which the Skaffold configuration is applied during a rollout. deployment_target can be only one of the following:
gke

object (GkeCluster)

Optional. Information specifying a GKE Cluster.

anthosCluster

object (AnthosCluster)

Optional. Information specifying an Anthos Cluster.

run

object (CloudRunLocation)

Optional. Information specifying a Cloud Run deployment target.

multiTarget

object (MultiTarget)

Optional. Information specifying a multiTarget.

customTarget

object (CustomTarget)

Optional. Information specifying a Custom Target.

GkeCluster

Information specifying a GKE Cluster.

JSON representation
{
  "cluster": string,
  "internalIp": boolean
}
Fields
cluster

string

Information specifying a GKE Cluster. Format is projects/{projectId}/locations/{locationId}/clusters/{cluster_id}.

internalIp

boolean

Optional. If true, cluster is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise.

Only specify this option when cluster is a private GKE cluster.

AnthosCluster

Information specifying an Anthos Cluster.

JSON representation
{
  "membership": string
}
Fields
membership

string

Membership of the GKE Hub-registered cluster to which to apply the Skaffold configuration. Format is projects/{project}/locations/{location}/memberships/{membership_name}.

CloudRunLocation

Information specifying where to deploy a Cloud Run Service.

JSON representation
{
  "location": string
}
Fields
location

string

Required. The location for the Cloud Run Service. Format must be projects/{project}/locations/{location}.

MultiTarget

Information specifying a multiTarget.

JSON representation
{
  "targetIds": [
    string
  ]
}
Fields
targetIds[]

string

Required. The targetIds of this multiTarget.

CustomTarget

Information specifying a Custom Target.

JSON representation
{
  "customTargetType": string
}
Fields
customTargetType

string

Required. The name of the CustomTargetType. Format must be projects/{project}/locations/{location}/customTargetTypes/{customTargetType}.

ExecutionConfig

Configuration of the environment to use when calling Skaffold.

JSON representation
{
  "usages": [
    enum (ExecutionEnvironmentUsage)
  ],
  "workerPool": string,
  "serviceAccount": string,
  "artifactStorage": string,
  "executionTimeout": string,

  // Union field execution_environment can be only one of the following:
  "defaultPool": {
    object (DefaultPool)
  },
  "privatePool": {
    object (PrivatePool)
  }
  // End of list of possible types for union field execution_environment.
}
Fields
usages[]

enum (ExecutionEnvironmentUsage)

Required. Usages when this configuration should be applied.

workerPool

string

Optional. The resource name of the WorkerPool, with the format projects/{project}/locations/{location}/workerPools/{workerPool}. If this optional field is unspecified, the default Cloud Build pool will be used.

serviceAccount

string

Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) is used.

artifactStorage

string

Optional. Cloud Storage location in which to store execution outputs. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.

executionTimeout

string (Duration format)

Optional. Execution timeout for a Cloud Build Execution. This must be between 10m and 24h in seconds format. If unspecified, a default timeout of 1h is used.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Union field execution_environment. Details of the environment. execution_environment can be only one of the following:
defaultPool

object (DefaultPool)

Optional. Use default Cloud Build pool.

privatePool

object (PrivatePool)

Optional. Use private Cloud Build pool.

ExecutionEnvironmentUsage

Possible usages of this configuration.

Enums
EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED Default value. This value is unused.
RENDER Use for rendering.
DEPLOY Use for deploying and deployment hooks.
VERIFY Use for deployment verification.
PREDEPLOY Use for predeploy job execution.
POSTDEPLOY Use for postdeploy job execution.

DefaultPool

Execution using the default Cloud Build pool.

JSON representation
{
  "serviceAccount": string,
  "artifactStorage": string
}
Fields
serviceAccount

string

Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) will be used.

artifactStorage

string

Optional. Cloud Storage location where execution outputs should be stored. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.

PrivatePool

Execution using a private Cloud Build pool.

JSON representation
{
  "workerPool": string,
  "serviceAccount": string,
  "artifactStorage": string
}
Fields
workerPool

string

Required. Resource name of the Cloud Build worker pool to use. The format is projects/{project}/locations/{location}/workerPools/{pool}.

serviceAccount

string

Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) will be used.

artifactStorage

string

Optional. Cloud Storage location where execution outputs should be stored. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.

Methods

create

Creates a new Target in a given project and location.

delete

Deletes a single Target.

get

Gets details of a single Target.

getIamPolicy

Gets the access control policy for a resource.

list

Lists Targets in a given project and location.

patch

Updates the parameters of a single Target.

setIamPolicy

Sets the access control policy on the specified resource.

testIamPermissions

Returns permissions that a caller has on the specified resource.