Sign in Start for free

Tasks

List all of the tasks in the supplied Octopus Deploy Space. The results will be sorted from newest to oldest

GET /api/{spaceId}/tasks

Also reachable at /api/spaces/{spaceIdentifier}/tasks, /api/tasks.

Path Parameters

  • spaceId string (required)

Query Parameters

  • active boolean
    Set to true for tasks that have not finished (New, Queued, Executing or Cancelling), or false for tasks that have.
  • batch string
  • description string
    Text to match within a task’s description, such as a project or release name. This is a partial match, not an exact one.
  • environment string
    The ID of an environment, to return only tasks against that environment. This is an ID such as ‘Environments-1’, not an environment name.
  • fromCompletedDate string
    Format date-time.
  • fromQueueDate string
    Format date-time.
  • fromStartDate string
    Format date-time.
  • hasPendingInterruptions boolean
  • hasPendingPreconditions boolean
  • hasWarningsOrErrors boolean
  • ids array of string
    Task IDs to return, such as ‘ServerTasks-1’.
  • name array of string
    Task type names to match exactly, such as ‘Deploy’ or ‘RunbookRun’. Use ListServerTaskTypes to get the supported values.
  • node string
    The ID of the Octopus Server node a task ran on, to return only tasks from that node.
  • partialName string
    A partial task type name, to match tasks whose type name includes it.
  • project string
    The ID of a project, to return only tasks against that project. This is an ID such as ‘Projects-1’, not a project name.
  • runbook string
    The ID of a runbook, to return only runs of that runbook.
  • running boolean
    Set to true for tasks currently in progress (Executing or Cancelling), or false for tasks that are not.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • states array of string
    Task states to match. One or more of New, Queued, Executing, Cancelling, Success, Failed, Canceled, TimedOut.
  • take integer
    Number of items to take. Defaults to 30. Minimum 0.
  • tenant string
    The ID of a tenant, to return only tasks against that tenant. This is an ID such as ‘Tenants-1’, not a tenant name.
  • tenantTag string
    A tenant tag in canonical form, such as ‘Regions/EMEA’, to return only tasks against tenants carrying it.
  • toCompletedDate string
    Format date-time.
  • toQueueDate string
    Format date-time.
  • toStartDate string
    Format date-time.

Response

200 — Holds a TaskResourceCollection generated in response to a ListServerTasksRequest

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • Arguments object
      Gets or sets any arguments to the task.
    • CanRerun boolean
      If true, then the task can be used as the basis for a new task with the same effect.
    • Completed string
      Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
    • CompletedTime string
      Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
    • Description string
      Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
    • Duration string
      Gets or sets a string indicating how long the task took to run.
    • ErrorMessage string
      Gets or sets a short summary of the errors encountered when the task ran (if any).
    • EstimatedRemainingQueueDurationSeconds integer
    • FinishedSuccessfully boolean
      Gets or sets a value indicating whether the task ran to completion successfully.
    • HasBeenPickedUpByProcessor boolean
      Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
    • HasPendingInterruptions boolean
      True if the task has any pending interruptions.
    • HasPendingPreconditions boolean
      True if the task has any pending preconditions.
    • HasWarningsOrErrors boolean
      True if any warnings or non-fatal errors were recorded in the task log during execution.
    • Id string
      Gets or sets a unique identifier for this resource.
    • IsCompleted boolean
      Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • LastUpdatedTime string
      Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Name string
      Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
    • PendingInterruptionTypes array of enum
      Contains a list of the types of any pending interruptions.
      Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
    • PendingPreconditionTypes array of string
      Contains a list of the types of any pending preconditions.
    • ProjectId string
      If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
    • QueueTime string
      Gets or sets the time at which the task was queued. Format date-time.
    • QueueTimeExpiry string
      Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
    • ServerNode string
      Gets the ID of the Octopus server that created and will control this task.
    • SpaceId string
    • StartTime string
      Gets or sets the time at which the task started executing. Format date-time.
    • State enum
      Gets or sets the current state of the task.
      Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.
  • ItemsPerPage integer
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastPageNumber integer
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "Id": "string",
  "ItemType": "string",
  "Items": [
    {
      "Arguments": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "CanRerun": true,
      "Completed": "string",
      "CompletedTime": "2020-01-01T00:00:00.000Z",
      "Description": "string",
      "Duration": "string",
      "ErrorMessage": "string",
      "EstimatedRemainingQueueDurationSeconds": 0,
      "FinishedSuccessfully": true,
      "HasBeenPickedUpByProcessor": true,
      "HasPendingInterruptions": true,
      "HasPendingPreconditions": true,
      "HasWarningsOrErrors": true,
      "Id": "string",
      "IsCompleted": true,
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Name": "string",
      "PendingInterruptionTypes": [
        "ManualIntervention"
      ],
      "PendingPreconditionTypes": [
        "string"
      ],
      "ProjectId": "Projects-1",
      "QueueTime": "2020-01-01T00:00:00.000Z",
      "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
      "ServerNode": "string",
      "SpaceId": "Spaces-1",
      "StartTime": "2020-01-01T00:00:00.000Z",
      "State": "Queued"
    }
  ],
  "ItemsPerPage": 0,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastPageNumber": 0,
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "NumberOfPages": 0,
  "TotalResults": 0
}

