fbpx
POSThttps://api.spotinst.io/functions/environment?accountId={ACCOUNT_ID}

Create a new environment.

URL Parameters

Parameter Type Description
ACCOUNT_ID String

The account ID.

Example: act-12345
Request

Headers
{
	"Content-Type": "application/json",
	"Authorization": "Bearer ${TOKEN}"
}
Body
Copied!
Downloaded!
{
  "environment": {
    "name": "testing",
    "applicationId": "app-5470a9fb",
    "preferences": {
      "locations": [
        "us-east",
        "eu-west"
      ],
      "providers": [
        "azure"
      ]
    }
  }
}

Body Attributes


  • environment.name * String
    The name of the Environment. Must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.
  • environment.applicationId * String
    The ID of the corresponding application.
  • environment.preferences.locations * String
    A list of the request locations on which the function will be present.
  • environment.preferences.providers * String
    A list of the request cloud providers on which the function will be present.
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "env-12345",
      "name": "testing",
      "applicationId": "app-5470a9fb",
      "preferences": {
        "locations": [
          "us-east",
          "eu-west"
        ],
        "providers": [
          "azure"
        ]
      }
    }
  ]
}