Infrastructure Profiles


Infrastructure Profiles represent an Infrastructure configuration that should be provisioned for an Event. This is used to communicate to the Origin Scaling component, and once everything is setup, the Event will have it’s own ProvisionInfo to store the information.

See the Provisioning API for requesting Infrastructure.


Infrastructure Profile Object

A Infrastructure Profile object or response will contain the following:

{
  "id": "5bcc401d-3423-4509-b672-029379dd7582",
  "name": "Example Infrastructure",
  "referenceId": "infra01",
  "configurationJson": "{...}"
}

ConfigurationJson

The ConfigurationJson is split into two parts, the request and the workflow. The request is what about what will be provisioned. The workflow object defines when actions will occur. Currently this is only Termination.

Example:

{
  "request": {
    "infrastructureKey": null,
    "callbackUrls": [],
    "settings": {
      "TF_VAR_docker_image_name": "vualto/usp_api",
      "TF_VAR_docker_image_version": "a3.8-1.10.12-v7"
    },
    "options": {
      "deploymentType": "Template",
      "allowUpdates": null,
      "isolationMode": null
    },
    "resources": [
      {
        "name": "USP-SS",
        "type": "origin",
        "region": "eu-west-1",
        "role": "primary"
      }
    ]
  },
  "workflow": {
    "termination": [
      {
        "states": [
          "INSTANT_VOD"
        ],
        "type": "TYPE",
        "select": [ "origin" ]
      }
    ]
  }
}

Required: resources, workflow

Permitted values for deploymentType are template, static

Permitted values for isolationMode are byInfrastructure or byEvent

ConfigurationJson : Resource

Within the ConfigurationJson, a resource can specify all of the properties shown below:

{
  "name": "example-name",
  "type": "",
  "vendor": "",
  "version": "",
  "subnet": "",
  "securityGroup": "",
  "ipAddress": "",
  "internalIpAddress": "",
  "dns": "",
  "internalDns": "",
  "fullName": "",
  "region": "",
  "size": "",
  "role": "",
  "diskType": "",
  "diskSize": "",
  "image": "",
  "tags": "",
  "settings": {
    "key": "value"
  }
}

Required: name, type

Permitted values for type are origin, encoder, router, source, convertor, unspecified

Recommended: vendor, settings

Additional settings can be returned from the provisioning service and will be available on the Event’s ProvisionInfo.


Supported Actions

POST /infrastructureprofile/

Add or Update an Infrastructure Profile.

Request Body:

{
  "id": "5bcc401d-3423-4509-b672-029379dd7582",
  "name": "Example Infrastructure",
  "referenceId": "infra01",
  "configurationJson": "{...}"
}

Note: id is required when updating a specific profile, but optional when adding.

Response: 200 OK and an Infrastructure Profile

or

400 Bad Request if the providied ReferenceId is already in use on another profile.


GET /infrastructureprofile/

Get all Infrastructure Profiles.

Response: 200 OK and an array of Infrastructure Profiles


GET /infrastructureprofile/{id}

Get an Infrastructure Profile by Id.

Response: 200 OK and an Infrastructure Profile


GET /infrastructureprofile/reference/

Get an Infrastructure Profile by Reference Id.

Query Parameters:

Name Type Required Description
referenceId string Yes The Reference Id to search for.

Response: 200 OK and an Infrastructure Profile.


GET /infrastructureprofile/resources/{id}

Get the resources defined by the given Infrastructure Profile.

Response: 200 OK and a list of Resources (see the configuration object above).


DEL /infrastructureprofile/{id}

Delete an Infrastructure Profile by Id.

Response: 200 OK or 400 Bad Request if the Id does not exist.