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
Decision Table
Variant | Matching Criteria |
---|---|
type = object · requires: uuid | |
type = object · requires: name |
uuid
string · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
uuid
string · uuidThe UUID of the service to create a configuration for. Mutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000name
stringThe name of the service to create a configuration for. Mutually exclusive with UUID.
Example: funky-servicemin_size
integer · int64The minimum number of instances to keep running.
Example: 2max_size
integer · int64The maximum number of instances to keep running.
Example: 12warmup_time_ms
integer · int64The warmup time in milliseconds for new instances.
Example: 100cooldown_time_ms
integer · int64The cooldown time in milliseconds for the autoscale configuration.
Example: 100create_args
objectThe arguments to use when creating the autoscale configuration.
policies
object[]The policies to apply to the autoscale configuration.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
Decision Table
Variant | Matching Criteria |
---|---|
type = object · requires: uuid | |
type = object · requires: name |
uuid
string · uuid · requiredMutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
uuid
string · uuid · requiredThe UUID of the service group.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
uuid
string · uuid · requiredThe UUID of the service to create a configuration for. Mutually exclusive with name.
Request Body
uuid
string · uuidThe UUID of the service to create a configuration for. Mutually exclusive with name.
min_size
integer · int64The minimum number of instances to keep running.
max_size
integer · int64The maximum number of instances to keep running.
warmup_time_ms
integer · int64The warmup time in milliseconds for new instances.
cooldown_time_ms
integer · int64The cooldown time in milliseconds for the autoscale configuration.
create_args
objectThe arguments to use when creating the autoscale configuration.
policies
object[]The policies to apply to the autoscale configuration.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
uuid
string · uuid · requiredThe UUID of the service group.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
List the autoscale policies for a given service group given its UUID.
path Parameters
uuid
string · required
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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 Policy
Add a new autoscale policy to an autoscale configuration given a service group UUID.
path Parameters
uuid
string · required
Request Body
name
string · requiredThe Name of the service to add a policy to.
Example: funky-servicetype
object · requiredThe policy type to add to the autoscale configuration.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
Delete one or more autoscale policies for a given service group.
path Parameters
uuid
string · required
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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 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
uuid
string · uuid · requiredThe UUID of the service group.
name
string · requiredThe name of the policy to get.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn 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
uuid
string · uuid · requiredThe UUID of the service group.
name
string · requiredThe name of the policy to delete.
Responses
default
Decision Table
Variant | Matching Criteria |
---|---|
type = object |
message
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operations