Sign in Start for free

Environments

Get a list of Environments

GET /api/{spaceId}/environments

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

Lists all of the environments in the supplied Octopus Deploy Space. The results will be sorted by the SortOrder field on each environment.

Path Parameters

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

Query Parameters

  • ids array of string
    Environment Ids to filter results to only Environments with the given Ids.
  • name string
    Filters the returned environments by the specified name fragment. Left for backwards compatibility; prefer PartialName.
  • partialName string
    Filters the documents using the specified partialName fragment.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 10. Minimum 0.

Response

200 — The requested list of Environments

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • AllowDynamicInfrastructure boolean
      If set to true, deployments to this environment will be allowed to contain steps that manage infrastructure. This relies on DeploymentActionResource being set to allow managing resource for a step.
    • Description string
      Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
    • EnvironmentTags array of string
      List of tags assigned to this environment.
    • ExtensionSettings array of object
    • 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.
    • Name string
      Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
    • Slug string
    • SortOrder integer
      Gets or sets a number indicating the priority of this environment in sort order. Environments with a lower sort order will appear in the UI before items with a higher sort order.
    • SpaceId string
    • UseGuidedFailure boolean
      If set to true, deployments will prompt for manual intervention (Fail/Retry/Ignore) when failures are encountered in activities that support it. May be overridden with the Octopus.UseGuidedFailure special variable.
  • 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": [
    {
      "AllowDynamicInfrastructure": true,
      "Description": "string",
      "EnvironmentTags": [
        "string"
      ],
      "ExtensionSettings": [
        {}
      ],
      "Id": "string",
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Name": "string",
      "Slug": "string",
      "SortOrder": 0,
      "SpaceId": "string",
      "UseGuidedFailure": true
    }
  ],
  "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 environment

POST /api/{spaceId}/environments

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

Path Parameters

  • spaceId string (required)

Request Body

  • AllowDynamicInfrastructure boolean
  • Description string
  • EnvironmentTags array of string
  • ExtensionSettings array of object
    • ExtensionId string
    • Values string
  • Name string (required)
    Minimum length 1. Maximum length 50.
  • Slug string
  • SortOrder integer
  • SpaceId string (required)
  • UseGuidedFailure boolean

Response

201 — Created

  • AllowDynamicInfrastructure boolean
    If set to true, deployments to this environment will be allowed to contain steps that manage infrastructure. This relies on DeploymentActionResource being set to allow managing resource for a step.
  • Description string
    Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
  • EnvironmentTags array of string
    List of tags assigned to this environment.
  • ExtensionSettings array of object
    • ExtensionId string
    • Values 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.
  • Name string
    Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
  • Slug string
  • SortOrder integer
    Gets or sets a number indicating the priority of this environment in sort order. Environments with a lower sort order will appear in the UI before items with a higher sort order.
  • SpaceId string
  • UseGuidedFailure boolean
    If set to true, deployments will prompt for manual intervention (Fail/Retry/Ignore) when failures are encountered in activities that support it. May be overridden with the Octopus.UseGuidedFailure special variable.

Example Request

JSON
{
  "AllowDynamicInfrastructure": true,
  "Description": "string",
  "EnvironmentTags": [
    "string"
  ],
  "ExtensionSettings": [
    {
      "ExtensionId": "string",
      "Values": "string"
    }
  ],
  "Name": "string",
  "Slug": "string",
  "SortOrder": 0,
  "SpaceId": "string",
  "UseGuidedFailure": true
}

Example Response

JSON
{
  "AllowDynamicInfrastructure": true,
  "Description": "string",
  "EnvironmentTags": [
    "string"
  ],
  "ExtensionSettings": [
    {
      "ExtensionId": "string",
      "Values": "string"
    }
  ],
  "Id": "string",
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "Slug": "string",
  "SortOrder": 0,
  "SpaceId": "string",
  "UseGuidedFailure": true
}

Get a list of Environments

GET /api/{spaceId}/environments/all

Also reachable at /api/environments/all, /api/spaces/{spaceIdentifier}/environments/all.