Create a new Task

POST /api/{spaceId}/tasks

Also reachable at /api/spaces/{spaceIdentifier}/tasks, /api/tasks.

Path Parameters

  • spaceId string (required)

Request Body

  • Arguments object
  • Description string (required)
  • Name string (required)
    Minimum length 1.
  • QueueTime string
    Format date-time.
  • QueueTimeExpiry string
    Format date-time.
  • SpaceId string
  • Weight number

Response

201 — Created

  • Arguments object
    Gets or sets any arguments to the task.
  • CanRerun boolean
    If true, then the task can be used as the basis for a new task with the same effect.
  • Completed string
    Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
  • CompletedTime string
    Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
  • Description string
    Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
  • Duration string
    Gets or sets a string indicating how long the task took to run.
  • ErrorMessage string
    Gets or sets a short summary of the errors encountered when the task ran (if any).
  • EstimatedRemainingQueueDurationSeconds integer
  • FinishedSuccessfully boolean
    Gets or sets a value indicating whether the task ran to completion successfully.
  • HasBeenPickedUpByProcessor boolean
    Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
  • HasPendingInterruptions boolean
    True if the task has any pending interruptions.
  • HasPendingPreconditions boolean
    True if the task has any pending preconditions.
  • HasWarningsOrErrors boolean
    True if any warnings or non-fatal errors were recorded in the task log during execution.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsCompleted boolean
    Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUpdatedTime string
    Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
  • PendingInterruptionTypes array of enum
    Contains a list of the types of any pending interruptions.
    Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
  • PendingPreconditionTypes array of string
    Contains a list of the types of any pending preconditions.
  • ProjectId string
    If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
  • QueueTime string
    Gets or sets the time at which the task was queued. Format date-time.
  • QueueTimeExpiry string
    Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
  • ServerNode string
    Gets the ID of the Octopus server that created and will control this task.
  • SpaceId string
  • StartTime string
    Gets or sets the time at which the task started executing. Format date-time.
  • State enum
    Gets or sets the current state of the task.
    Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Example Request

JSON
{
  "Arguments": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Description": "string",
  "Name": "string",
  "QueueTime": "2020-01-01T00:00:00.000Z",
  "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
  "SpaceId": "Spaces-1",
  "Weight": 0
}

Example Response

