- API-Referenz
- Container
- Get a ContainerImageConfig
Get a ContainerImageConfig
Resolves the given image reference and returns the configuration of the image. An image that does not exist, cannot be accessed (e.g. a private image without matching Registry credentials), or cannot be resolved returns 400 with a validation error describing the cause; 404 is only returned for an unknown Registry passed as useCredentialsForRegistryId. If the image's registry rate-limits the request, 429 is returned and the request can be retried later.
Request
- imageReferencestringrequired
The image reference to get a ContainerImageConfig for.
- useCredentialsForProjectIdstring (uuid)
ID of the Project to get a ContainerImageConfig with belonging Registry credentials for.
- useCredentialsForRegistryIdstring (uuid)
ID of the Registry to get a ContainerImageConfig with credentials for. The registry host of
imageReferencemust match the Registry'suri, with or without stored credentials (compared case-insensitively;docker.ioandindex.docker.ioare treated as equal, and references without a registry host refer to Docker Hub); otherwise a 400 ValidationError is returned and the credentials are not used. An unknown Registry ID returns 404. - generateAiDataboolean
Whether ai data should be generated during request. The request duration can take up to 15 seconds.
- Accept-Languagestring (einer von: de, en)
The preferred language for the response.
Responses
OK
- commandArray von string
Command of the container image.
- Array[
- *string
]
- digeststringrequired
The image digest.
- entrypointArray von string
Entrypoint of the container image.
- Array[
- *string
]
- envArray von object
List of environment variables the container image has.
- Array[
- *object
- descriptionstring
The description of the env key.
- isAiGeneratedbooleanrequired
Whether the env has been ai generated.
- isSensitiveboolean
Whether the env key is a sensitive field, e.g. password fields.
- keystringrequired
The env key.
- valuestring
The env default value.
]
- exposedPortsArray von object
List of exposed ports the container image has.
- Array[
- *object
- descriptionstring
The description of the exposed port.
- isAiGeneratedbooleanrequired
Whether the port has been ai generated.
- portstringrequired
The exposed port.
]
- hasAiGeneratedDatabooleanrequired
Whether the image config has ai generated data.
- isAiAvailablebooleanrequired
Whether ai generation is available for the image reference.
- isUserRootbooleanrequired
Whether the container user is root.
- overwritingUserintegerdeprecated
Deprecated, user will never be overwritten.
- userstringrequired
The user the container image is running with.
- userIdintegerrequired
The user id the container image is running with.
- volumesArray von object
List of volumes the container image has.
- Array[
- *object
- descriptionstring
The description of the volume path.
- isAiGeneratedbooleanrequired
Whether the volume has been ai generated.
- volumestringrequired
The volume path.
]
Content-Type: application/json
{
"command": [
"mysqld"
],
"digest": "sha256:216aab5860821ba2eecad636722a6891e40a81791fbb61e2bd49bfc5aeeacdca",
"entrypoint": [
"docker-entrypoint.sh"
],
"env": [
{
"description": "The mysql user password.",
"isAiGenerated": true,
"isSensitive": true,
"key": "MYSQL_PASSWORD",
"value": "my_password"
}
],
"exposedPorts": [
{
"description": "The mysql connection port.",
"isAiGenerated": true,
"port": "3306/tcp"
}
],
"hasAiGeneratedData": true,
"isAiAvailable": true,
"isUserRoot": true,
"user": "mysql",
"userId": 123,
"volumes": [
{
"description": "The mysql database files.",
"isAiGenerated": true,
"volume": "/var/lib/mysql"
}
]
}
{
"properties": {
"command": {
"description": "Command of the container image.",
"items": {
"example": "mysqld",
"type": "string"
},
"type": "array"
},
"digest": {
"description": "The image digest.",
"example": "sha256:216aab5860821ba2eecad636722a6891e40a81791fbb61e2bd49bfc5aeeacdca",
"type": "string"
},
"entrypoint": {
"description": "Entrypoint of the container image.",
"items": {
"example": "docker-entrypoint.sh",
"type": "string"
},
"type": "array"
},
"env": {
"description": "List of environment variables the container image has.",
"items": {
"properties": {
"description": {
"description": "The description of the env key.",
"example": "The mysql user password.",
"type": "string"
},
"isAiGenerated": {
"description": "Whether the env has been ai generated.",
"example": true,
"type": "boolean"
},
"isSensitive": {
"description": "Whether the env key is a sensitive field, e.g. password fields.",
"example": true,
"type": "boolean"
},
"key": {
"description": "The env key.",
"example": "MYSQL_PASSWORD",
"type": "string"
},
"value": {
"description": "The env default value.",
"example": "my_password",
"type": "string"
}
},
"required": [
"key",
"isAiGenerated"
],
"type": "object"
},
"type": "array"
},
"exposedPorts": {
"description": "List of exposed ports the container image has.",
"items": {
"properties": {
"description": {
"description": "The description of the exposed port.",
"example": "The mysql connection port.",
"type": "string"
},
"isAiGenerated": {
"description": "Whether the port has been ai generated.",
"example": true,
"type": "boolean"
},
"port": {
"description": "The exposed port.",
"example": "3306/tcp",
"type": "string"
}
},
"required": [
"port",
"isAiGenerated"
],
"type": "object"
},
"type": "array"
},
"hasAiGeneratedData": {
"description": "Whether the image config has ai generated data.",
"example": true,
"type": "boolean"
},
"isAiAvailable": {
"description": "Whether ai generation is available for the image reference.",
"example": true,
"type": "boolean"
},
"isUserRoot": {
"description": "Whether the container user is root.",
"example": false,
"type": "boolean"
},
"overwritingUser": {
"deprecated": true,
"description": "Deprecated, user will never be overwritten.",
"example": 1000,
"type": "integer"
},
"user": {
"description": "The user the container image is running with.",
"example": "mysql",
"type": "string"
},
"userId": {
"description": "The user id the container image is running with.",
"example": 0,
"type": "integer"
},
"volumes": {
"description": "List of volumes the container image has.",
"items": {
"properties": {
"description": {
"description": "The description of the volume path.",
"example": "The mysql database files.",
"type": "string"
},
"isAiGenerated": {
"description": "Whether the volume has been ai generated.",
"example": true,
"type": "boolean"
},
"volume": {
"description": "The volume path.",
"example": "/var/lib/mysql",
"type": "string"
}
},
"required": [
"volume",
"isAiGenerated"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"user",
"userId",
"isUserRoot",
"hasAiGeneratedData",
"isAiAvailable",
"digest"
],
"type": "object"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
The requested resource was not found
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/container-image-config?imageReference=mysql&useCredentialsForProjectId=f0f86186-0a5a-45b2-aa33-502777496347&useCredentialsForRegistryId=f0f86186-0a5a-45b2-aa33-502777496347&generateAiData=true
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.container.getContainerImageConfig({
"queryParameters": {
"imageReference": "mysql",
"useCredentialsForProjectId": "f0f86186-0a5a-45b2-aa33-502777496347",
"useCredentialsForRegistryId": "f0f86186-0a5a-45b2-aa33-502777496347",
"generateAiData": true
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Container\GetContainerImageConfig\GetContainerImageConfigRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetContainerImageConfigRequest())
->withImageReference("mysql")
->withUseCredentialsForProjectId("f0f86186-0a5a-45b2-aa33-502777496347")
->withUseCredentialsForRegistryId("f0f86186-0a5a-45b2-aa33-502777496347")
->withGenerateAiData(true);
$response = $client->container()->getContainerImageConfig($request);
var_dump($response->getBody();