Lists the name and ID of all of the environments in the supplied Space. The results will be sorted by the SortOrder field on each environment.

Path Parameters

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

Query Parameters

  • channelId string
    A Channel Id used to filter a query.
  • ids array of string
    A comma separated list of Deployment Environment resource ids used to filter a query.
  • projectId string
    A project Id used to filter a query.

Response

200 — Requested list of Environments

  • AllowDynamicInfrastructure boolean
    If set to true, deployments to this environment will be allowed to contain steps that manage infrastructure. This relies on DeploymentActionResource being set to allow managing resource for a step.
  • Description string
    Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
  • EnvironmentTags array of string
    List of tags assigned to this environment.
  • ExtensionSettings array of object
    • ExtensionId string
    • Values 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.
  • Name string
    Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
  • Slug string
  • SortOrder integer
    Gets or sets a number indicating the priority of this environment in sort order. Environments with a lower sort order will appear in the UI before items with a higher sort order.
  • SpaceId string
  • UseGuidedFailure boolean
    If set to true, deployments will prompt for manual intervention (Fail/Retry/Ignore) when failures are encountered in activities that support it. May be overridden with the Octopus.UseGuidedFailure special variable.

Example Response

JSON
[
  {
    "AllowDynamicInfrastructure": true,
    "Description": "string",
    "EnvironmentTags": [
      "string"
    ],
    "ExtensionSettings": [
      {
        "ExtensionId": "string",
        "Values": "string"
      }
    ],
    "Id": "string",
    "LastModifiedBy": "string",
    "LastModifiedOn": "2020-01-01T00:00:00.000Z",
    "Links": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "Name": "string",
    "Slug": "string",
    "SortOrder": 0,
    "SpaceId": "string",
    "UseGuidedFailure": true
  }
]

Get a list of Environments

GET /api/{spaceId}/environments/all/v1

Also reachable at /api/environments/all/v1, /api/spaces/{spaceIdentifier}/environments/all/v1.

Lists the name and ID of all of the environments in the supplied Space. The results will be sorted by the SortOrder field on each environment.

Path Parameters

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

Query Parameters

  • channelId string
    A Channel Id used to filter a query.
  • ids array of string
    A comma separated list of Deployment Environment resource ids used to filter a query.
  • projectId string
    A project Id used to filter a query.

Response

200 — Requested list of Environments

  • Environments array of object
    • AllowDynamicInfrastructure boolean
      If set to true, deployments to this environment will be allowed to contain steps that manage infrastructure. This relies on DeploymentActionResource being set to allow managing resource for a step.
    • Description string
      Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
    • EnvironmentTags array of string
      List of tags assigned to this environment.
    • ExtensionSettings array of object
    • 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.
    • Name string
      Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
    • Slug string
    • SortOrder integer
      Gets or sets a number indicating the priority of this environment in sort order. Environments with a lower sort order will appear in the UI before items with a higher sort order.
    • SpaceId string
    • UseGuidedFailure boolean
      If set to true, deployments will prompt for manual intervention (Fail/Retry/Ignore) when failures are encountered in activities that support it. May be overridden with the Octopus.UseGuidedFailure special variable.

Example Response

JSON
{
  "Environments": [
    {
      "AllowDynamicInfrastructure": true,
      "Description": "string",
      "EnvironmentTags": [
        "string"
      ],
      "ExtensionSettings": [
        {}
      ],
      "Id": "string",
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Name": "string",
      "Slug": "string",
      "SortOrder": 0,
      "SpaceId": "string",
      "UseGuidedFailure": true
    }
  ]
}

PUT /api/{spaceId}/environments/sortorder

PUT /api/{spaceId}/environments/sortorder

Also reachable at /api/environments/sortorder, /api/spaces/{spaceIdentifier}/environments/sortorder.

Takes an array of environment IDs as the request body, uses the order of items in the array to sort the environments on the server. The ID of every environment must be specified.

Path Parameters

  • spaceId string (required)

Request Body

A array of string payload.

Response

200 — Success

Example Request