JSON
{
  "Arguments": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "CanRerun": true,
  "Completed": "string",
  "CompletedTime": "2020-01-01T00:00:00.000Z",
  "Description": "string",
  "Duration": "string",
  "ErrorMessage": "string",
  "EstimatedRemainingQueueDurationSeconds": 0,
  "FinishedSuccessfully": true,
  "HasBeenPickedUpByProcessor": true,
  "HasPendingInterruptions": true,
  "HasPendingPreconditions": true,
  "HasWarningsOrErrors": true,
  "Id": "string",
  "IsCompleted": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "PendingInterruptionTypes": [
    "ManualIntervention"
  ],
  "PendingPreconditionTypes": [
    "string"
  ],
  "ProjectId": "Projects-1",
  "QueueTime": "2020-01-01T00:00:00.000Z",
  "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
  "ServerNode": "string",
  "SpaceId": "Spaces-1",
  "StartTime": "2020-01-01T00:00:00.000Z",
  "State": "Queued"
}

Create a new task and execute it, using a given task as the input. Note that deployment tasks cannot be re-run

POST /api/{spaceId}/tasks/rerun/{id}

Also reachable at /api/spaces/{spaceIdentifier}/tasks/rerun/{id}, /api/tasks/rerun/{id}.

Path Parameters

  • id string (required)
    ID of the Task to re-run.
  • spaceId string (required)
    The ID of the space containing the resources.

Response

200 — Carries the new task created in response to re-running an existing task via RerunServerTaskCommand.

  • Arguments object
    Gets or sets any arguments to the task.
  • CanRerun boolean
    If true, then the task can be used as the basis for a new task with the same effect.
  • Completed string
    Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
  • CompletedTime string
    Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
  • Description string
    Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
  • Duration string
    Gets or sets a string indicating how long the task took to run.
  • ErrorMessage string
    Gets or sets a short summary of the errors encountered when the task ran (if any).
  • EstimatedRemainingQueueDurationSeconds integer
  • FinishedSuccessfully boolean
    Gets or sets a value indicating whether the task ran to completion successfully.
  • HasBeenPickedUpByProcessor boolean
    Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
  • HasPendingInterruptions boolean
    True if the task has any pending interruptions.
  • HasPendingPreconditions boolean
    True if the task has any pending preconditions.
  • HasWarningsOrErrors boolean
    True if any warnings or non-fatal errors were recorded in the task log during execution.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsCompleted boolean
    Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUpdatedTime string
    Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
  • PendingInterruptionTypes array of enum
    Contains a list of the types of any pending interruptions.
    Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
  • PendingPreconditionTypes array of string
    Contains a list of the types of any pending preconditions.
  • ProjectId string
    If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
  • QueueTime string
    Gets or sets the time at which the task was queued. Format date-time.
  • QueueTimeExpiry string
    Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
  • ServerNode string
    Gets the ID of the Octopus server that created and will control this task.
  • SpaceId string
  • StartTime string
    Gets or sets the time at which the task started executing. Format date-time.
  • State enum
    Gets or sets the current state of the task.
    Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Example Response

JSON
{
  "Arguments": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "CanRerun": true,
  "Completed": "string",
  "CompletedTime": "2020-01-01T00:00:00.000Z",
  "Description": "string",
  "Duration": "string",
  "ErrorMessage": "string",
  "EstimatedRemainingQueueDurationSeconds": 0,
  "FinishedSuccessfully": true,
  "HasBeenPickedUpByProcessor": true,
  "HasPendingInterruptions": true,
  "HasPendingPreconditions": true,
  "HasWarningsOrErrors": true,
  "Id": "string",
  "IsCompleted": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "PendingInterruptionTypes": [
    "ManualIntervention"
  ],
  "PendingPreconditionTypes": [
    "string"
  ],
  "ProjectId": "Projects-1",
  "QueueTime": "2020-01-01T00:00:00.000Z",
  "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
  "ServerNode": "string",
  "SpaceId": "Spaces-1",
  "StartTime": "2020-01-01T00:00:00.000Z",
  "State": "Queued"
}

List supported task types

GET /api/{spaceId}/tasks/tasktypes

Also reachable at /api/spaces/{spaceIdentifier}/tasks/tasktypes, /api/tasks/tasktypes.

Path Parameters

  • spaceId string (required)

