Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
alltrue
styleh3
pageSuperb Cloud API

POST /virtual_machines/:virtual_machine_id/auto_scaling 

Creates a new rule for specified VS

Sections:

Table of Contents
maxLevel4
minLevel2
includeResponse.*|JSON.*|XML.*

Info

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

Info

A 201 status is returned on success

JSON Request example

Code Block
languagebash
themeRDark
 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

Code Block
languagebash
themeRDark
 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>'