REST Resource: projects.locations.deliveryPipelines.automations

Resource: Automation

An Automation resource in the Cloud Deploy API.

An Automation enables the automation of manually driven actions for a Delivery Pipeline, which includes Release promotion among Targets, Rollout repair and Rollout deployment strategy advancement. The intention of Automation is to reduce manual intervention in the continuous delivery process.

JSON representation
{
  "name": string,
  "uid": string,
  "description": string,
  "createTime": string,
  "updateTime": string,
  "annotations": {
    string: string,
    ...
  },
  "labels": {
    string: string,
    ...
  },
  "etag": string,
  "suspended": boolean,
  "serviceAccount": string,
  "selector": {
    object (AutomationResourceSelector)
  },
  "rules": [
    {
      object (AutomationRule)
    }
  ]
}
Fields
name

string

Output only. Name of the Automation. Format is projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/automations/{automation}.

uid

string

Output only. Unique identifier of the Automation.

description

string

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

createTime

string (Timestamp format)

Output only. Time at which the automation 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. Time at which the automation 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".

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. Annotations must meet the following constraints:

  • Annotations are key/value pairs.
  • Valid annotation keys have two segments: an optional prefix and name, separated by a slash (/).
  • The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
  • The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots(.), not longer than 253 characters in total, followed by a slash (/).

See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set for more details.

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 <= 63 characters.

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

etag

string

Optional. The weak etag of the Automation resource. 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.

suspended

boolean

Optional. When Suspended, automation is deactivated from execution.

serviceAccount

string

Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources.

selector

object (AutomationResourceSelector)

Required. Selected resources to which the automation will be applied.

rules[]

object (AutomationRule)

Required. List of Automation rules associated with the Automation resource. Must have at least one rule and limited to 250 rules per Delivery Pipeline. Note: the order of the rules here is not the same as the order of execution.

AutomationResourceSelector

AutomationResourceSelector contains the information to select the resources to which an Automation is going to be applied.

JSON representation
{
  "targets": [
    {
      object (TargetAttribute)
    }
  ]
}
Fields
targets[]

object (TargetAttribute)

Contains attributes about a target.

AutomationRule

AutomationRule defines the automation activities.

JSON representation
{

  // Union field rule can be only one of the following:
  "promoteReleaseRule": {
    object (PromoteReleaseRule)
  },
  "advanceRolloutRule": {
    object (AdvanceRolloutRule)
  },
  "repairRolloutRule": {
    object (RepairRolloutRule)
  }
  // End of list of possible types for union field rule.
}
Fields
Union field rule. The configuration of the Automation rule. rule can be only one of the following:
promoteReleaseRule

object (PromoteReleaseRule)

Optional. PromoteReleaseRule will automatically promote a release from the current target to a specified target.

advanceRolloutRule

object (AdvanceRolloutRule)

Optional. The AdvanceRolloutRule will automatically advance a successful Rollout.

repairRolloutRule

object (RepairRolloutRule)

Optional. The RepairRolloutRule will automatically repair a failed rollout.

PromoteReleaseRule

The PromoteRelease rule will automatically promote a release from the current target to a specified target.

JSON representation
{
  "id": string,
  "wait": string,
  "destinationTargetId": string,
  "condition": {
    object (AutomationRuleCondition)
  },
  "destinationPhase": string
}
Fields
id

string

Required. ID of the rule. This id must be unique in the Automation resource to which this rule belongs. The format is [a-z]([a-z0-9-]{0,61}[a-z0-9])?.

wait

string (Duration format)

Optional. How long the release need to be paused until being promoted to the next target.

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

destinationTargetId

string

Optional. The ID of the stage in the pipeline to which this Release is deploying. If unspecified, default it to the next stage in the promotion flow. The value of this field could be one of the following:

  • The last segment of a target name
  • "@next", the next target in the promotion sequence
condition

object (AutomationRuleCondition)

Output only. Information around the state of the Automation rule.

destinationPhase

string