JSON
[
  "string"
]

List all environments, including a summary of machine information

GET /api/{spaceId}/environments/summary

Also reachable at /api/environments/summary, /api/spaces/{spaceIdentifier}/environments/summary.

Path Parameters

  • spaceId string (required)

Query Parameters

  • commStyles array of string
  • deploymentTargetTypes array of string
  • environmentTags array of string
  • healthStatuses array of string
  • hideEmptyEnvironments boolean
  • ids array of string
  • isDisabled boolean
  • machinePartialName string
  • partialName string
  • roles array of string
  • shellNames array of string
  • targetTags array of string
  • tenantIds array of string
  • tenantTags array of string

Response

200 — Contains the machines et al associated with a given environment.

  • DeploymentTargetSummaries object
  • EnvironmentSummaries array of object
    • DeploymentTargetSummaries object
    • Environment object
    • MachineEndpointSummaries object
    • MachineHealthStatusSummaries object
    • MachineIdsForCalamariUpgrade array of string
    • MachineIdsForTentacleUpgrade array of string
    • MachineTenantSummaries object
    • MachineTenantTagSummaries object
    • TentacleUpgradesRequired boolean
    • TotalDisabledMachines integer
    • TotalMachines integer
  • MachineEndpointSummaries object
  • MachineHealthStatusSummaries object
  • MachineIdsForCalamariUpgrade array of string
  • MachineIdsForTentacleUpgrade array of string
  • MachineTenantSummaries object
  • MachineTenantTagSummaries object
  • TentacleUpgradesRequired boolean
  • TotalDisabledMachines integer
  • TotalMachines integer

Example Response

JSON
{
  "DeploymentTargetSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "EnvironmentSummaries": [
    {
      "DeploymentTargetSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "Environment": {
        "AllowDynamicInfrastructure": true,
        "Description": "string",
        "EnvironmentTags": [
          "string"
        ],
        "ExtensionSettings": [
          {}
        ],
        "Id": "string",
        "LastModifiedBy": "string",
        "LastModifiedOn": "2020-01-01T00:00:00.000Z",
        "Links": {},
        "Name": "string",
        "Slug": "string",
        "SortOrder": 0,
        "SpaceId": "string",
        "UseGuidedFailure": true
      },
      "MachineEndpointSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "MachineHealthStatusSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "MachineIdsForCalamariUpgrade": [
        "string"
      ],
      "MachineIdsForTentacleUpgrade": [
        "string"
      ],
      "MachineTenantSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "MachineTenantTagSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "TentacleUpgradesRequired": true,
      "TotalDisabledMachines": 0,
      "TotalMachines": 0
    }
  ],
  "MachineEndpointSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "MachineHealthStatusSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "MachineIdsForCalamariUpgrade": [
    "string"
  ],
  "MachineIdsForTentacleUpgrade": [
    "string"
  ],
  "MachineTenantSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "MachineTenantTagSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "TentacleUpgradesRequired": true,
  "TotalDisabledMachines": 0,
  "TotalMachines": 0
}

List all environments, including a summary of machine information

GET /api/{spaceId}/environments/summary/v2

Also reachable at /api/spaces/{spaceIdentifier}/environments/summary/v2.

Path Parameters

  • spaceId string (required)

Query Parameters

  • commStyles array of string
  • deploymentTargetTypes array of string
  • environmentTags array of string
  • healthStatuses array of string
  • hideEmptyEnvironments boolean
  • ids array of string
  • isDisabled boolean
  • machinePartialName string
  • partialName string
  • roles array of string
  • shellNames array of string
  • targetTags array of string
  • tenantIds array of string
  • tenantTags array of string
  • type array of string
    Filters the environment summaries using the specified environment EnvironmentType.

Response