Response

200 — Holds a list of supported task types, generated in response to a ListServerTaskTypesRequest

  • Id string
  • Links object
  • Name string

Example Response

JSON
[
  {
    "Id": "string",
    "Links": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "Name": "string"
  }
]

Get a single Task by ID

GET /api/{spaceId}/tasks/{id}

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}, /api/tasks/{id}.

Path Parameters

  • id string (required)
    ID of the Task to load.
  • spaceId string (required)
    The ID of the space containing the resources.

Response

200 — Holds a task, returned in response to GetServerTaskByIdRequest

  • Arguments object
    Gets or sets any arguments to the task.
  • CanRerun boolean
    If true, then the task can be used as the basis for a new task with the same effect.
  • Completed string
    Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
  • CompletedTime string
    Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
  • Description string
    Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
  • Duration string
    Gets or sets a string indicating how long the task took to run.
  • ErrorMessage string
    Gets or sets a short summary of the errors encountered when the task ran (if any).
  • EstimatedRemainingQueueDurationSeconds integer
  • FinishedSuccessfully boolean
    Gets or sets a value indicating whether the task ran to completion successfully.
  • HasBeenPickedUpByProcessor boolean
    Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
  • HasPendingInterruptions boolean
    True if the task has any pending interruptions.
  • HasPendingPreconditions boolean
    True if the task has any pending preconditions.
  • HasWarningsOrErrors boolean
    True if any warnings or non-fatal errors were recorded in the task log during execution.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsCompleted boolean
    Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUpdatedTime string
    Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
  • PendingInterruptionTypes array of enum
    Contains a list of the types of any pending interruptions.
    Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
  • PendingPreconditionTypes array of string
    Contains a list of the types of any pending preconditions.
  • ProjectId string
    If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
  • QueueTime string
    Gets or sets the time at which the task was queued. Format date-time.
  • QueueTimeExpiry string
    Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
  • ServerNode string
    Gets the ID of the Octopus server that created and will control this task.
  • SpaceId string
  • StartTime string
    Gets or sets the time at which the task started executing. Format date-time.
  • State enum
    Gets or sets the current state of the task.
    Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Example Response

JSON
{
  "Arguments": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "CanRerun": true,
  "Completed": "string",
  "CompletedTime": "2020-01-01T00:00:00.000Z",
  "Description": "string",
  "Duration": "string",
  "ErrorMessage": "string",
  "EstimatedRemainingQueueDurationSeconds": 0,
  "FinishedSuccessfully": true,
  "HasBeenPickedUpByProcessor": true,
  "HasPendingInterruptions": true,
  "HasPendingPreconditions": true,
  "HasWarningsOrErrors": true,
  "Id": "string",
  "IsCompleted": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "PendingInterruptionTypes": [
    "ManualIntervention"
  ],
  "PendingPreconditionTypes": [
    "string"
  ],
  "ProjectId": "Projects-1",
  "QueueTime": "2020-01-01T00:00:00.000Z",
  "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
  "ServerNode": "string",
  "SpaceId": "Spaces-1",
  "StartTime": "2020-01-01T00:00:00.000Z",
  "State": "Queued"
}

Mark the given task as canceled

POST /api/{spaceId}/tasks/{id}/cancel

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/cancel, /api/tasks/{id}/cancel.

Path Parameters

  • id string (required)
    ID of the Task to cancel.
  • spaceId string (required)
    The ID of the space containing the resources.

Response

