{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-deploy/json-schema/google-cloud-deploy-target-schema.json",
  "title": "Target",
  "description": "A `Target` resource in the Cloud Deploy API. A `Target` defines a location to which a Skaffold configuration can be deployed.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-deploy-projects-api-openapi.yml#/components/schemas/Target",
  "type": "object",
  "properties": {
    "etag": {
      "description": "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.",
      "type": "string"
    },
    "run": {
      "$ref": "#/$defs/CloudRunLocation",
      "description": "Optional. Information specifying a Cloud Run deployment target."
    },
    "name": {
      "description": "Identifier. 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])?`",
      "type": "string"
    },
    "createTime": {
      "type": "string",
      "description": "Output only. Time at which the `Target` was created.",
      "readOnly": true,
      "format": "google-datetime"
    },
    "anthosCluster": {
      "$ref": "#/$defs/AnthosCluster",
      "description": "Optional. Information specifying an Anthos Cluster."
    },
    "annotations": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "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.",
      "type": "object"
    },
    "updateTime": {
      "type": "string",
      "format": "google-datetime",
      "readOnly": true,
      "description": "Output only. Most recent time at which the `Target` was updated."
    },
    "customTarget": {
      "$ref": "#/$defs/CustomTarget",
      "description": "Optional. Information specifying a Custom Target."
    },
    "description": {
      "type": "string",
      "description": "Optional. Description of the `Target`. Max length is 255 characters."
    },
    "deployParameters": {
      "description": "Optional. The deploy parameters to use for this target.",
      "additionalProperties": {
        "type": "string"
      },
      "type": "object"
    },
    "targetId": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. Resource id of the `Target`."
    },
    "requireApproval": {
      "description": "Optional. Whether or not the `Target` requires approval.",
      "type": "boolean"
    },
    "multiTarget": {
      "$ref": "#/$defs/MultiTarget",
      "description": "Optional. Information specifying a multiTarget."
    },
    "uid": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. Unique identifier of the `Target`."
    },
    "associatedEntities": {
      "type": "object",
      "description": "Optional. 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])?$`.",
      "additionalProperties": {
        "$ref": "#/$defs/AssociatedEntities"
      }
    },
    "gke": {
      "$ref": "#/$defs/GkeCluster",
      "description": "Optional. Information specifying a GKE Cluster."
    },
    "executionConfigs": {
      "type": "array",
      "description": "Optional. 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`.",
      "items": {
        "$ref": "#/$defs/ExecutionConfig"
      }
    },
    "labels": {
      "type": "object",
      "description": "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.",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "AnthosCluster": {
      "properties": {
        "membership": {
          "description": "Optional. Membership of the GKE Hub-registered cluster to which to apply the Skaffold configuration. Format is `projects/{project}/locations/{location}/memberships/{membership_name}`.",
          "type": "string"
        }
      },
      "description": "Information specifying an Anthos Cluster.",
      "type": "object"
    },
    "AssociatedEntities": {
      "description": "Information about entities associated with a `Target`.",
      "type": "object",
      "properties": {
        "gkeClusters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GkeCluster"
          },
          "description": "Optional. Information specifying GKE clusters as associated entities."
        },
        "anthosClusters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AnthosCluster"
          },
          "description": "Optional. Information specifying Anthos clusters as associated entities."
        }
      }
    },
    "CloudRunLocation": {
      "properties": {
        "location": {
          "type": "string",
          "description": "Required. The location for the Cloud Run Service. Format must be `projects/{project}/locations/{location}`."
        }
      },
      "description": "Information specifying where to deploy a Cloud Run Service.",
      "type": "object"
    },
    "CustomTarget": {
      "properties": {
        "customTargetType": {
          "type": "string",
          "description": "Required. The name of the CustomTargetType. Format must be `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`."
        }
      },
      "type": "object",
      "description": "Information specifying a Custom Target."
    },
    "DefaultPool": {
      "properties": {
        "artifactStorage": {
          "description": "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.",
          "type": "string"
        },
        "serviceAccount": {
          "description": "Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) will be used.",
          "type": "string"
        }
      },
      "description": "Execution using the default Cloud Build pool.",
      "type": "object"
    },
    "ExecutionConfig": {
      "properties": {
        "serviceAccount": {
          "description": "Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) is used.",
          "type": "string"
        },
        "artifactStorage": {
          "type": "string",
          "description": "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."
        },
        "usages": {
          "items": {
            "type": "string",
            "enum": [
              "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED",
              "RENDER",
              "DEPLOY",
              "VERIFY",
              "PREDEPLOY",
              "POSTDEPLOY",
              "ANALYSIS"
            ]
          },
          "description": "Required. Usages when this configuration should be applied.",
          "type": "array"
        },
        "verbose": {
          "description": "Optional. If true, additional logging will be enabled when running builds in this execution environment.",
          "type": "boolean"
        },
        "privatePool": {
          "$ref": "#/$defs/PrivatePool",
          "description": "Optional. Use private Cloud Build pool."
        },
        "executionTimeout": {
          "type": "string",
          "format": "google-duration",
          "description": "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."
        },
        "workerPool": {
          "type": "string",
          "description": "Optional. The resource name of the `WorkerPool`, with the format `projects/{project}/locations/{location}/workerPools/{worker_pool}`. If this optional field is unspecified, the default Cloud Build pool will be used."
        },
        "defaultPool": {
          "$ref": "#/$defs/DefaultPool",
          "description": "Optional. Use default Cloud Build pool."
        }
      },
      "description": "Configuration of the environment to use when calling Skaffold.",
      "type": "object"
    },
    "GkeCluster": {
      "type": "object",
      "description": "Information specifying a GKE Cluster.",
      "properties": {
        "cluster": {
          "description": "Optional. Information specifying a GKE Cluster. Format is `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.",
          "type": "string"
        },
        "dnsEndpoint": {
          "description": "Optional. If set, the cluster will be accessed using the DNS endpoint. Note that both `dns_endpoint` and `internal_ip` cannot be set to true.",
          "type": "boolean"
        },
        "proxyUrl": {
          "description": "Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server.",
          "type": "string"
        },
        "internalIp": {
          "description": "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](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept). Note that `internal_ip` and `dns_endpoint` cannot both be set to true.",
          "type": "boolean"
        }
      }
    },
    "MultiTarget": {
      "type": "object",
      "description": "Information specifying a multiTarget.",
      "properties": {
        "targetIds": {
          "description": "Required. The target_ids of this multiTarget.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "PrivatePool": {
      "description": "Execution using a private Cloud Build pool.",
      "type": "object",
      "properties": {
        "artifactStorage": {
          "description": "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.",
          "type": "string"
        },
        "workerPool": {
          "description": "Required. Resource name of the Cloud Build worker pool to use. The format is `projects/{project}/locations/{location}/workerPools/{pool}`.",
          "type": "string"
        },
        "serviceAccount": {
          "type": "string",
          "description": "Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) will be used."
        }
      }
    }
  }
}