200 — Contains the machines et al associated with a given environment.

  • DeploymentTargetSummaries object
  • EnvironmentSummaries array of object
    • DeploymentTargetSummaries object
    • Environment object
    • MachineEndpointSummaries object
    • MachineHealthStatusSummaries object
    • MachineIdsForCalamariUpgrade array of string
    • MachineIdsForTentacleUpgrade array of string
    • MachineTenantSummaries object
    • MachineTenantTagSummaries object
    • TentacleUpgradesRequired boolean
    • TotalDisabledMachines integer
    • TotalMachines integer
  • MachineEndpointSummaries object
  • MachineHealthStatusSummaries object
  • MachineIdsForCalamariUpgrade array of string
  • MachineTenantSummaries object
  • MachineTenantTagSummaries object
  • TentacleUpgradesRequired boolean
  • TotalDisabledMachines integer
  • TotalMachines integer

Example Response

JSON
{
  "DeploymentTargetSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "EnvironmentSummaries": [
    {
      "DeploymentTargetSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "Environment": {
        "Description": "string",
        "EnvironmentTags": [
          "string"
        ],
        "Id": "string",
        "Name": "string",
        "Slug": "string",
        "SpaceId": "string",
        "Type": "string"
      },
      "MachineEndpointSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "MachineHealthStatusSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "MachineIdsForCalamariUpgrade": [
        "string"
      ],
      "MachineIdsForTentacleUpgrade": [
        "string"
      ],
      "MachineTenantSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "MachineTenantTagSummaries": {
        "additionalProp1": 0,
        "additionalProp2": 0,
        "additionalProp3": 0
      },
      "TentacleUpgradesRequired": true,
      "TotalDisabledMachines": 0,
      "TotalMachines": 0
    }
  ],
  "MachineEndpointSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "MachineHealthStatusSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "MachineIdsForCalamariUpgrade": [
    "string"
  ],
  "MachineTenantSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "MachineTenantTagSummaries": {
    "additionalProp1": 0,
    "additionalProp2": 0,
    "additionalProp3": 0
  },
  "TentacleUpgradesRequired": true,
  "TotalDisabledMachines": 0,
  "TotalMachines": 0
}

Get a list of Environments

GET /api/{spaceId}/environments/v1

Also reachable at /api/environments/v1, /api/spaces/{spaceIdentifier}/environments/v1.

Lists all of the environments in the supplied Octopus Deploy Space. The results will be sorted by the SortOrder field on each environment.

Path Parameters

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

Query Parameters

  • ids array of string
    Environment Ids to filter results to only Environments with the given Ids.
  • name string
    Filters the returned environments by the specified name fragment. Left for backwards compatibility; prefer PartialName.
  • partialName string
    Filters the documents using the specified partialName fragment.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 10. Minimum 0.

Response

200 — The requested list of Environments

  • Environments object
    • Id string
      Gets or sets a unique identifier for this resource.
    • ItemType string
    • Items array of object
    • 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
{
  "Environments": {
    "Id": "string",
    "ItemType": "string",
    "Items": [
      {
        "AllowDynamicInfrastructure": true,
        "Description": "string",
        "EnvironmentTags": [
          "string"
        ],
        "ExtensionSettings": [
          {}
        ],
        "Id": "string",
        "LastModifiedBy": "string",
        "LastModifiedOn": "2020-01-01T00:00:00.000Z",
        "Links": {},
        "Name": "string",
        "Slug": "string",
        "SortOrder": 0,
        "SpaceId": "string",
        "UseGuidedFailure": true
      }
    ],
    "ItemsPerPage": 0,
    "LastModifiedBy": "string",
    "LastModifiedOn": "2020-01-01T00:00:00.000Z",
    "LastPageNumber": 0,
    "Links": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "NumberOfPages": 0,
    "TotalResults": 0
  }
}

List Static, Parent and Ephemeral Environments in the supplied Octopus Deploy Space. The results will be sorted by the SortOrder field on each environment (which is set to a MaxValue integer for Ephemeral Environments)

GET /api/{spaceId}/environments/v2

Also reachable at /api/spaces/{spaceIdentifier}/environments/v2.

Path Parameters

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