200 — Returned in response to CancelServerTaskRequest. If the ServerTask cancellation failed, clients should receive an error instead.

  • Arguments object
    Gets or sets any arguments to the task.
  • CanRerun boolean
    If true, then the task can be used as the basis for a new task with the same effect.
  • Completed string
    Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
  • CompletedTime string
    Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
  • Description string
    Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
  • Duration string
    Gets or sets a string indicating how long the task took to run.
  • ErrorMessage string
    Gets or sets a short summary of the errors encountered when the task ran (if any).
  • EstimatedRemainingQueueDurationSeconds integer
  • FinishedSuccessfully boolean
    Gets or sets a value indicating whether the task ran to completion successfully.
  • HasBeenPickedUpByProcessor boolean
    Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
  • HasPendingInterruptions boolean
    True if the task has any pending interruptions.
  • HasPendingPreconditions boolean
    True if the task has any pending preconditions.
  • HasWarningsOrErrors boolean
    True if any warnings or non-fatal errors were recorded in the task log during execution.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsCompleted boolean
    Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUpdatedTime string
    Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
  • PendingInterruptionTypes array of enum
    Contains a list of the types of any pending interruptions.
    Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
  • PendingPreconditionTypes array of string
    Contains a list of the types of any pending preconditions.
  • ProjectId string
    If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
  • QueueTime string
    Gets or sets the time at which the task was queued. Format date-time.
  • QueueTimeExpiry string
    Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
  • ServerNode string
    Gets the ID of the Octopus server that created and will control this task.
  • SpaceId string
  • StartTime string
    Gets or sets the time at which the task started executing. Format date-time.
  • State enum
    Gets or sets the current state of the task.
    Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Example Response

JSON
{
  "Arguments": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "CanRerun": true,
  "Completed": "string",
  "CompletedTime": "2020-01-01T00:00:00.000Z",
  "Description": "string",
  "Duration": "string",
  "ErrorMessage": "string",
  "EstimatedRemainingQueueDurationSeconds": 0,
  "FinishedSuccessfully": true,
  "HasBeenPickedUpByProcessor": true,
  "HasPendingInterruptions": true,
  "HasPendingPreconditions": true,
  "HasWarningsOrErrors": true,
  "Id": "string",
  "IsCompleted": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "PendingInterruptionTypes": [
    "ManualIntervention"
  ],
  "PendingPreconditionTypes": [
    "string"
  ],
  "ProjectId": "Projects-1",
  "QueueTime": "2020-01-01T00:00:00.000Z",
  "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
  "ServerNode": "string",
  "SpaceId": "Spaces-1",
  "StartTime": "2020-01-01T00:00:00.000Z",
  "State": "Queued"
}

Get a single task by ID, including the full task log as a tree of activity elements

GET /api/{spaceId}/tasks/{id}/details

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/details, /api/tasks/{id}/details.

Path Parameters

  • id string (required)
    The ID of the task to load details for.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Query Parameters

  • ranges string
  • tail integer
    If set, determines how many log entries will be returned.
  • verbose boolean
    If true, includes verbose output.

Response

200 — Returns details about a specific server task

  • ActivityLogs array of object
    • Children array of object
    • Ended string
      Format date-time.
    • Id string
    • LogElements array of object
    • Name string
    • ProgressMessage string
    • ProgressPercentage integer
    • ShowAtSummaryLevel boolean
    • Started string
      Format date-time.
    • Status enum
      Allowed values: Pending, Running, Success, Failed, Skipped, SuccessWithWarning, Canceled.
  • Id string
    Gets or sets a unique identifier for this resource.
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • PhysicalLogSize integer
  • Progress object
    • EstimatedTimeRemaining string
    • ProgressPercentage integer
  • Task object
    • Arguments object
      Gets or sets any arguments to the task.
    • CanRerun boolean
      If true, then the task can be used as the basis for a new task with the same effect.
    • Completed string
      Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
    • CompletedTime string
      Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
    • Description string
      Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
    • Duration string
      Gets or sets a string indicating how long the task took to run.
    • ErrorMessage string
      Gets or sets a short summary of the errors encountered when the task ran (if any).
    • EstimatedRemainingQueueDurationSeconds integer
    • FinishedSuccessfully boolean
      Gets or sets a value indicating whether the task ran to completion successfully.
    • HasBeenPickedUpByProcessor boolean
      Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
    • HasPendingInterruptions boolean
      True if the task has any pending interruptions.
    • HasPendingPreconditions boolean
      True if the task has any pending preconditions.
    • HasWarningsOrErrors boolean
      True if any warnings or non-fatal errors were recorded in the task log during execution.
    • Id string
      Gets or sets a unique identifier for this resource.
    • IsCompleted boolean
      Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • LastUpdatedTime string
      Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Name string
      Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
    • PendingInterruptionTypes array of enum
      Contains a list of the types of any pending interruptions.
      Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
    • PendingPreconditionTypes array of string
      Contains a list of the types of any pending preconditions.
    • ProjectId string
      If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
    • QueueTime string
      Gets or sets the time at which the task was queued. Format date-time.
    • QueueTimeExpiry string
      Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
    • ServerNode string
      Gets the ID of the Octopus server that created and will control this task.
    • SpaceId string
    • StartTime string
      Gets or sets the time at which the task started executing. Format date-time.
    • State enum
      Gets or sets the current state of the task.
      Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Example Response

