Skip to content
Ona Docs

UpdateTask

POST/gitpod.v1.EnvironmentAutomationService/UpdateTask

Updates an automation task configuration.

Use this method to:

  • Modify task commands
  • Update task triggers
  • Change dependencies
  • Adjust execution settings

Examples

  • Update command:

    Changes the task’s command.

    id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    spec:
      command: "npm run test:coverage"
  • Update triggers:

    Modifies when the task runs.

    id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    metadata:
      triggeredBy:
        trigger:
          - postEnvironmentStart: true
Body ParametersJSONExpand Collapse
id: optional string
formatuuid
dependsOn: optional array of string

dependencies specifies the IDs of the automations this task depends on.

metadata: optional object { description, name, triggeredBy }
description: optional string
name: optional string
minLength1
triggeredBy: optional object { trigger }
trigger: optional array of AutomationTrigger { beforeSnapshot, manual, postDevcontainerStart, 3 more }
beforeSnapshot: optional boolean
manual: optional boolean
postDevcontainerStart: optional boolean
postEnvironmentStart: optional boolean
postMachineStart: optional boolean
prebuild: optional boolean
spec: optional object { command, env, runsOn }
command: optional string
env: optional array of EnvironmentVariableItem { name, value, valueFrom }
name: optional string

name is the environment variable name.

minLength1
value: optional string

value is a literal string value.

valueFrom: optional EnvironmentVariableSource { secretRef }

value_from specifies a source for the value.

secretRef: SecretRef { id }

secret_ref references a secret by ID.

id: optional string

id is the UUID of the secret to reference.

formatuuid
runsOn: optional RunsOn { docker, machine }
docker: optional object { environment, image }
environment: optional array of string
image: optional string
minLength1
machine: optional unknown

Machine runs the service/task directly on the VM/machine level.

UpdateTask

curl https://app.gitpod.io/api/gitpod.v1.EnvironmentAutomationService/UpdateTask \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $GITPOD_API_KEY" \
    -d '{}'
{}
Returns Examples
{}