fbpx
PUThttps://api.spotinst.io/ocean/gcp/k8s/launchSpec/{OCEAN_LAUNCH_SPEC_ID}?accountId={ACCOUNT_ID}

URL Parameters

Parameter Type Description
OCEAN_LAUNCH_SPEC_ID * String

Ocean cluster launchSpec ID.

ACCOUNT_ID * String

The Spotinst accountId associated with your token.

Example: act-123abc
Request - Example - update cluster's labels

Headers
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{	
	"launchSpec": {
		"labels": [
			{
				"key":"key3",
				"value":"v3"},
			{
				"key":"key4",
				"value":"v4"
			}
		]
	}
}

Body Attributes


Attribute Type Description
launchSpec * Object

launchSpec.sourceImage String

Update image URL

launchSpec.rootVolumeSize Integer

Set root volume size (in GB)

launchSpec.metadata Array<Object>

Update metadata on cluster

launchSpec.metadata.key String

Set metadata's key. Required on launchSpec.metadata

launchSpec.metadata.value String

Set metadata's name. Required on launchSpec.metadata

launchSpec.taints Array<Object>

Update taints on cluster

launchSpec.taints.key String

taint's key

launchSpec.taints.value String

taint's value

launchSpec.taints.effect String

taint's effect

Example: NoExecute
launchSpec.labels Array<Object>

Update labels on cluster

launchSpec.labels.key String

Set label key

launchSpec.labels.value String

Set label value

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: 2000
launchSpec.autoscale.headrooms.memoryPerUnit Integer

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

Example: 2048
launchSpec.autoscale.headrooms.gpuPerUnit Integer

How much GPU allocate for headroom unit

Example: 1
launchSpec.autoscale.headrooms.numOfUnits Integer

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

Example: 3
Response - 200

Body
Copied!
Downloaded!
{
    "request": {
        "id": "c77fd005-04b3-4e8b-93a9-bb48e9cf44b9",
        "url": "/ocean/gcp/k8s/launchSpec/ac12a686?spotinstAccountId=act-7461862f",
        "method": "PUT",
        "timestamp": "2019-06-15T10:48:38.242Z"
    },
    "response": {
        "status": {
            "code": 200,
            "message": "OK"
        },
        "kind": "spotinst:ocean:gcp:k8s",
        "items": [
			{
		      "id": "ols-ac12a686",
              "oceanId" : "o-1fff54ed",
		      "sourceImage":"https://www.googleapis.com/compute/v1/projects/gke-node-images/global/images/container-v1-3-v20160517",
			  "rootVolumeSize": 8,
              "serviceAccount": "default",
		      "metadata": [
                  {
                    "key": "key1",
                    "value": "value1"
                  },
                  {
                    "key": "value1",
                    "value": "value2"
                  }
                ],
              "taints": [
                {
                  "key":"test",
                  "value":"test",
                  "effect":"NoExecute"
                }
              ],
              "labels":[
                {
                  "key":"test",
                  "value":"test"
                }
              ],
              "autoscale": {
		      	"headrooms": [
	    			{
    	    		  "cpuPerUnit": 1000,
	        		  "memoryPerUnit": 2048,
			          "gpuPerUnit": 0,
    			      "numOfUnits": 3
        			}]
		      	},
              "createdAt": "2019-06-15T10:48:38.065Z",
              "updatedAt": "2019-06-15T10:48:38.065Z"
            }
        ],
        "count": 1
    }
}