JSON
{
  "ActivityLogs": [
    {
      "Children": [],
      "Ended": "2020-01-01T00:00:00.000Z",
      "Id": "0c5a872485ac4b10857939a92d082e67",
      "LogElements": [
        {}
      ],
      "Name": "string",
      "ProgressMessage": "string",
      "ProgressPercentage": 0,
      "ShowAtSummaryLevel": true,
      "Started": "2020-01-01T00:00:00.000Z",
      "Status": "Pending"
    }
  ],
  "Id": "string",
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "PhysicalLogSize": 0,
  "Progress": {
    "EstimatedTimeRemaining": "string",
    "ProgressPercentage": 0
  },
  "Task": {
    "Arguments": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "CanRerun": true,
    "Completed": "string",
    "CompletedTime": "2020-01-01T00:00:00.000Z",
    "Description": "string",
    "Duration": "string",
    "ErrorMessage": "string",
    "EstimatedRemainingQueueDurationSeconds": 0,
    "FinishedSuccessfully": true,
    "HasBeenPickedUpByProcessor": true,
    "HasPendingInterruptions": true,
    "HasPendingPreconditions": true,
    "HasWarningsOrErrors": true,
    "Id": "string",
    "IsCompleted": true,
    "LastModifiedBy": "string",
    "LastModifiedOn": "2020-01-01T00:00:00.000Z",
    "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
    "Links": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "Name": "string",
    "PendingInterruptionTypes": [
      "ManualIntervention"
    ],
    "PendingPreconditionTypes": [
      "string"
    ],
    "ProjectId": "Projects-1",
    "QueueTime": "2020-01-01T00:00:00.000Z",
    "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
    "ServerNode": "string",
    "SpaceId": "Spaces-1",
    "StartTime": "2020-01-01T00:00:00.000Z",
    "State": "Queued"
  }
}

Prioritize given task to the top of the Task Queue

POST /api/{spaceId}/tasks/{id}/prioritize

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/prioritize, /api/tasks/{id}/prioritize.

Path Parameters

  • id string (required)
  • spaceId string (required)

Response

200 — Success

Get a list of tasks that this task is currently queued behind

GET /api/{spaceId}/tasks/{id}/queued-behind

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/queued-behind, /api/tasks/{id}/queued-behind.

Path Parameters

  • id string (required)
    ID of the Task.
  • spaceId string (required)

Query Parameters

  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 30. Minimum 0.

Response

