Services allow you to load balance traffic for an Internet-facing service like a webserver by creating multiple instances within the same service. While you can add or remove instances to a service to scale your service, doing this manually makes it hard to react to changes in service load. On the other hand, always keeping a large number of instances running to cope with bursts is not an option either. This is where autoscale comes into play. With autoscale enabled, Unikraft Cloud takes the heavy lifting of constantly monitoring the load of your service and automatically creates or deletes instances as needed.
List Autoscale Configurations
Return the current states and configurations of autoscale configurations for a given set of service groups given their UUIDs or names.
Request Body
uuidstring · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
namestring · requiredMutually exclusive with UUID.
Example: funky-town-g756b5d
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Create Autoscale Configurations
Create one or more autoscale configurations for the specified service groups given their UUIDs or names.
Request Body
uuidstring · uuidThe UUID of the service to create a configuration for. Mutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000namestringThe name of the service to create a configuration for. Mutually exclusive with UUID.
Example: funky-servicemin_sizeinteger · int64The minimum number of instances to keep running.
Example: 2max_sizeinteger · int64The maximum number of instances to keep running.
Example: 12warmup_time_msinteger · int64The warmup time in milliseconds for new instances.
Example: 100cooldown_time_msinteger · int64The cooldown time in milliseconds for the autoscale configuration.
Example: 100create_argsobjectThe arguments to use when creating the autoscale configuration.
policiesobject[]The policies to apply to the autoscale configuration.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Delete Autoscale Configurations
Delete autoscale configuration for a given set of service groups given their UUIDs or names.
Request Body
uuidstring · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
namestring · requiredMutually exclusive with UUID.
Example: funky-town-g756b5d
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Get Autoscale Configurations by Service Group UUID
Return the current states and configurations of autoscale configurations given a service group UUID.
path Parameters
uuidstring · uuid · requiredThe UUID of the service group.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Create Autoscale Configuration by Service Group UUID
Create an autoscale configuration for the specified service group given its UUID.
path Parameters
uuidstring · uuid · requiredThe UUID of the service to create a configuration for. Mutually exclusive with name.
Request Body
uuidstring · uuidThe UUID of the service to create a configuration for. Mutually exclusive with name.
min_sizeinteger · int64The minimum number of instances to keep running.
max_sizeinteger · int64The maximum number of instances to keep running.
warmup_time_msinteger · int64The warmup time in milliseconds for new instances.
cooldown_time_msinteger · int64The cooldown time in milliseconds for the autoscale configuration.
create_argsobjectThe arguments to use when creating the autoscale configuration.
policiesobject[]The policies to apply to the autoscale configuration.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Delete Autoscale Configurations by Service Group UUID
Delete the autoscale configuration for the service group given its UUID.
Unikraft Cloud will immediately drain all connections from all instances
that have been created by autoscale and delete the instances afterwards.
The draining phase is allowed to take at most cooldown_time_ms
milliseconds after which remaining connections are forcefully closed. The
master instance is never deleted. However, deleting the autoscale
configuration causes the master instance to start if it is stopped.
path Parameters
uuidstring · uuid · requiredThe UUID of the service group.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
List Autoscale Configuration Policies
Create Autoscale Configuration Policy
Add a new autoscale policy to an autoscale configuration given a service group UUID.
path Parameters
uuidstring · required
Request Body
namestring · requiredThe Name of the service to add a policy to.
Example: funky-servicetypeobject · requiredThe policy type to add to the autoscale configuration.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Delete Autoscale Configuration Policies
Get Autoscale Configuration Policy by Name
Return the current state and configuration of an autoscale policy given the service group UUID and the name of the policy.
path Parameters
uuidstring · uuid · requiredThe UUID of the service group.
namestring · requiredThe name of the policy to get.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations
Delete Autoscale Configuration Policy by Name
Delete an autoscale policy by name given the service group UUID.
path Parameters
uuidstring · uuid · requiredThe UUID of the service group.
namestring · requiredThe name of the policy to delete.
Responses
messagestringAn optional message providing additional information about the status. This field is useful when the status is not
success.Example: Failed to perform all operations