fbpx
POSThttps://api.spotinst.io/gcp/gce/group?accountId={ACCOUNT_ID}

Create a GCP Elastigroup

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc
Request

Headers
{  
   "Content-Type": "application/json",
   "Authorization": "Bearer ${token}" 
}
Body
Copied!
Downloaded!
{
  "group": {
    "name": "Spotinst GCP Group",
    "capacity": {
      "minimum": 0,
      "maximum": 0,
      "target": 0
    },
    "strategy": {
      "preemptiblePercentage": 50
    },
    "scaling": {
      "up": [
        {
          "policyName": "scale_up_1",
          "metricName": "instance/disk/read_ops_count",
          "namespace": "compute",
          "statistic": "mean",
          "threshold": 10000,
          "action": {
            "type": "adjustment",
            "adjustment": 1
          },
          "dimensions": [
            {
              "name": "storage_type",
              "value": "pd-ssd"
            }
          ],
          "period": 300,
          "evaluationPeriods": 1,
          "cooldown": 300
        }
      ]
    },
    "compute": {
      "launchSpecification": {
        "serviceAccount": "example@myProject.iam.gserviceaccount.com",
        "tags": [
          "http",
          "https"
        ],
        "backendServices": [
          "spotinst-elb-backend-service"
        ],
        "disks": [
          {
            "deviceName": "device",
            "initializeParams": {
              "diskSizeGb": 10,
              "diskType": "pd-standard",
              "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20151104"
            },
            "mode": "READ_WRITE",
            "type": "PERSISTENT",
            "autoDelete": true,
            "boot": true,
            "interface": "SCSI"
          }
        ],
        "networkInterfaces": [
          {
            "network": "spot-network"
          }
        ],
        "startupScript": null
      },
      "instanceTypes": {
        "ondemand": "n1-standard-1",
        "preemptible": [
          "n1-standard-1",
          "n1-standard-2",
          "n1-standard-4"
        ]
      },
      "availabilityZones": [
        "asia-east1-c",
        "europe-west1-c",
        "us-central1-a"
      ]
    },
    "description": "Spotinst GCP Group"
  }
}

Body Attributes


  • name * String
    Elastigroup Name
  • description String
    Elastigroup description
  • strategy.preemptiblePercentage * Integer
    The percentage of Preemptible VMs that would spin up from the “capcity.target” (range: 0 - 100)
  • strategy.onDemandCount * String
    Number of regular VMs to launch in the group. The rest will be Preemptible VMs. When this parameter is specified, the preemptiblePercentage parameter is being ignored.
  • strategy.drainingTimeout String
    The time (in seconds) the instance is allowed to run after detached from the group. This is to allow the instance time to drain all current TCP connections before terminating it
  • capacity.target * Integer
    The number of VMs to launch
  • capacity.minimum * Integer
    The lower limit number of VMs that the group can scale down to
  • capacity.maximum * Integer
    The upper limit number of VMs that the group can scale up to
  • compute.instanceTypes.ondemand * String
    The regular VM instance type. Available machine types
  • compute.instanceTypes.preemptible * Array<String>
    The Preemptible VMs instance types. Available machine types
  • compute.availabilityZones * Array<String>
    Availability Zones for the group
  • scaling.up.policyName String
    Scaling policy name
  • scaling.up.metricName String
    The name of the metric. Default value is instance/cpu/utilization
  • scaling.up.statistic String
    The metric aggregator to return. Valid values: mean, sum, min, max
  • scaling.up.threshold Double
    The value against which the specified statistic is compared
  • scaling.up.action Object
    The action to take when scale up is needed.
  • scaling.up.action.type String
    The type of the action to take when scale up is needed. Valid value: adjustment
  • scaling.up.action.adjustment String
    The number associated with the specified adjustment type. Required if using adjustment as action type.
  • scaling.up.namespace String
    The namespace for the associated metric. Valid value: compute
  • scaling.up.dimensions Array<Object>
    The short labels names for filtering associated metric. For example, the metric instance/disk/read_ops_count is associated with the label compute.googleapis.com/storage_type, the short label name is storage_type
  • scaling.up.period Integer
    The period in seconds over which the statistic is applied
  • scaling.up.evaluationPeriods Integer
    The number of periods over which data is compared to the specified threshold
  • scaling.up.cooldown Integer
    The amount of time (in seconds) after a scaling activity completes before any further trigger-related scaling activities can start
  • scaling.down.policyName String
    The policy name
  • scaling.down.metricName String
    The name of the metric. Default value is instance/cpu/utilization.
  • scaling.down.statistic String
    The metric aggregator to return. Valid values: mean, sum, min, max
  • scaling.down.threshold String
    The value against which the specified statistic is compared
  • scaling.down.action String
    The action to take when scale up is needed
  • scaling.down.action.type String
    The type of the action to take when scale up is needed. Valid value: adjustment
  • scaling.down.action.adjustment String
    The number associated with the specified adjustment type. Required if using adjustment as action type
  • scaling.down.namespace String
    The namespace for the associated metric. Valid Value: compute
  • scaling.down.dimensions Array<Object>
    he short labels names for filtering associated metric. For example, the metric instance/disk/read_ops_count is associated with the label compute.googleapis.com/storage_type, the short label name is storage_type
  • scaling.down.period String
    The period in seconds over which the statistic is applied
  • scaling.down.evaluationPeriods Integer
    The number of periods over which data is compared to the specified threshold.
  • scaling.down.cooldown Integer
    The amount of time (in seconds) after a scaling activity completes before any further trigger-related scaling activities can start.
  • compute.launchSpecification.backendServices Array<String>
    Backend Service resource list that will serve traffic for load balancing
  • compute.launchSpecification.startupScript String
    Create and run your own startup scripts on your virtual machines to perform automated tasks every time your instance boots up.
  • compute.launchSpecification.serviceAccount String
    The email of the service account in which the group instances will be launched with
  • compute.launchSpecification.disks String
    Array of disks associated with this instance. Persistent disks must be created before you can assign them
  • compute.launchSpecification.disks.autoDelete Boolean
    Specifies whether the disk will be auto-deleted when the instance is deleted.
  • compute.launchSpecification.disks.boot Boolean
    Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem
  • compute.launchSpecification.disks.deviceName String
    Specifies a unique device name of your choice
  • compute.launchSpecification.disks.interface String
    Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI
  • compute.launchSpecification.disks.mode String
    The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode
  • compute.launchSpecification.disks.source String
    Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
  • compute.launchSpecification.disks.type String
    Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT
  • compute.launchSpecification.disks.initializeParams String
    Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance
  • compute.launchSpecification.disks.initializeParams.diskSizeGb Integer
    Specifies the size of the disk in base-2 GB
  • compute.launchSpecification.disks.initializeParams.diskType String
    Specifies the disk type to use to create the instance. the default is pd-standard. Valid values: pd-ssd, local-ssd
  • compute.launchSpecification.disks.initializeParams.sourceImage String
    A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project
  • compute.launchSpecification.networkInterfaces String
    An array of the following objects, representing network configuration for the created instances
  • compute.launchSpecification.networkInterfaces.network String
    Network resource for this instance elastic for the created instances
  • compute.launchSpecification.networkInterfaces.accessConfigs String
    An array of configurations for this interface
  • compute.launchSpecification.networkInterfaces.accessConfigs.name String
    Name of this access configuration
  • compute.launchSpecification.networkInterfaces.accessConfigs.type String
    An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported
  • compute.launchSpecification.tags Array<String>
    Tags to mark instances created.
  • compute.launchSpecification.metadata Array<Object>
    An array of the following objects, representing Key-Value pair meta data for the created instances
  • compute.launchSpecification.metadata.key String
    The meta data’s key
  • compute.launchSpecification.metadata.value String
    The meta data’s value