200 — Holds the list of tasks that a task is currently queued behind. Response to GetServerTaskQueuedBehindRequest.

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • Arguments object
      Gets or sets any arguments to the task.
    • CanRerun boolean
      If true, then the task can be used as the basis for a new task with the same effect.
    • Completed string
      Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
    • CompletedTime string
      Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
    • Description string
      Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
    • Duration string
      Gets or sets a string indicating how long the task took to run.
    • ErrorMessage string
      Gets or sets a short summary of the errors encountered when the task ran (if any).
    • EstimatedRemainingQueueDurationSeconds integer
    • FinishedSuccessfully boolean
      Gets or sets a value indicating whether the task ran to completion successfully.
    • HasBeenPickedUpByProcessor boolean
      Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
    • HasPendingInterruptions boolean
      True if the task has any pending interruptions.
    • HasPendingPreconditions boolean
      True if the task has any pending preconditions.
    • HasWarningsOrErrors boolean
      True if any warnings or non-fatal errors were recorded in the task log during execution.
    • Id string
      Gets or sets a unique identifier for this resource.
    • IsCompleted boolean
      Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • LastUpdatedTime string
      Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Name string
      Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
    • PendingInterruptionTypes array of enum
      Contains a list of the types of any pending interruptions.
      Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
    • PendingPreconditionTypes array of string
      Contains a list of the types of any pending preconditions.
    • ProjectId string
      If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
    • QueueTime string
      Gets or sets the time at which the task was queued. Format date-time.
    • QueueTimeExpiry string
      Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
    • ServerNode string
      Gets the ID of the Octopus server that created and will control this task.
    • SpaceId string
    • StartTime string
      Gets or sets the time at which the task started executing. Format date-time.
    • State enum
      Gets or sets the current state of the task.
      Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.
  • ItemsPerPage integer
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastPageNumber integer
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "Id": "string",
  "ItemType": "string",
  "Items": [
    {
      "Arguments": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "CanRerun": true,
      "Completed": "string",
      "CompletedTime": "2020-01-01T00:00:00.000Z",
      "Description": "string",
      "Duration": "string",
      "ErrorMessage": "string",
      "EstimatedRemainingQueueDurationSeconds": 0,
      "FinishedSuccessfully": true,
      "HasBeenPickedUpByProcessor": true,
      "HasPendingInterruptions": true,
      "HasPendingPreconditions": true,
      "HasWarningsOrErrors": true,
      "Id": "string",
      "IsCompleted": true,
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Name": "string",
      "PendingInterruptionTypes": [
        "ManualIntervention"
      ],
      "PendingPreconditionTypes": [
        "string"
      ],
      "ProjectId": "Projects-1",
      "QueueTime": "2020-01-01T00:00:00.000Z",
      "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
      "ServerNode": "string",
      "SpaceId": "Spaces-1",
      "StartTime": "2020-01-01T00:00:00.000Z",
      "State": "Queued"
    }
  ],
  "ItemsPerPage": 0,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastPageNumber": 0,
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "NumberOfPages": 0,
  "TotalResults": 0
}

Get the full task log of a given resource as plain text. Useful when the log needs to be rendered to a console or sent as an email attachment

GET /api/{spaceId}/tasks/{id}/raw

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/raw, /api/tasks/{id}/raw.

Path Parameters

  • id string (required)
    The ID of the task.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Response

200 — Success

Example Response

JSON
"string"

Change the state of a task

POST /api/{spaceId}/tasks/{id}/state

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/state, /api/tasks/{id}/state.

Path Parameters

  • id string (required)
    The ID of the task.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Request Body

  • Id string (required)
    The ID of the task.
  • Reason string (required)
    The reason for the state change. Minimum length 1.
  • SpaceId string
    The ID of the space containing the resource(s).
  • State enum (required)
    The state to set the task to.
    Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Response

