Page tree
Skip to end of metadata
Go to start of metadata

API Essentials

API Key Generation

Autoscaling

Backups

Credit

DNS

Firewall Rules

Flex Cloud VM Control

Getting Started with Superb Flex Cloud

IP Addresses

Logs

Network Interfaces

Recipes

SSH Keys

Templates

Test Route

Troubleshooting API Issues

Viewing Activity Logs

Virtual Server Operating Systems

Virtual Servers

VS Disks

POST /virtual_machines/:virtual_machine_id/auto_scaling 

Creates a new rule for specified VS

Sections:

Disks cannot be scaled down via autoscaling

Request Parameters

up_to* - the amount of resource which cannot be exceeded within 24 hours period; only for autoscale up rules

for_minutes* - the time threshold before scaling will be triggered

trigger_limit* - the amount of the resource usage (%). If this value is reached by the VS for the period specified by the for_minutes parameter, the system will add/remove the amount of units set by the adjust_units parameters.

adjust_units* - the amount of resource units which the system should add/remove if the rule is met

enabled* - set 1 to enable, or 0 to disable

cpu/memory/disk - indicate type of resource for which the autoscaling rule is set

Response Parameters

A 201 status is returned on success

JSON Request example

 curl -i -X POST -u user:password <api_url>/virtual_machines/:virual_machine_id/auto_scaling.json -H 'Accept: application/json' -H 'Content-type: application/json' -d 'auto_scaling_configurations": {
        "up": {
            "cpu": {
                "enabled": "1",
                "for_minutes": "5",
                "limit_trigger": "40",
                "adjust_units": "20",
                "up_to": "100"
            },
            "memory": {
                "enabled": "1",
                "for_minutes": "5",
                "limit_trigger": "90",
                "adjust_units": "128",
                "up_to": "1024"
            },
            "disk": {
                "enabled": "1",
                "for_minutes": "5",
                "limit_trigger": "80",
                "adjust_units": "10",
                "up_to": "20"
            }
        },
        "down": {
            "cpu": {
                "enabled": "1",
                "for_minutes": "5",
                "limit_trigger": "40",
                "adjust_units": "20"
            },
            "memory": {
                "enabled": "1",
                "for_minutes": "5",
                "limit_trigger": "90",
                "adjust_units": "128",
                "up_to": "1024"
            }
        }
    }
}'

XML Request example

 curl -i -X POST -u user:password <api_url>/virtual_machines/:virual_machine_id/auto_scaling.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<?xml version="1.0" encoding="UTF-8"?>
<auto_scaling_configurations>
   <up>
      <cpu>
         <enabled>1</enabled>
         <for_minutes>5</for_minutes>
         <limit_trigger>40</limit_trigger>
         <adjust_units>20</adjust_units>
         <up_to>100</up_to>
      </cpu>
      <memory>
         <enabled>1</enabled>
         <for_minutes>5</for_minutes>
         <limit_trigger>90</limit_trigger>
         <adjust_units>128</adjust_units>
         <up_to>1024</up_to>
      </memory>
      <disk>
         <enabled>1</enabled>
         <for_minutes>5</for_minutes>
         <limit_trigger>80</limit_trigger>
         <adjust_units>10</adjust_units>
         <up_to>20</up_to>
      </disk>
   </up>
   <down>
      <cpu>
         <enabled>1</enabled>
         <for_minutes>5</for_minutes>
         <limit_trigger>100</limit_trigger>
         <adjust_units>10</adjust_units>
      </cpu>
      <memory>
         <enabled>1</enabled>
         <for_minutes>5</for_minutes>
         <limit_trigger>100</limit_trigger>
         <adjust_units>128</adjust_units>
    </memory></down></auto_scaling_configurations>'
  • No labels