POSThttps://api.spotinst.io/ocean/aws/k8s/launchspec/autoScalingGroup/import?accountId={ACCOUNT_ID}&oceanId={oceanId}&autoScalingGroupName={autoScalingGroupName}

Create an Ocean cluster launch spec configuration according to an AWS ASG configuration.

URL Parameters

Parameter Type Description
autoScalingGroupName * String

The ASG name

oceanId * String

Ocean cluster id. in the gives cluster the launch spec will be created

Example: o-123sd22
ACCOUNT_ID * String

The Spotinst accountId associated with your token.

Example: act-123abc
Request

Headers
Copied!
Downloaded!
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "launchSpec": {
    "name": "asg_test",
    "labels": [
      {
        "key": "test_key_1",
        "value": "test_value_1"
      },
      {
        "key": "test_key_2",
        "value": "test_value_2"
      }
    ],
    "taints": [
      {
        "key": "test_key_1",
        "value": "test_value_1",
        "effect": "NoSchedule"
      },
      {
        "key": "test_key_2",
        "value": "test_value_2",
        "effect": "NoSchedule"
      }
    ]
  }
}
Attribute Type Description
launchSpec Object

launchSpec.name String

Set launch spec name

launchSpec.labels Array<Object>

Add labels to cluster

launchSpec.labels.key String

Set label key

launchSpec.labels.value String

Set label value

launchSpec.taints Array<Object>

Add taints to cluster

launchSpec.taints.key String

Set taints key

launchSpec.taints.value String

Set taints value

launchSpec.taints.effect String

Set taints effect

Example: NoSchedule
Response - 200

Body
Copied!
Downloaded!
{
  "launchSpec": {
    "labels": [
      {
        "key": "test_key_1",
        "value": "test_value_1"
      },
      {
        "key": "test_key_2",
        "value": "test_value_2"
      }
    ],
    "taints": [
      {
        "key": "test_key_1",
        "value": "test_value_1",
        "effect": "NoSchedule"
      },
      {
        "key": "test_key_2",
        "value": "test_value_2",
        "effect": "NoSchedule"
      }
    ],
    "oceanId": "o-123",
    "imageId": "ami-ID",
    "userData": "dsa89d7uosduxq98sau9s8aux9s8aux09q0qu09axsuix0s9qas09xz",
    "iamInstanceProfile": {
      "arn": "arn:aws:iam::123456781234:instance-profile/EKS-nodes-test-NodeInstanceProfile-ABCDEFGH123",
      "name": "EKS-nodes-test"
    },
    "securityGroupIds": [
      "sg-0ded3a2980208c30c",
      "sg-0ded3a2980208c30d"
    ],
    "rootVolumeSize": 8,
    "subnetIds": [
      "subnet-123",
      "subnet-456"
    ],
    "autoScale": {
      "headrooms": [
        {
          "cpuPerUnit": 1000,
          "memoryPerUnit": 2048,
          "gpuPerUnit": 0,
          "numOfUnits": 3
        }
      ]
    }
  }
}