fbpx
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"
			}
		]
	}
}

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.key * String

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

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"
                    }
                ],
                "createdAt": "2019-06-15T10:48:38.065Z",
                "updatedAt": "2019-06-15T10:48:38.065Z"
            }
        ],
        "count": 1
    }
}