PROVISIONING

The Provision API allows you to query resources and change the state of them for a given Event. You must have already setup the Event to have a valid Infrastructure Profile.


Provisioning States

The following states are used to represent the state of infrastructure in the system.

  • 0 = SCHEDULED
  • 1 = PROVISIONING
  • 2 = PROVISIONING_FAILED
  • 3 = PROVISIONED
  • 4 = PROVISIONED_PARTIAL
  • 5 = TERMINATING
  • 6 = TERMINATING_FAILED
  • 7 = TERMINATED

Provision Info Object

{
  "id": "d7314df6-72b0-4cf3-9702-7bc0adc7658b",
  "infrastructureKey": "vualto-development",
  "provisionedAt": "2020-05-01T09:59:46Z",
  "terminatedAt": null,
  "state": 4,
  "stateString": "PROVISIONED_PARTIAL",
  "resourcesJson": "{...}"
}

Note: resourcesJson is only included when the ProvisionInfo is requested specifically, not when the ProvisionInfo is included within another object (e.g. the Event object).

Provision Resources Object

{
  "eventId": "d7314df6-72b0-4cf3-9702-7bc0adc7658b",
  "state": 4,
  "stateString": "PROVISIONED_PARTIAL",
  "infrastructureKey": "client",
  "resources": [
    {
      "name": "example",
      "type": "origin",
      "ipAddress": "",
      "region": "",
      "etc": "..."
    }
  ]
}

Note: the objects defined in resources can contain various keys depending on what is being provisioned. See Infrastructure Profiles for what can be configured.

Provision Comparison Object

{
  "channelId": "e17eea65-d79b-4185-8aef-d7af185b8c7d",
  "infrastructureProfileId": "e121a6a0-394b-40ad-8a20-e57c6a104ceb",
  "isValid": false,
  "isOptimal": false,
  "undefinedChannelResources": [ "resource1", "resource2" ],
  "unusedInfrastructureResources": [ "resource3" ]
}

Supported Actions

POST /provision/{eventId}

Provision resources for the given Event by Id.

This will set the Provision State to PROVISIONING, which will be automatically updated when the Infrastructure has been provisioned.

Query Parameters:

Name Type Required Description
allowUpdates bool No Allows overiding of the AllowUpdates within the provision request.

Response: 200 OK


GET /provision/{eventId}

Get the ProvisionInfo by Event Id.

Response: 200 OK and JSON containing the Provision Info object.


GET /provision/resources/{eventId}

Get the resources by Event Id.

If the infrastructure has not been provisioned, these resources come from the InfrastructureProfile, otherwise come from the Scaling API.

Response: 200 OK and JSON containing the Provision Resources object.


GET /provision/compare/

Compare a given Channel and Infrastructure Profile for compatibility.

Query Parameters:

Name Type Required Description
channelId Guid Yes The Id of the Channel to compare.
infrastructureProfileId Guid Yes The Id of the Infrastructure Profile to compare.

Response: 200 OK and JSON containing a provision comparison object.


GET /provision/compare/{channelId}

Compare a given Channel with all Infrastructure Profiles.

Query Parameters:

Name Type Required Description
onlyValid bool No Whether to include only valid pairings.
onlyOptimal bool No Whether to include only optimal pairings.

Response: 200 OK and JSON containing an array of Provision Comparison objects.


DEL /provision/{eventId}

Terminate resources by Event Id.

If there is existing infrastructure then this will set the Provision State to TERMINATING, and will be automatically updated when the Infrastructure is terminated.

If there isn’t any infrastructure, then this will transition straight to TERMINATED.

Response: 200 OK


DEL /provision/reset/{eventId}

Reset the Provision State by Event Id.

This will set the Provision State to SCHEDULED, and attempt to terminate infrastructure if it exists.

You cannot reset an Event which is currently PROVISIONING or TERMINATING.

Response: 200 OK