A service group on Unikraft Cloud is used to describe how your application exposes its functionality to the outside world. Once defined, assigning an instance to the service will make it accessible from the Internet.
An application, running as an instance, may expose one or more ports, e.g. it listens on port 80 because your application exposes a HTTP web service. This, along with a set of additional metadata defines how the "service" is configured and accessed. For example, a service may be configured to use TLS, or be bound to a specific domain name.
When an instance is assigned to a service group, it immediately becomes accessible over the Internet on the exposed public port, using the set DNS name, and is routed to the set destination port.
Note: If you do not specify a DNS name when you create a service and you indicate that the application exposes some ports, Unikraft Cloud will generates a random DNS name for you. Unikraft Cloud also supports custom domains like www.example.com and wildcard domains like *.example.com.
List Service Groups
Get one or many service groups with their current status and configuration. It's possible to filter this list by name or UUID.
query Parameters
details
booleanWhether to include details about the service group in the response. By default this is set to true, meaning that all information about the service group will be included in the response. If set to false, only the basic information about the service group will be included, such as its name and UUID.
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
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 46
Create Service Group
Create a new service with the given configuration.
Note that the service properties like published ports can only be defined during creation. They cannot be changed later. Each port in a service can specify a list of handlers that determine how traffic arriving at the port is handled. See Connection Handlers for a complete overview.
Request Body
name
stringName of the service group. This is a human-readable name that can be used to identify the service group. The name must be unique within the context of your account. If no name is specified, a random name is generated for you. The name can also be used to identify the service group in API calls.
Example: funky-service-g7gum5cjservices
object[]Description of exposed services.
domains
object[]Description of domains associated with the service group.
soft_limit
integer · uint64The soft limit is used by the Unikraft Cloud load balancer to decide when to wake up another standby instance.
For example, if the soft limit is set to 5 and the service consists of 2 standby instances, one of the instances receives up to 5 concurrent requests. The 6th parallel requests wakes up the second instance. If there are no more standby instances to wake up, the number of requests assigned to each instance will exceed the soft limit. The load balancer makes sure that when the number of in-flight requests goes down again, instances are put into standby as fast as possible.
Example: 1hard_limit
integer · uint64The hard limit defines the maximum number of concurrent requests that an instance assigned to the this service can handle.
The load balancer will never assign more requests to a single instance. In case there are no other instances available, excess requests fail (i.e., they are blocked and not queued).
Example: 100
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 46
Delete Service Groups
Delete the specified service group(s). After this call the name of the service group(s) are no longer valid.
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
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 46
Update Service Groups
Update one or more service groups.
Request Body
prop
string · enum · enum · requiredThe property to modify.
Enum values:servicesdomainssoft_limithard_limitExample: servicesop
string · enum · enum · requiredThe operation to perform.
Enum values:setadddelExample: set
id
string(Optional). A client-provided identifier for tracking this operation in the response.
Example: op-1uuid
string · uuidThe UUID of the service group to update. Mutually exclusive with name.
Example: 123e4567-e89b-12d3-a456-426614174000name
stringThe name of the service group to update. Mutually exclusive with UUID.
Example: funky-town-g756b5dvalue
The value for the update operation:
- For "services": array of Service objects
- For "domains": array of Domain objects
- For "soft_limit": integer (1–65535), must be <= "hard_limit"
- For "hard_limit": integer (1–65535), must be >= "soft_limit"
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 76
Get Service Group by UUID
Get a specified service group by its UUID.
path Parameters
uuid
string · uuid · requiredThe UUID of the service group to retrieve.
Example: 12345678-90ab-cdef-1234-567890abcdef
query Parameters
details
booleanWhether to include details about the service group in the response. By default this is set to true, meaning that all information about the service group will be included in the response. If set to false, only the basic information about the service group will be included, such as its name and UUID.
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 46
Delete Service Group by UUID
Delete a specified service group by its UUID. After this call the UUID of the service group is no longer valid.
path Parameters
uuid
string · uuid · requiredThe UUID of the service group to delete.
Example: 12345678-90ab-cdef-1234-567890abcdef
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 46
Update Service Group by UUID
Update a service group by its UUID.
path Parameters
uuid
string · uuid · requiredThe UUID of the service group to update.
Example: 123e4567-e89b-12d3-a456-426614174000
Request Body
prop
string · enum · enum · requiredThe property to modify.
Enum values:servicesdomainssoft_limithard_limitExample: servicesop
string · enum · enum · requiredThe operation to perform.
Enum values:setadddelExample: set
id
string(Optional). A client-provided identifier for tracking this operation in the response.
Example: op-1value
The value for the update operation:
- For "services": array of Service objects
- For "domains": array of Domain objects
- For "soft_limit": integer (1–65535), must be <= "hard_limit"
- For "hard_limit": integer (1–65535), must be >= "soft_limit"
Responses
default
status
string · enum · enumThe status of the response.
Enum values:successerrormessage
stringAn optional message providing additional information about the status. This field is useful when the status is not
success
.Example: Failed to perform all operationsdata
objectThe response data for this request.
errors
object[]A list of errors which may have occurred during the request.
op_time_us
integer · uint64The operation time in microseconds. This is the time it took to process the request and generate the response.
Example: 76