Query Parameters

  • ids array of string
    Filter environments using ids.
  • name string
    The exact name of an Environment to be matched.
  • partialName string
    Filters the documents using the specified partialName fragment.
  • skip integer (required)
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer (required)
    Number of items to skip. Defaults to zero. Minimum 0.
  • type array of string
    Filters the documents using the specified environment EnvironmentType.

Response

200 — Success

  • ItemType string
  • Items array of object
    • Description string
      Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
    • EnvironmentTags array of string
      List of tags assigned to this environment.
    • Id string
    • Name string
      Gets or sets the name of this environment. This should be short, preferably 5-20 characters. Minimum length 1.
    • Slug string
      Minimum length 1.
    • SpaceId string
    • Type string
  • ItemsPerPage integer
  • LastPageNumber integer
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "ItemType": "string",
  "Items": [
    {
      "Description": "string",
      "EnvironmentTags": [
        "string"
      ],
      "Id": "string",
      "Name": "string",
      "Slug": "string",
      "SpaceId": "string",
      "Type": "string"
    }
  ],
  "ItemsPerPage": 0,
  "LastPageNumber": 0,
  "NumberOfPages": 0,
  "TotalResults": 0
}

Modify an existing environment

PUT /api/{spaceId}/environments/{environmentId}

Also reachable at /api/environments/{environmentId}, /api/spaces/{spaceIdentifier}/environments/{environmentId}.

Path Parameters

  • environmentId string (required)
  • spaceId string (required)

Request Body

  • AllowDynamicInfrastructure boolean
  • Description string
  • EnvironmentId string (required)
  • EnvironmentTags array of string
  • ExtensionSettings array of object
    • ExtensionId string
    • Values string
  • Name string (required)
    Minimum length 1. Maximum length 50.
  • Slug string
  • SortOrder integer
  • SpaceId string (required)
  • UseGuidedFailure boolean

Response

200 — The environment after modifications have been applied.

  • AllowDynamicInfrastructure boolean
    If set to true, deployments to this environment will be allowed to contain steps that manage infrastructure. This relies on DeploymentActionResource being set to allow managing resource for a step.
  • Description string
    Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
  • EnvironmentTags array of string
    List of tags assigned to this environment.
  • ExtensionSettings array of object
    • ExtensionId string
    • Values 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.
  • Name string
    Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
  • Slug string
  • SortOrder integer
    Gets or sets a number indicating the priority of this environment in sort order. Environments with a lower sort order will appear in the UI before items with a higher sort order.
  • SpaceId string
  • UseGuidedFailure boolean
    If set to true, deployments will prompt for manual intervention (Fail/Retry/Ignore) when failures are encountered in activities that support it. May be overridden with the Octopus.UseGuidedFailure special variable.

Example Request

JSON
{
  "AllowDynamicInfrastructure": true,
  "Description": "string",
  "EnvironmentId": "string",
  "EnvironmentTags": [
    "string"
  ],
  "ExtensionSettings": [
    {
      "ExtensionId": "string",
      "Values": "string"
    }
  ],
  "Name": "string",
  "Slug": "string",
  "SortOrder": 0,
  "SpaceId": "string",
  "UseGuidedFailure": true
}

Example Response

JSON
{
  "AllowDynamicInfrastructure": true,
  "Description": "string",
  "EnvironmentTags": [
    "string"
  ],
  "ExtensionSettings": [
    {
      "ExtensionId": "string",
      "Values": "string"
    }
  ],
  "Id": "string",
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "Slug": "string",
  "SortOrder": 0,
  "SpaceId": "string",
  "UseGuidedFailure": true
}

Get the environment custom settings metadata from the extensions

GET /api/{spaceId}/environments/{environmentId}/metadata

Also reachable at /api/environments/{environmentId}/metadata, /api/spaces/{spaceIdentifier}/environments/{environmentId}/metadata.

Path Parameters

  • environmentId string (required)
    The Id of the environment for which metadata is to be retrieved.
  • spaceId string (required)
    The Id of the space containing the environment.

Response

200 — The requested Environment Metadata

  • ExtensionId string
  • Metadata object
    • Description string
    • Types array of object

Example Response