Optional. The starting phase of the rollout created by this operation. Default to the first phase.

AutomationRuleCondition

AutomationRuleCondition contains conditions relevant to an Automation rule.

JSON representation
{
  "targetsPresentCondition": {
    object (TargetsPresentCondition)
  }
}
Fields
targetsPresentCondition

object (TargetsPresentCondition)

Optional. Details around targets enumerated in the rule.

AdvanceRolloutRule

The rollouts.advance automation rule will automatically advance a successful Rollout to the next phase.

JSON representation
{
  "id": string,
  "sourcePhases": [
    string
  ],
  "wait": string,
  "condition": {
    object (AutomationRuleCondition)
  }
}
Fields
id

string

Required. ID of the rule. This id must be unique in the Automation resource to which this rule belongs. The format is [a-z]([a-z0-9-]{0,61}[a-z0-9])?.

sourcePhases[]

string

Optional. Proceeds only after phase name matched any one in the list. This value 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])?$.

wait

string (Duration format)

Optional. How long to wait after a rollout is finished.

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

condition

object (AutomationRuleCondition)

Output only. Information around the state of the Automation rule.

RepairRolloutRule

The RepairRolloutRule automation rule will automatically repair a failed Rollout.

JSON representation
{
  "id": string,
  "phases": [
    string
  ],
  "jobs": [
    string
  ],
  "condition": {
    object (AutomationRuleCondition)
  },
  "repairPhases": [
    {
      object (RepairPhaseConfig)
    }
  ]
}
Fields
id

string

Required. ID of the rule. This id must be unique in the Automation resource to which this rule belongs. The format is [a-z]([a-z0-9-]{0,61}[a-z0-9])?.

phases[]

string

Optional. Phases within which jobs are subject to automatic repair actions on failure. Proceeds only after phase name matched any one in the list, or for all phases if unspecified. This value 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])?$.

jobs[]

string

Optional. Jobs to repair. Proceeds only after job name matched any one in the list, or for all jobs if unspecified or empty. The phase that includes the job must match the phase ID specified in sourcePhase. This value 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])?$.

condition

object (AutomationRuleCondition)

Output only. Information around the state of the 'Automation' rule.

repairPhases[]

object (RepairPhaseConfig)

Required. Defines the types of automatic repair phases for failed jobs.

RepairPhaseConfig

Configuration of the repair phase.

JSON representation
{

  // Union field repair_phase can be only one of the following:
  "retry": {
    object (Retry)
  },
  "rollback": {
    object (Rollback)
  }
  // End of list of possible types for union field repair_phase.
}
Fields
Union field repair_phase. The repair phase to perform. repair_phase can be only one of the following:
retry

object (Retry)

Optional. Retries a failed job.

rollback

object (Rollback)

Optional. Rolls back a Rollout.

Retry

Retries the failed job.

JSON representation
{
  "attempts": string,
  "wait": string,
  "backoffMode": enum (BackoffMode)
}
Fields
attempts

string (int64 format)

Required. Total number of retries. Retry is skipped if set to 0; The minimum value is 1, and the maximum value is 10.

wait

string (Duration format)

Optional. How long to wait for the first retry. Default is 0, and the maximum value is 14d.

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

backoffMode

enum (BackoffMode)

Optional. The pattern of how wait time will be increased. Default is linear. Backoff mode will be ignored if wait is 0.

Rollback

Rolls back a Rollout.

JSON representation
{
  "destinationPhase": string,
  "disableRollbackIfRolloutPending": boolean
}
Fields
destinationPhase

string

Optional. The starting phase ID for the Rollout. If unspecified, the Rollout will start in the stable phase.

disableRollbackIfRolloutPending

boolean

Optional. If pending rollout exists on the target, the rollback operation will be aborted.

Methods

create

Creates a new Automation in a given project and location.

delete

Deletes a single Automation resource.

get

Gets details of a single Automation.

list

Lists Automations in a given project and location.

patch

Updates the parameters of a single Automation resource.