200 — Returns the Task resource after the state has been changed in response to a ModifyServerTaskStateCommand

  • Arguments object
    Gets or sets any arguments to the task.
  • CanRerun boolean
    If true, then the task can be used as the basis for a new task with the same effect.
  • Completed string
    Gets or sets a value indicating the completion status of the task. May be “Timed out”, “Queued…”, “Executing…”, or the time at which the task completed for completed tasks.
  • CompletedTime string
    Gets or sets the date/time that the task completed. Will be null if the task has not yet completed. Format date-time.
  • Description string
    Gets or sets a short, human-understandable description of this task. An example might be “Manual database backup”. This is the name that will be shown in the task list.
  • Duration string
    Gets or sets a string indicating how long the task took to run.
  • ErrorMessage string
    Gets or sets a short summary of the errors encountered when the task ran (if any).
  • EstimatedRemainingQueueDurationSeconds integer
  • FinishedSuccessfully boolean
    Gets or sets a value indicating whether the task ran to completion successfully.
  • HasBeenPickedUpByProcessor boolean
    Gets or sets a boolean value indicating whether the Octopus Server is processing this task.
  • HasPendingInterruptions boolean
    True if the task has any pending interruptions.
  • HasPendingPreconditions boolean
    True if the task has any pending preconditions.
  • HasWarningsOrErrors boolean
    True if any warnings or non-fatal errors were recorded in the task log during execution.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsCompleted boolean
    Gets or sets a value indicating whether the task has completed (that is, not queued, not running, and not paused; may have finished successfully or failed).
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastUpdatedTime string
    Gets or sets the time that the Octopus server last updated the status of this task. For a running task this should happen at least every couple of minutes. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Gets or sets the name of the task to create. This name must be one of the list of possible names documented in the create API operation documentation.
  • PendingInterruptionTypes array of enum
    Contains a list of the types of any pending interruptions.
    Allowed values: ManualIntervention, GuidedFailure, PullRequestCompletion, ArgoCDApplicationSync, KubernetesResourceVerification.
  • PendingPreconditionTypes array of string
    Contains a list of the types of any pending preconditions.
  • ProjectId string
    If the task belongs to a project (e.g. a deployment), the ID of the project it belongs to.
  • QueueTime string
    Gets or sets the time at which the task was queued. Format date-time.
  • QueueTimeExpiry string
    Gets or sets the time at which the task will timeout if it has not started executing. Format date-time.
  • ServerNode string
    Gets the ID of the Octopus server that created and will control this task.
  • SpaceId string
  • StartTime string
    Gets or sets the time at which the task started executing. Format date-time.
  • State enum
    Gets or sets the current state of the task.
    Allowed values: Queued, Executing, Failed, Canceled, TimedOut, Success, Cancelling.

Example Request

JSON
{
  "Id": "ServerTasks-1",
  "Reason": "string",
  "SpaceId": "Spaces-1",
  "State": "Queued"
}

Example Response

JSON
{
  "Arguments": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "CanRerun": true,
  "Completed": "string",
  "CompletedTime": "2020-01-01T00:00:00.000Z",
  "Description": "string",
  "Duration": "string",
  "ErrorMessage": "string",
  "EstimatedRemainingQueueDurationSeconds": 0,
  "FinishedSuccessfully": true,
  "HasBeenPickedUpByProcessor": true,
  "HasPendingInterruptions": true,
  "HasPendingPreconditions": true,
  "HasWarningsOrErrors": true,
  "Id": "string",
  "IsCompleted": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastUpdatedTime": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "PendingInterruptionTypes": [
    "ManualIntervention"
  ],
  "PendingPreconditionTypes": [
    "string"
  ],
  "ProjectId": "Projects-1",
  "QueueTime": "2020-01-01T00:00:00.000Z",
  "QueueTimeExpiry": "2020-01-01T00:00:00.000Z",
  "ServerNode": "string",
  "SpaceId": "Spaces-1",
  "StartTime": "2020-01-01T00:00:00.000Z",
  "State": "Queued"
}

Get messages for a single Task by Id

GET /api/{spaceId}/tasks/{id}/status/messages

Also reachable at /api/spaces/{spaceIdentifier}/tasks/{id}/status/messages, /api/tasks/{id}/status/messages.

Path Parameters

  • id string (required)
    ID of the Task to load status messages for.
  • spaceId string (required)
    The ID of the space containing the resources.

Response

200 — The requested Task Status Messages

  • Messages array of object
    • Category string
    • Id string
      Gets or sets a unique identifier for this resource.
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Message string
    • Title string

Example Response

JSON
{
  "Messages": [
    {
      "Category": "string",
      "Id": "string",
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Message": "string",
      "Title": "string"
    }
  ]
}