POSThttps://api.spotinst.io/ocean/aws/ecs/launchSpec?accountId={ACCOUNT_ID}

URL Parameters

Parameter Type Description
ACCOUNT_ID * String

The Spotinst accountId associated with your token.

Example: act-123abc
Request

Headers
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "launchSpec": {
    "oceanId": "o-89693f32",
    "imageId": "img2",
    "name": "mySpecLauncher",
    "securityGroupIds": [
      "sg1",
      "sg3"
    ],
    "userData": "dXNlcmJhc2g2NGVuY29kZWQ=",
    "iamInstanceProfile": {
      "arn": "arn:aws:iam::842422002533:instance-profile"
    },
    "attributes": [
      {
        "key": "key1",
        "value": "v1"
      },
      {
        "key": "key2",
        "value": "v2"
      }
    ],
    "autoScale": {
      "headrooms": [
        {
          "cpuPerUnit": 1024,
          "memoryPerUnit": 512,
          "numOfUnits": 2
        }
      ]
    },
    "tags": [
      {
        "tagKey": "Creator",
        "tagValue": "John Doe"
      },
      {
        "tagKey": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup",
        "tagValue": "nodes"
      },
      {
        "tagKey": "k8s.io/role/node",
        "tagValue": "1"
      },
      {
        "tagKey": "KubernetesCluster",
        "tagValue": "from2.ek8s.com"
      },
      {
        "tagKey": "kops.k8s.io/instancegroup",
        "tagValue": "nodes"
      }
    ]
  }
}

Body Attributes


Attribute Type Description
launchSpec * Object

launchSpec.oceanId * String

The Ocean cluster ID. required for launchSpec create.

launchSpec.name * String

Set launch specifications name

launchSpec.imageId String

Set image ID. Can be null

launchSpec.securityGroupIds Array<String>

Set security groups. Each element in array should be security group ID

launchSpec.userData Base64

Base64-encoded MIME user data to make available to the instances.

launchSpec.iamInstanceProfile Object

The instance profile iamRole object

launchSpec.iamInstanceProfile.arn String

The iamRole arn. If set - do not set launchSpec.iamInstanceProfile.name

launchSpec.iamInstanceProfile.name String

The iamRole name. If set - do not set launchSpec.iamInstanceProfile.arn

launchSpec.attributes Array<Object>

Add attributes to cluster

launchSpec.attributes.key * String

Set attribute's key. Required on launchSpec.attributes object

launchSpec.attributes.value * String

Set attribute's name. Required on launchSpec.attributes object

launchSpec.autoScale Object

launchSpec.autoScale.headrooms Array<Object>

Set custom headroom per launch spec. provide list of launchSpec.autoscale.headrooms object

launchSpec.autoScale.headrooms.cpuPerUnit Integer

configure the number of CPUs to allocate the headroom. CPUs are denoted in millicores, where 1000 millicores = 1 vCPU

Example: 1024
launchSpec.autoScale.headrooms.memoryPerUnit Integer

Configure the amount of memory (MiB) to allocate the headroom.

Example: 512
launchSpec.autoScale.headrooms.numOfUnits Integer

The number of units to retain as headroom, where each unit has the defined headroom CPU and memory.

Example: 2
launchSpec.tags Array<Object>

List of kay-value pairs of tags

launchSpec.tags.tagKey String

Set the tag key

launchSpec.tags.tagValue String

Set the tag value

Response - 200

Body
Copied!
Downloaded!
{
  "request": {
    "id": "c77fd005-04b3-4e8b-93a9-bb48e9cf44b9",
    "url": "/ocean/aws/ecs/launchSpec?spotinstAccountId=act-7461862f",
    "method": "POST",
    "timestamp": "2019-06-15T10:48:38.242Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:ocean:aws:ecs",
    "items": [
      {
        "id": "ols-9bd1be93",
        "oceanId": "o-89693f32",
        "name": "mySpecLauncher",
        "imageId": "img2",
        "userData": "dXNlcmJhc2g2NGVuY29kZWQ=",
        "securityGroupIds": [
          "sg1",
          "sg3"
        ],
        "iamInstanceProfile": {
          "arn": "arn:aws:iam::842422002533:instance-profile"
        },
        "attributes": [
          {
            "key": "key1",
            "value": "v1"
          },
          {
            "key": "key2",
            "value": "v2"
          }
        ],
        "autoscale": {
          "headrooms": [
            {
              "cpuPerUnit": 1024,
              "memoryPerUnit": 512,
              "numOfUnits": 2
            }
          ]
        },
        "tags": [
          {
            "tagKey": "Creator",
            "tagValue": "John Doe"
          },
          {
            "tagKey": "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup",
            "tagValue": "nodes"
          },
          {
            "tagKey": "k8s.io/role/node",
            "tagValue": "1"
          },
          {
            "tagKey": "KubernetesCluster",
            "tagValue": "from2.ek8s.com"
          },
          {
            "tagKey": "kops.k8s.io/instancegroup",
            "tagValue": "nodes"
          }
        ],
        "createdAt": "2019-06-15T10:48:38.065Z",
        "updatedAt": "2019-06-15T10:48:38.065Z"
      }
    ],
    "count": 1
  }
}