JSON
[
  {
    "ExtensionId": "string",
    "Metadata": {
      "Description": "string",
      "Types": [
        {}
      ]
    }
  }
]

List all the variable set names (projects and library variable sets) that have variables that are scoped to only the given environment

GET /api/{spaceId}/environments/{environmentId}/singlyScopedVariableDetails

Also reachable at /api/environments/{environmentId}/singlyScopedVariableDetails, /api/spaces/{spaceIdentifier}/environments/{environmentId}/singlyScopedVariableDetails.

Path Parameters

  • environmentId string (required)
  • spaceId string (required)

Response

200 — The names of LibraryVariableSets and VariableSets which contain one or more variables scoped to the requested environment. Along with boolean indication to show that there are unviewable/editable projects/libraries which also contain scoped variables.

  • HasUnauthorizedLibraryVariableSetVariables boolean
  • HasUnauthorizedProjectVariables boolean
  • VariableMap object

Example Response

JSON
{
  "HasUnauthorizedLibraryVariableSetVariables": true,
  "HasUnauthorizedProjectVariables": true,
  "VariableMap": {
    "additionalProp1": {
      "additionalProp1": 0,
      "additionalProp2": 0,
      "additionalProp3": 0
    },
    "additionalProp2": {
      "additionalProp1": 0,
      "additionalProp2": 0,
      "additionalProp3": 0
    },
    "additionalProp3": {
      "additionalProp1": 0,
      "additionalProp2": 0,
      "additionalProp3": 0
    }
  }
}

Get a specific Deployment Environment

GET /api/{spaceId}/environments/{id}

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

Path Parameters

  • id string (required)
    ID of the Environment to load.
  • spaceId string (required)

Response

200 — The requested Deployment Environment

  • AllowDynamicInfrastructure boolean
    If set to true, deployments to this environment will be allowed to contain steps that manage infrastructure. This relies on DeploymentActionResource being set to allow managing resource for a step.
  • Description string
    Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
  • EnvironmentTags array of string
    List of tags assigned to this environment.
  • ExtensionSettings array of object
    • ExtensionId string
    • Values 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.
  • Name string
    Gets or sets the name of this environment. This should be short, preferably 5-20 characters.
  • Slug string
  • SortOrder integer
    Gets or sets a number indicating the priority of this environment in sort order. Environments with a lower sort order will appear in the UI before items with a higher sort order.
  • SpaceId string
  • UseGuidedFailure boolean
    If set to true, deployments will prompt for manual intervention (Fail/Retry/Ignore) when failures are encountered in activities that support it. May be overridden with the Octopus.UseGuidedFailure special variable.

Example Response

JSON
{
  "AllowDynamicInfrastructure": true,
  "Description": "string",
  "EnvironmentTags": [
    "string"
  ],
  "ExtensionSettings": [
    {
      "ExtensionId": "string",
      "Values": "string"
    }
  ],
  "Id": "string",
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string",
  "Slug": "string",
  "SortOrder": 0,
  "SpaceId": "string",
  "UseGuidedFailure": true
}

Delete an existing Environment

DELETE /api/{spaceId}/environments/{id}

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

Path Parameters

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

Response

200 — Success

Return the list of machines in an environment that matches the filters requested by the user

GET /api/{spaceId}/environments/{id}/machines

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

Path Parameters

  • id string (required)
    ID of the Environment.
  • spaceId string (required)
    ID of the space.

Query Parameters

  • commStyles array of string
  • deploymentTargetTypes array of string
  • healthStatuses array of string
  • isDisabled boolean
  • partialName string
  • roles array of string
  • shellNames array of string
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items per page. Defaults to 20. Minimum 0.
  • targetTags array of string
  • tenantIds array of string
  • tenantTags array of string

Response