Response - 200

Headers
{  
  "Content-Type": "application/json" 
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "47d61ee1-db18-4b3d-bb97-955d0a215d55",
    "url": "/gcp/gce/group",
    "method": "POST",
    "timestamp": "2016-02-14T09:15:09.381Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:gcp:gce:group",
    "items": [
      {
        "id": "sig-642b8368",
        "name": "Spotinst GCP Group",
        "description": "Spotinst GCP Group",
        "capacity": {
          "minimum": 0,
          "maximum": 0,
          "target": 0
        },
        "strategy": {
          "preemptiblePercentage": 50
        },
        "compute": {
          "launchSpecification": {
            "serviceAccount": "example@myProject.iam.gserviceaccount.com",
            "tags": [
              "http",
              "https"
            ],
            "backendServices": [
              "spotinst-elb-backend-service"
            ],
            "disks": [
              {
                "deviceName": "device",
                "initializeParams": {
                  "diskSizeGb": 10,
                  "diskType": "pd-standard",
                  "sourceImage": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20151104"
                },
                "mode": "READ_WRITE",
                "type": "PERSISTENT",
                "autoDelete": true,
                "boot": true,
                "interface": "SCSI"
              }
            ],
            "networkInterfaces": [
              {
                "network": "spot-network"
              }
            ]
          },
          "instanceTypes": {
            "ondemand": "n1-standard-1",
            "preemptible": [
              "n1-standard-1",
              "n1-standard-2",
              "n1-standard-4"
            ]
          },
          "availabilityZones": [
            "asia-east1-c",
            "europe-west1-c",
            "us-central1-a"
          ]
        },
        "scaling": {
          "up": [
            {
              "policyName": "scale_up_1",
              "metricName": "instance/disk/read_ops_count",
              "statistic": "mean",
              "threshold": 10000,
              "namespace": "compute",
              "period": 300,
              "evaluationPeriods": 1,
              "cooldown": 300,
              "dimensions": [
                {
                  "name": "storage_type",
                  "value": "pd-standard"
                }
              ],
              "action": {
                "type": "adjustment",
                "adjustment": 1
              }
            }
          ]
        },
        "createdAt": "2016-02-14T09:15:09.000+0000",
        "updatedAt": "2016-02-14T09:15:09.000+0000"
      }
    ],
    "count": 1
  }
}