All URIs are relative to http://podman.io
Method | HTTP request | Description |
---|---|---|
containerArchive | GET /containers/{name}/archive | Get files from a container |
containerArchiveLibpod | GET /libpod/containers/{name}/archive | Copy files from a container |
containerAttach | POST /containers/{name}/attach | Attach to a container |
containerChangesLibpod_0 | GET /libpod/containers/{name}/changes | Report on changes to container's filesystem; adds, deletes or modifications. |
containerCreate | POST /containers/create | Create a container |
containerDelete | DELETE /containers/{name} | Remove a container |
containerExport | GET /containers/{name}/export | Export a container |
containerInspect | GET /containers/{name}/json | Inspect container |
containerKill | POST /containers/{name}/kill | Kill container |
containerList | GET /containers/json | List containers |
containerLogs | GET /containers/{name}/logs | Get container logs |
containerPause | POST /containers/{name}/pause | Pause container |
containerPrune | POST /containers/prune | Delete stopped containers |
containerRename | POST /containers/{name}/rename | Rename an existing container |
containerResize | POST /containers/{name}/resize | Resize a container's TTY |
containerRestart | POST /containers/{name}/restart | Restart container |
containerStart | POST /containers/{name}/start | Start a container |
containerStats | GET /containers/{name}/stats | Get stats for a container |
containerStop | POST /containers/{name}/stop | Stop a container |
containerTop | GET /containers/{name}/top | List processes running inside a container |
containerUnpause | POST /containers/{name}/unpause | Unpause container |
containerUpdate | POST /containers/{name}/update | Update configuration of an existing container |
containerWait | POST /containers/{name}/wait | Wait on a container |
imageCommit | POST /commit | New Image |
putContainerArchive | PUT /containers/{name}/archive | Put files into a container |
File containerArchive(name, path).execute();
Get files from a container
Get a tar archive of files from a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | container name or id
String path = "path_example"; // String | Path to a directory in the container to extract
try {
File result = apiInstance.containerArchive(name, path)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerArchive");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | container name or id | |
path | String | Path to a directory in the container to extract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | no error | - |
400 | Bad parameter in request | - |
404 | No such container | - |
500 | Internal server error | - |
File containerArchiveLibpod(name, path).rename(rename).execute();
Copy files from a container
Copy a tar archive of files from a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | container name or id
String path = "path_example"; // String | Path to a directory in the container to extract
String rename = "rename_example"; // String | JSON encoded map[string]string to translate paths
try {
File result = apiInstance.containerArchiveLibpod(name, path)
.rename(rename)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerArchiveLibpod");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | container name or id | |
path | String | Path to a directory in the container to extract | |
rename | String | JSON encoded map[string]string to translate paths | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | no error | - |
400 | Bad parameter in request | - |
404 | No such container | - |
500 | Internal server error | - |
containerAttach(name).detachKeys(detachKeys).logs(logs).stream(stream).stdout(stdout).stderr(stderr).stdin(stdin).execute();
Attach to a container
Attach to a container to read its output or send it input. You can attach to the same container multiple times and you can reattach to containers that have been detached. It uses the same stream format as docker, see the libpod attach endpoint for a description of the format.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
String detachKeys = "detachKeys_example"; // String | keys to use for detaching from the container
Boolean logs = true; // Boolean | Stream all logs from the container across the connection. Happens before streaming attach (if requested). At least one of logs or stream must be set
Boolean stream = true; // Boolean | Attach to the container. If unset, and logs is set, only the container's logs will be sent. At least one of stream or logs must be set
Boolean stdout = true; // Boolean | Attach to container STDOUT
Boolean stderr = true; // Boolean | Attach to container STDERR
Boolean stdin = true; // Boolean | Attach to container STDIN
try {
apiInstance.containerAttach(name)
.detachKeys(detachKeys)
.logs(logs)
.stream(stream)
.stdout(stdout)
.stderr(stderr)
.stdin(stdin)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerAttach");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
detachKeys | String | keys to use for detaching from the container | [optional] |
logs | Boolean | Stream all logs from the container across the connection. Happens before streaming attach (if requested). At least one of logs or stream must be set | [optional] |
stream | Boolean | Attach to the container. If unset, and logs is set, only the container's logs will be sent. At least one of stream or logs must be set | [optional] [default to true] |
stdout | Boolean | Attach to container STDOUT | [optional] |
stderr | Boolean | Attach to container STDERR | [optional] |
stdin | Boolean | Attach to container STDIN | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
101 | No error, connection has been hijacked for transporting streams. | - |
400 | Bad parameter in request | - |
404 | No such container | - |
500 | Internal server error | - |
containerChangesLibpod_0(name).parent(parent).diffType(diffType).execute();
Report on changes to container's filesystem; adds, deletes or modifications.
Returns which files in a container's filesystem have been added, deleted, or modified. The Kind of modification can be one of: 0: Modified 1: Added 2: Deleted
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or id of the container
String parent = "parent_example"; // String | specify a second layer which is used to compare against it instead of the parent layer
String diffType = "all"; // String | select what you want to match, default is all
try {
apiInstance.containerChangesLibpod_0(name)
.parent(parent)
.diffType(diffType)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerChangesLibpod_0");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or id of the container | |
parent | String | specify a second layer which is used to compare against it instead of the parent layer | [optional] |
diffType | String | select what you want to match, default is all | [optional] [enum: all, container, image] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json, application/octet-stream, text/plain
Status code | Description | Response headers |
---|---|---|
200 | Array of Changes | - |
404 | No such container | - |
500 | Internal server error | - |
ContainerCreateResponse containerCreate(body).name(name).execute();
Create a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
CreateContainerConfig body = new CreateContainerConfig(); // CreateContainerConfig | Container to create
String name = "name_example"; // String | container name
try {
ContainerCreateResponse result = apiInstance.containerCreate(body)
.name(name)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
body | CreateContainerConfig | Container to create | |
name | String | container name | [optional] |
No authorization required
- Content-Type: application/json, application/x-tar
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Create container | - |
400 | Bad parameter in request | - |
404 | No such container | - |
409 | Conflict error in operation | - |
500 | Internal server error | - |
containerDelete(name).force(force).v(v).link(link).execute();
Remove a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Boolean force = false; // Boolean | If the container is running, kill it before removing it.
Boolean v = false; // Boolean | Remove the volumes associated with the container.
Boolean link = true; // Boolean | not supported
try {
apiInstance.containerDelete(name)
.force(force)
.v(v)
.link(link)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerDelete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
force | Boolean | If the container is running, kill it before removing it. | [optional] [default to false] |
v | Boolean | Remove the volumes associated with the container. | [optional] [default to false] |
link | Boolean | not supported | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
400 | Bad parameter in request | - |
404 | No such container | - |
409 | Conflict error in operation | - |
500 | Internal server error | - |
containerExport(name).execute();
Export a container
Export the contents of a container as a tarball.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
try {
apiInstance.containerExport(name)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerExport");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | tarball is returned in body | - |
404 | No such container | - |
500 | Internal server error | - |
ContainerJSON containerInspect(name).size(size).execute();
Inspect container
Return low-level information about a container.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or id of the container
Boolean size = false; // Boolean | include the size of the container
try {
ContainerJSON result = apiInstance.containerInspect(name)
.size(size)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerInspect");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or id of the container | |
size | Boolean | include the size of the container | [optional] [default to false] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Inspect container | - |
404 | No such container | - |
500 | Internal server error | - |
containerKill(name).all(all).signal(signal).execute();
Kill container
Signal to send to the container as an integer or string (e.g. SIGINT)
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Boolean all = false; // Boolean | Send kill signal to all containers
String signal = "SIGKILL"; // String | signal to be sent to container
try {
apiInstance.containerKill(name)
.all(all)
.signal(signal)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerKill");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
all | Boolean | Send kill signal to all containers | [optional] [default to false] |
signal | String | signal to be sent to container | [optional] [default to SIGKILL] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
404 | No such container | - |
409 | Conflict error in operation | - |
500 | Internal server error | - |
List<Container> containerList().all(all).external(external).limit(limit).size(size).filters(filters).execute();
List containers
Returns a list of containers
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
Boolean all = false; // Boolean | Return all containers. By default, only running containers are shown
Boolean external = false; // Boolean | Return containers in storage not controlled by Podman
Integer limit = 56; // Integer | Return this number of most recently created containers, including non-running ones.
Boolean size = false; // Boolean | Return the size of container as fields SizeRw and SizeRootFs.
String filters = "filters_example"; // String | A JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) - `before`=(`<container id>` or `<container name>`) - `expose`=(`<port>[/<proto>]` or `<startport-endport>/[<proto>]`) - `exited=<int>` containers with exit code of `<int>` - `health`=(`starting`, `healthy`, `unhealthy` or `none`) - `id=<ID>` a container's ID - `is-task`=(`true` or `false`) - `label`=(`key` or `\"key=value\"`) of a container label - `name=<name>` a container's name - `network`=(`<network id>` or `<network name>`) - `publish`=(`<port>[/<proto>]` or `<startport-endport>/[<proto>]`) - `since`=(`<container id>` or `<container name>`) - `status`=(`created`, `restarting`, `running`, `removing`, `paused`, `exited` or `dead`) - `volume`=(`<volume name>` or `<mount point destination>`)
try {
List<Container> result = apiInstance.containerList()
.all(all)
.external(external)
.limit(limit)
.size(size)
.filters(filters)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerList");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
all | Boolean | Return all containers. By default, only running containers are shown | [optional] [default to false] |
external | Boolean | Return containers in storage not controlled by Podman | [optional] [default to false] |
limit | Integer | Return this number of most recently created containers, including non-running ones. | [optional] |
size | Boolean | Return the size of container as fields SizeRw and SizeRootFs. | [optional] [default to false] |
filters | String | A JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) - `before`=(`<container id>` or `<container name>`) - `expose`=(`<port>[/<proto>]` or `<startport-endport>/[<proto>]`) - `exited=<int>` containers with exit code of `<int>` - `health`=(`starting`, `healthy`, `unhealthy` or `none`) - `id=<ID>` a container's ID - `is-task`=(`true` or `false`) - `label`=(`key` or `"key=value"`) of a container label - `name=<name>` a container's name - `network`=(`<network id>` or `<network name>`) - `publish`=(`<port>[/<proto>]` or `<startport-endport>/[<proto>]`) - `since`=(`<container id>` or `<container name>`) - `status`=(`created`, `restarting`, `running`, `removing`, `paused`, `exited` or `dead`) - `volume`=(`<volume name>` or `<mount point destination>`) | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List Containers | - |
400 | Bad parameter in request | - |
500 | Internal server error | - |
containerLogs(name).follow(follow).stdout(stdout).stderr(stderr).since(since).until(until).timestamps(timestamps).tail(tail).execute();
Get container logs
Get stdout and stderr logs from a container.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Boolean follow = true; // Boolean | Keep connection after returning logs.
Boolean stdout = true; // Boolean | Return logs from stdout
Boolean stderr = true; // Boolean | Return logs from stderr
String since = "since_example"; // String | Only return logs since this time, as a UNIX timestamp
String until = "until_example"; // String | Only return logs before this time, as a UNIX timestamp
Boolean timestamps = false; // Boolean | Add timestamps to every log line
String tail = "all"; // String | Only return this number of log lines from the end of the logs
try {
apiInstance.containerLogs(name)
.follow(follow)
.stdout(stdout)
.stderr(stderr)
.since(since)
.until(until)
.timestamps(timestamps)
.tail(tail)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerLogs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
follow | Boolean | Keep connection after returning logs. | [optional] |
stdout | Boolean | Return logs from stdout | [optional] |
stderr | Boolean | Return logs from stderr | [optional] |
since | String | Only return logs since this time, as a UNIX timestamp | [optional] |
until | String | Only return logs before this time, as a UNIX timestamp | [optional] |
timestamps | Boolean | Add timestamps to every log line | [optional] [default to false] |
tail | String | Only return this number of log lines from the end of the logs | [optional] [default to all] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | logs returned as a stream in response body. | - |
404 | No such container | - |
500 | Internal server error | - |
containerPause(name).execute();
Pause container
Use the cgroups freezer to suspend all processes in a container.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
try {
apiInstance.containerPause(name)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerPause");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
404 | No such container | - |
500 | Internal server error | - |
List<ContainersPruneReport> containerPrune().filters(filters).execute();
Delete stopped containers
Remove containers not in use
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String filters = "filters_example"; // String | Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels.
try {
List<ContainersPruneReport> result = apiInstance.containerPrune()
.filters(filters)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerPrune");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
filters | String | Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Prune Containers | - |
500 | Internal server error | - |
containerRename(name, name2).execute();
Rename an existing container
Change the name of an existing container.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | Full or partial ID or full name of the container to rename
String name2 = "name_example"; // String | New name for the container
try {
apiInstance.containerRename(name, name2)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerRename");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Full or partial ID or full name of the container to rename | |
name2 | String | New name for the container |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
404 | No such container | - |
409 | Conflict error in operation | - |
500 | Internal server error | - |
Object containerResize(name).h(h).w(w).running(running).execute();
Resize a container's TTY
Resize the terminal attached to a container (for use with Attach).
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Integer h = 56; // Integer | Height to set for the terminal, in characters
Integer w = 56; // Integer | Width to set for the terminal, in characters
Boolean running = true; // Boolean | Ignore containers not running errors
try {
Object result = apiInstance.containerResize(name)
.h(h)
.w(w)
.running(running)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerResize");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
h | Integer | Height to set for the terminal, in characters | [optional] |
w | Integer | Width to set for the terminal, in characters | [optional] |
running | Boolean | Ignore containers not running errors | [optional] |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
404 | No such container | - |
500 | Internal server error | - |
containerRestart(name).t(t).execute();
Restart container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Integer t = 56; // Integer | timeout before sending kill signal to container
try {
apiInstance.containerRestart(name)
.t(t)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerRestart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
t | Integer | timeout before sending kill signal to container | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
404 | No such container | - |
500 | Internal server error | - |
containerStart(name).detachKeys(detachKeys).execute();
Start a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
String detachKeys = "ctrl-p,ctrl-q"; // String | Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _.
try {
apiInstance.containerStart(name)
.detachKeys(detachKeys)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerStart");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
detachKeys | String | Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _. | [optional] [default to ctrl-p,ctrl-q] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
304 | Container already started | - |
404 | No such container | - |
500 | Internal server error | - |
Object containerStats(name).stream(stream).oneShot(oneShot).execute();
Get stats for a container
This returns a live stream of a container’s resource usage statistics.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Boolean stream = true; // Boolean | Stream the output
Boolean oneShot = false; // Boolean | Provide a one-shot response in which preCPU stats are blank, resulting in a single cycle return.
try {
Object result = apiInstance.containerStats(name)
.stream(stream)
.oneShot(oneShot)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerStats");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
stream | Boolean | Stream the output | [optional] [default to true] |
oneShot | Boolean | Provide a one-shot response in which preCPU stats are blank, resulting in a single cycle return. | [optional] [default to false] |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | no error | - |
404 | No such container | - |
500 | Internal server error | - |
containerStop(name).t(t).execute();
Stop a container
Stop a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
Integer t = 56; // Integer | number of seconds to wait before killing container
try {
apiInstance.containerStop(name)
.t(t)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerStop");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
t | Integer | number of seconds to wait before killing container | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
304 | Container already stopped | - |
404 | No such container | - |
500 | Internal server error | - |
ContainerTopOKBody containerTop(name).psArgs(psArgs).execute();
List processes running inside a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
String psArgs = "-ef"; // String | arguments to pass to ps such as aux.
try {
ContainerTopOKBody result = apiInstance.containerTop(name)
.psArgs(psArgs)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerTop");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
psArgs | String | arguments to pass to ps such as aux. | [optional] [default to -ef] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List processes in container | - |
404 | No such container | - |
500 | Internal server error | - |
containerUnpause(name).execute();
Unpause container
Resume a paused container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
try {
apiInstance.containerUnpause(name)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerUnpause");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | no error | - |
404 | No such container | - |
500 | Internal server error | - |
containerUpdate(name).resources(resources).execute();
Update configuration of an existing container
Change configuration settings for an existing container without requiring recreation.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | Full or partial ID or full name of the container to rename
ContainerUpdateRequest resources = new ContainerUpdateRequest(); // ContainerUpdateRequest | attributes for updating the container
try {
apiInstance.containerUpdate(name)
.resources(resources)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerUpdate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Full or partial ID or full name of the container to rename | |
resources | ContainerUpdateRequest | attributes for updating the container | [optional] |
null (empty response body)
No authorization required
- Content-Type: application/json, application/x-tar
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | no error | - |
404 | No such container | - |
500 | Internal server error | - |
ContainerWait200Response containerWait(name).condition(condition).interval(interval).execute();
Wait on a container
Block until a container stops or given condition is met.
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | the name or ID of the container
String condition = "condition_example"; // String | wait until container is to a given condition. default is stopped. valid conditions are: - configured - created - exited - paused - running - stopped
String interval = "250ms"; // String | Time Interval to wait before polling for completion.
try {
ContainerWait200Response result = apiInstance.containerWait(name)
.condition(condition)
.interval(interval)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#containerWait");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | the name or ID of the container | |
condition | String | wait until container is to a given condition. default is stopped. valid conditions are: - configured - created - exited - paused - running - stopped | [optional] |
interval | String | Time Interval to wait before polling for completion. | [optional] [default to 250ms] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Wait container | - |
404 | No such container | - |
500 | Internal server error | - |
imageCommit().container(container).repo(repo).tag(tag).comment(comment).author(author).pause(pause).changes(changes).squash(squash).execute();
New Image
Create a new image from a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String container = "container_example"; // String | the name or ID of a container
String repo = "repo_example"; // String | the repository name for the created image
String tag = "tag_example"; // String | tag name for the created image
String comment = "comment_example"; // String | commit message
String author = "author_example"; // String | author of the image
Boolean pause = true; // Boolean | pause the container before committing it
String changes = "changes_example"; // String | instructions to apply while committing in Dockerfile format
Boolean squash = true; // Boolean | squash newly built layers into a single new layer
try {
apiInstance.imageCommit()
.container(container)
.repo(repo)
.tag(tag)
.comment(comment)
.author(author)
.pause(pause)
.changes(changes)
.squash(squash)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#imageCommit");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
container | String | the name or ID of a container | [optional] |
repo | String | the repository name for the created image | [optional] |
tag | String | tag name for the created image | [optional] |
comment | String | commit message | [optional] |
author | String | author of the image | [optional] |
pause | Boolean | pause the container before committing it | [optional] |
changes | String | instructions to apply while committing in Dockerfile format | [optional] |
squash | Boolean | squash newly built layers into a single new layer | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | no error | - |
404 | No such image | - |
500 | Internal server error | - |
putContainerArchive(name, path).noOverwriteDirNonDir(noOverwriteDirNonDir).copyUIDGID(copyUIDGID).request(request).execute();
Put files into a container
Put a tar archive of files into a container
// Import classes:
import io.github.pod4dev.libpodj.ApiClient;
import io.github.pod4dev.libpodj.ApiException;
import io.github.pod4dev.libpodj.Configuration;
import io.github.pod4dev.libpodj.models.*;
import io.github.pod4dev.libpodj.api.ContainersCompatApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
ContainersCompatApi apiInstance = new ContainersCompatApi(defaultClient);
String name = "name_example"; // String | container name or id
String path = "path_example"; // String | Path to a directory in the container to extract
String noOverwriteDirNonDir = "noOverwriteDirNonDir_example"; // String | if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa (1 or true)
String copyUIDGID = "copyUIDGID_example"; // String | copy UID/GID maps to the dest file or di (1 or true)
String request = "request_example"; // String | tarfile of files to copy into the container
try {
apiInstance.putContainerArchive(name, path)
.noOverwriteDirNonDir(noOverwriteDirNonDir)
.copyUIDGID(copyUIDGID)
.request(request)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling ContainersCompatApi#putContainerArchive");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | container name or id | |
path | String | Path to a directory in the container to extract | |
noOverwriteDirNonDir | String | if unpacking the given content would cause an existing directory to be replaced with a non-directory and vice versa (1 or true) | [optional] |
copyUIDGID | String | copy UID/GID maps to the dest file or di (1 or true) | [optional] |
request | String | tarfile of files to copy into the container | [optional] |
null (empty response body)
No authorization required
- Content-Type: application/json, application/x-tar
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | no error | - |
400 | Bad parameter in request | - |
403 | the container rootfs is read-only | - |
404 | No such container | - |
500 | Internal server error | - |