200 — The lists of all machines that belong to the given environment, and matches any specified filters.

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • Architecture string
    • Endpoint object
    • EnvironmentIds array of string
    • HasLatestCalamari boolean
    • HealthStatus enum
      Allowed values: Healthy, Unavailable, Unknown, HasWarnings, Unhealthy.
    • Id string
      Gets or sets a unique identifier for this resource.
    • IsDisabled boolean
    • IsInProcess boolean
    • 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.
    • MachinePolicyId string
    • Name string
    • OperatingSystem string
    • OperatingSystemVersion string
    • Roles array of string
    • ShellName string
    • ShellVersion string
    • SkipInitialHealthCheck boolean
    • Slug string
    • SpaceId string
    • StatusSummary string
    • TenantIds array of string
    • TenantTags array of string
    • TenantedDeploymentParticipation enum
      Allowed values: Untenanted, TenantedOrUntenanted, Tenanted.
    • Thumbprint string
    • Uri string
  • 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": [
    {
      "Architecture": "string",
      "Endpoint": {
        "CommunicationStyle": "None",
        "Id": "string",
        "LastModifiedBy": "string",
        "LastModifiedOn": "2020-01-01T00:00:00.000Z",
        "Links": {}
      },
      "EnvironmentIds": [
        "string"
      ],
      "HasLatestCalamari": true,
      "HealthStatus": "Healthy",
      "Id": "string",
      "IsDisabled": true,
      "IsInProcess": true,
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "MachinePolicyId": "string",
      "Name": "string",
      "OperatingSystem": "string",
      "OperatingSystemVersion": "string",
      "Roles": [
        "string"
      ],
      "ShellName": "string",
      "ShellVersion": "string",
      "SkipInitialHealthCheck": true,
      "Slug": "string",
      "SpaceId": "string",
      "StatusSummary": "string",
      "TenantIds": [
        "string"
      ],
      "TenantTags": [
        "string"
      ],
      "TenantedDeploymentParticipation": "Untenanted",
      "Thumbprint": "string",
      "Uri": "string"
    }
  ],
  "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 a specific Static, Parent or Ephemeral Environment by ID

GET /api/{spaceId}/environments/{id}/v2

Also reachable at /api/spaces/{spaceIdentifier}/environments/{id}/v2.

Path Parameters

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

Response

200 — The requested Static, Parent or Ephemeral Environment

  • Description string
    Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
  • EnvironmentTags array of string
    List of tags assigned to this environment.
  • Id string
  • Name string
    Gets or sets the name of this environment. This should be short, preferably 5-20 characters. Minimum length 1.
  • Slug string
    Minimum length 1.
  • SpaceId string
  • Type string

Example Response

JSON
{
  "Description": "string",
  "EnvironmentTags": [
    "string"
  ],
  "Id": "string",
  "Name": "string",
  "Slug": "string",
  "SpaceId": "string",
  "Type": "string"
}

List environments available for a project

GET /api/{spaceId}/projects/{projectId}/environments

Also reachable at /api/spaces/{spaceIdentifier}/projects/{projectId}/environments.

Path Parameters

  • projectId string (required)
    The ID of the project.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Query Parameters

  • partialName string
    Filters the environments by partial name fragment.
  • skip integer (required)
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer (required)
    Number of items to take. Defaults to 30. Minimum 0.
  • type array of string
    Filters the environments by EnvironmentType.

Response

200 — Success

  • ItemType string
  • Items array of object
    • Description string
      Gets or sets a short description of this environment that can be used to explain the purpose of the environment to other users. This field may contain markdown.
    • EnvironmentTags array of string
      List of tags assigned to this environment.
    • Id string
    • Name string
      Gets or sets the name of this environment. This should be short, preferably 5-20 characters. Minimum length 1.
    • Slug string
      Minimum length 1.
    • SpaceId string
    • Type string
  • ItemsPerPage integer
  • LastPageNumber integer
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "ItemType": "string",
  "Items": [
    {
      "Description": "string",
      "EnvironmentTags": [
        "string"
      ],
      "Id": "string",
      "Name": "string",
      "Slug": "string",
      "SpaceId": "string",
      "Type": "string"
    }
  ],
  "ItemsPerPage": 0,
  "LastPageNumber": 0,
  "NumberOfPages": 0,
  "TotalResults": 0
}