PUThttps://api.spotinst.io/ocean/aws/ecs/cluster/{OCEAN_CLUSTER_ID}?accountId={ACCOUNT_ID}

All Ocean parameters are updatable, excluding the Region and Id.

This API supports partial updates, so specific fields can be updated separately.

URL Parameters

Parameter Type Description
OCEAN_CLUSTER_ID * String

The Ocean cluster to update.

ACCOUNT_ID * String

Your Spotinst accountId associated with your token.

Request - Example - update cluster's name

Headers
Copied!
Downloaded!
{
  "Authorization": "Bearer ${token}",
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "cluster": {
    "name": "newName"
   }
}
Response - 200

Body
Copied!
Downloaded!
{
  "request": {
    "id": "6b9f7c91-140e-4c8b-9b40-edde4fac243f",
    "url": "/ocean/aws/ecs/cluster?accountId=act-7461862f",
    "method": "POST",
    "timestamp": "2019-06-18T06:28:08.637Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:ocean:aws:ecs",
    "items": [
      {
        "id": "o-bd3ed435",
        "name": "myOceanController",
        "clusterName": "oceanEcs-FirstOfHisName",
        "autoScaler": {
          "isEnabled": true,
          "cooldown": 180,
          "down": {
            "evaluationPeriods": 3,
            "maxScaleDownPercentage": 60
          },
          "headroom": {
            "cpuPerUnit": 2000,
            "memoryPerUnit": 0,
            "numOfUnits": 4
          },
          "resourceLimits": {
            "maxVCpu": 2,
            "maxMemoryGib": 1
          },
          "isAutoConfig": false
          "autoHeadroomPercentage" : 20
        },
        "region": "us-west-2",
        "capacity": {
          "minimum": 0,
          "maximum": 0,
          "target": 0
        },
        "strategy": {
          "utilizeReservedInstances": true,
          "fallbackToOd": true,
          "drainingTimeout": 60
        },
        "scheduling": {
          "tasks": {
            "isEnabled": true,
            "cronExpression": "0 1 * * *",
            "taskType": "clusterRoll"
          }
        },
        "compute": {
          "subnetIds": [
            "subnet-79da021e"
          ],
          "instanceTypes": {
            "whitelist": [
              "c4.2xlarge",
              "c4.xlarge",
              "c4.4xlarge",
              "c4.8xlarge"
            ]
          },
          "launchSpecification": {
            "securityGroupIds": [
              "sg-c3d914b0"
            ],
            "iamInstanceProfile": {
              "arn": "orfrom"
            },
            "keyPair": "spotinst-labs-oregon",
            "tags": [
              {
                "tagKey": "creator",
                "tagValue": "orfrom"
              },
              {
                "tagKey": "k8s.io/role/node",
                "tagValue": "1"
              }
            ],
            "loadBalancers": [
              {
                "arn": "arn:aws:elasticloadbalancing:us-west-2:922761411234:targetgroup",
                "type": "TARGET_GROUP"
              },
              {
                "name": "MyClassicLB",
                "type": "CLASSIC"
              }
            ],
            "associatePublicIpAddress": true,
            "monitoring": false,
            "ebsOptimized": false,
            "userData": ""
          },
          "optimizeImages": {
            "shouldOptimizeEcsAmi": true,
            "performAt": "always",
            "timeWindows": [
              "Sun:02:00-Sun:12:00",
              "Wed:01:01-Fri:02:03"
            ]
          }
        },
        "createdAt": "2019-06-18T06:28:08.488Z",
        "updatedAt": "2019-06-18T06:28:08.488Z"
      }
    ],
    "count": 1
  }
}