Container App
API for single-machine container apps
Version: 0.1.0
Server
- URL:
https://api.kopernik.us/v0- Kopernik.us API server
Paths
/resource/containerapp/{providerUid}
GET
List container apps
List container apps for the specified provider
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| providerUid | path | ProviderId | ✅ | Unique identifier of the provider |
| nextToken | query | string | ❌ | Token for the next page of container apps, if there are more items to fetch |
| maxResults | query | integer | ❌ | Maximum number of container apps to fetch |
| jq | query | string | ❌ | JQ filter expression to filter the results. Only resources where the expression evaluates to a truthy value are included. The expression is applied to each resource’s JSON representation. Uses jq 1.7 syntax. |
Responses:
-
200: Container apps data
- Content Type:
application/json- Schema: ContainerAppPagedResourceResponse
- Content Type:
-
400: Argument validation error
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
404: Provider not found
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
POST
Create container app
Initiate creation of a new container app for the specified provider, and return an Action representing the create operation.
The operation starts the action immediately, and then waits a configurable amount of time for the action to complete. If the action completes within the wait time, then the operation returns 200 OK with the Action object in completed state. If the action does not complete within the wait time, then the operation returns 202 Accepted with the Action object in initiated state. Action status and result can be checked later using the Action API.
Note that this operation’s result represents Action, not the created resource, i.e. returns successful HTTP response (200 or 202) even if the underlying Create resource operation fails. If the action cannot be initiated, then an error response is returned.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| providerUid | path | ProviderId | ✅ | Unique identifier of the provider |
| waitTime | query | number | ❌ | Maximum time to wait for the action to complete with 200 OK before returning 202 Accepted; in seconds |
Request Body:
Content Type: application/json
Schema: ContainerAppCreate
Responses:
-
200: Container app created
- Content Type:
application/json- Schema: ActionResponse
- Content Type:
-
202: Container app create initiated
- Content Type:
application/json- Schema: ActionResponse
- Content Type:
-
400: Argument validation error
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
/resource/containerapp/{providerUid}/{resourceUid}
GET
Get container app
Get container app details
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| providerUid | path | ProviderId | ✅ | Unique identifier of the provider |
| resourceUid | path | string | ✅ | Unique identifier of the container app |
Responses:
-
200: Container app details
- Content Type:
application/json- Schema: ContainerAppResourceResponse
- Content Type:
-
400: Argument validation error
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
404: Container app not found
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
DELETE
Delete container app
Initiate deletion of a container app, and return an Action representing the delete operation. Note that this operation returns successful HTTP response (200 or 202) even if the Delete action fails. Error response is returned if the Action cannot be initiated. Resource deletion status and result are available in the returned Action object, or via the Action API later.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| providerUid | path | ProviderId | ✅ | Unique identifier of the provider |
| resourceUid | path | string | ✅ | Unique identifier of the container app to delete |
| attachedVolumesDeletePolicy | query | AttachedVolumesDeletePolicy | ❌ | |
| waitTime | query | number | ❌ | Maximum time to wait for the action to complete with 200 OK before returning 202 Accepted; in seconds |
Responses:
-
200: Container app deletion completed
- Content Type:
application/json- Schema: ActionResponse
- Content Type:
-
202: Container app deletion initiated
- Content Type:
application/json- Schema: ActionResponse
- Content Type:
-
400: Argument validation error
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
-
404: Container app not found
- Content Type:
application/json- Schema: ErrorResponse
- Content Type:
Schemas
ContainerImage
Container image
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | ✅ | Image ID, e.g. “nginx:latest”. |
| digest | string | ❌ | Optional image digest (e.g. sha256:…) to pin the image for reproducibility. |
ContainerImageRepositoryCredentials
Image repository credentials
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| username | string | ✅ | Username for the image repository |
| password | string | ✅ | Password for the image repository |
ContainerAppPort
Container port to expose
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| port | integer | ✅ | Container port number |
| name | string | ❌ | Optional port name |
| protocol | string enum | ❌ | Network protocol |
ContainerAppEnvVar
Environment variable for the container
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Environment variable name |
| value | string | ✅ | Environment variable value |
ContainerAppRuntimeProps
Runtime properties for the container
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| env | array<ContainerAppEnvVar> | ❌ | Environment variables for the container |
| ports | array<ContainerAppPort> | ❌ | Exposed container ports |
| restartPolicy | string enum | ❌ | Container restart policy. Defaults to “always”. |
| volumeMountTargets | array |
❌ | Container paths for attached volumes, in order. The i-th host mount (from sorted /mnt discovery) is bound to the i-th entry here. If the list is shorter than the number of volumes, remaining volumes use default paths (/disk1, /disk2, …). E.g. [“/var/lib/mysql”] for MySQL data persistence. |
ContainerApp
Container app (single-machine container workload)
Composition: allOf
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| machine | Machine | ✅ | Underlying machine instance |
| templateId | string | ❌ | Template ID if the container app was created from a template |
ContainerAppCreate
Request to create a new container app.
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| machineConfiguration | MachineCreate | ✅ | Configuration for the underlying machine. When creating a container app from a template, it must provide exactly the given number of data disks as specified in the template’s volumeMountTargets property. |
| templateId | string | ❌ | Optional. When set, create container app from a template. Image, ports, volumeMountTargets, and required env property definitions come from the template. |
| containerImage | ContainerImage | ✅ | Container image to use for the container app. Must be defined and match the template’s image when templateId is used. |
| containerImageRepositoryCredentials | ContainerImageRepositoryCredentials | ❌ | Credentials for the container image repository |
| runtimeProps | ContainerAppRuntimeProps | ❌ | Runtime properties for the container. When creating a container app from a template, the runtime properties must specify: - all env properties defined in the template marked as required and having no default value. - volumeMountTargets must be unset, otherwise it must match the template’s volumeMountTargets property. - if ports are defined, they override the template’s ports, i.e. no template port mappings are applied. |
ContainerAppResourceResponse
Response with container app
Composition: allOf
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| resource | ContainerApp | ✅ |
ContainerAppPagedResourceResponse
Response with paged container apps
Composition: allOf
Type: object
Properties:
| Name | Type | Required | Description |
|---|---|---|---|
| resources | array<ContainerApp> | ✅ |