Class ContainersApi
java.lang.Object
io.github.alersrt.pod4j.openapi.api.ContainersApi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclassclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontainerAttachLibpod(String name) Attach to a container Attach to a container to read its output or send it input.containerChangesLibpod(String name) Report on changes to container's filesystem; adds, deletes or modifications.Checkpoint a containercontainerCreateLibpod(SpecGenerator create) Create a containercontainerDeleteLibpod(String name) Delete container Delete containercontainerExistsLibpod(String name) Check if container exists Quick way to determine if a container exists by name or IDcontainerExportLibpod(String name) Export a container Export the contents of a container as a tarball.Run a container's healthcheck Execute the defined healthcheck and return information about the resultscontainerInitLibpod(String name) Initialize a container Performs all tasks necessary for initializing the container but does not start the container.containerInspectLibpod(String name) Inspect container Return low-level information about a container.containerKillLibpod(String name) Kill container send a signal to a container, defaults to killing the containerList containers Returns a list of containerscontainerLogsLibpod(String name) Get container logs Get stdout and stderr logs from a container.containerMountLibpod(String name) Mount a container Mount a container to the filesystemcontainerPauseLibpod(String name) Pause a container Use the cgroups freezer to suspend all processes in a container.Delete stopped containers Remove containers not in usecontainerRenameLibpod(String name, String name2) Rename an existing container Change the name of an existing container.containerResizeLibpod(String name) Resize a container's TTY Resize the terminal attached to a container (for use with Attach).containerRestartLibpod(String name) Restart a containercontainerRestoreLibpod(String name) Restore a container Restore a container from a checkpoint.Show mounted containers Lists all mounted containers mount pointsGet stats for one or more containers Return a live stream of resource usage statistics of one or more container.containerStartLibpod(String name) Start a containercontainerStatsLibpod(String name) Get stats for a container DEPRECATED.containerStopLibpod(String name) Stop a containercontainerTopLibpod(String name) List processes List processes running inside a containercontainerUnmountLibpod(String name) Unmount a container Unmount a container from the filesystemcontainerUnpauseLibpod(String name) Unpause ContainercontainerUpdateLibpod(String name) Updates the configuration of an existing container, allowing changes to resource limits and healthchecks Updates the configuration of an existing container, allowing changes to resource limits and healthchecks.containerWaitLibpod(String name) Wait on a container Wait on a container to meet a given conditiongenerateKubeLibpod(List<String> names) Generate a Kubernetes YAML file.generateSystemdLibpod(String name) Generate Systemd Units Generate Systemd Units based on a pod or container.intimageCommitLibpod(String container) Commit Create a new image from a containerApply a podman workload or Kubernetes YAML file.Remove resources created from kube play Tears down pods, secrets, and volumes defined in a YAML filePlay a Kubernetes YAML file.putContainerArchiveLibpod(String name, String path) Copy files into a container Copy a tar archive of files into a containervoidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex)
-
Constructor Details
-
ContainersApi
public ContainersApi() -
ContainersApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
containerAttachLibpod
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. ### Hijacking This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, and `stderr` on the same socket. This is the response from the service for an attach request: ``` HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream [STREAM] ``` After the headers and two new lines, the TCP connection can now be used for raw, bidirectional communication between the client and server. To inform potential proxies about connection hijacking, the client can also optionally send connection upgrade headers. For example, the client sends this request to upgrade the connection: ``` POST /v4.6.0/libpod/containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 Upgrade: tcp Connection: Upgrade ``` The service will respond with a `101 UPGRADED` response, and will similarly follow with the raw stream: ``` HTTP/1.1 101 UPGRADED Content-Type: application/vnd.docker.raw-stream Connection: Upgrade Upgrade: tcp [STREAM] ``` ### Stream format When the TTY setting is disabled for the container, the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream (starting with v4.7.0, previously application/vnd.docker.raw-stream was always used) and the stream over the hijacked connected is multiplexed to separate out `stdout` and `stderr`. The stream consists of a series of frames, each containing a header and a payload. The header contains the information about the output stream type and the size of the payload. It is encoded on the first eight bytes like this: ```go header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} ``` `STREAM_TYPE` can be: - 0: `stdin` (is written on `stdout`) - 1: `stdout` - 2: `stderr` `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size encoded as big endian. Following the header is the payload, which contains the specified number of bytes as written in the size. The simplest way to implement this protocol is the following: 1. Read 8 bytes. 2. Choose `stdout` or `stderr` depending on the first byte. 3. Extract the frame size from the last four bytes. 4. Read the extracted size and output it on the correct output. 5. Goto 1. ### Stream format when using a TTY When the TTY setting is enabled for the container, the stream is not multiplexed. The data exchanged over the hijacked connection is simply the raw data from the process PTY and client's `stdin`.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerAttachLibpodRequest
- Http Response Details
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
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- Parameters:
name- the name or id of the container (required)- Returns:
- APIcontainerChangesLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Array of Changes - 404 No such container - 500 Internal server error -
-
containerCheckpointLibpod
Checkpoint a container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerCheckpointLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 tarball is returned in body if exported - 404 No such container - 500 Internal server error -
-
containerCreateLibpod
Create a container- Parameters:
create- attributes for creating a container (required)- Returns:
- APIcontainerCreateLibpodRequest
- Http Response Details
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 -
-
containerDeleteLibpod
Delete container Delete container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerDeleteLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Remove Containers - 204 no error - 400 Bad parameter in request - 404 No such container - 409 Conflict error in operation - 500 Internal server error -
-
containerExistsLibpod
Check if container exists Quick way to determine if a container exists by name or ID- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerExistsLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 container exists - 404 No such container - 500 Internal server error -
-
containerExportLibpod
Export a container Export the contents of a container as a tarball.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerExportLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 tarball is returned in body - 404 No such container - 500 Internal server error -
-
containerHealthcheckLibpod
Run a container's healthcheck Execute the defined healthcheck and return information about the results- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerHealthcheckLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Healthcheck Results - 404 No such container - 409 container has no healthcheck or is not running - 500 Internal server error -
-
containerInitLibpod
Initialize a container Performs all tasks necessary for initializing the container but does not start the container.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerInitLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 304 container already initialized - 404 No such container - 500 Internal server error -
-
containerInspectLibpod
Inspect container Return low-level information about a container.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerInspectLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Inspect container - 404 No such container - 500 Internal server error -
-
containerKillLibpod
Kill container send a signal to a container, defaults to killing the container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerKillLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 404 No such container - 409 Conflict error in operation - 500 Internal server error -
-
containerListLibpod
List containers Returns a list of containers- Returns:
- APIcontainerListLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 List Containers - 400 Bad parameter in request - 500 Internal server error -
-
containerLogsLibpod
Get container logs Get stdout and stderr logs from a container. The stream format is the same as described in the attach endpoint.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerLogsLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 logs returned as a stream in response body. - 404 No such container - 500 Internal server error -
-
containerMountLibpod
Mount a container Mount a container to the filesystem- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerMountLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 mounted container - 404 No such container - 500 Internal server error -
-
containerPauseLibpod
Pause a container Use the cgroups freezer to suspend all processes in a container.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerPauseLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 404 No such container - 500 Internal server error -
-
containerPruneLibpod
Delete stopped containers Remove containers not in use- Returns:
- APIcontainerPruneLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Prune Containers - 500 Internal server error -
-
containerRenameLibpod
public ContainersApi.APIcontainerRenameLibpodRequest containerRenameLibpod(String name, String name2) Rename an existing container Change the name of an existing container.- Parameters:
name- Full or partial ID or full name of the container to rename (required)name2- New name for the container (required)- Returns:
- APIcontainerRenameLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 404 No such container - 409 Conflict error in operation - 500 Internal server error -
-
containerResizeLibpod
Resize a container's TTY Resize the terminal attached to a container (for use with Attach).- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerResizeLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Success - 404 No such container - 409 Conflict error in operation - 500 Internal server error -
-
containerRestartLibpod
Restart a container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerRestartLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 404 No such container - 500 Internal server error -
-
containerRestoreLibpod
Restore a container Restore a container from a checkpoint.- Parameters:
name- the name or id of the container (required)- Returns:
- APIcontainerRestoreLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 tarball is returned in body if exported - 404 No such container - 500 Internal server error -
-
containerShowMountedLibpod
Show mounted containers Lists all mounted containers mount points- Returns:
- APIcontainerShowMountedLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 mounted containers - 500 Internal server error -
-
containerStartLibpod
Start a container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerStartLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 304 Container already started - 404 No such container - 500 Internal server error -
-
containerStatsLibpod
Get stats for a container DEPRECATED. This endpoint will be removed with the next major release. Please use /libpod/containers/stats instead.- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerStatsLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 no error - 404 No such container - 409 Conflict error in operation - 500 Internal server error -
-
containerStopLibpod
Stop a container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerStopLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 304 Container already stopped - 404 No such container - 500 Internal server error -
-
containerTopLibpod
List processes List processes running inside a container- Parameters:
name- Name of container to query for processes (As of version 1.xx) (required)- Returns:
- APIcontainerTopLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 List processes in container - 404 No such container - 500 Internal server error -
-
containerUnmountLibpod
Unmount a container Unmount a container from the filesystem- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerUnmountLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 ok - 404 No such container - 500 Internal server error -
-
containerUnpauseLibpod
Unpause Container- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerUnpauseLibpodRequest
- Http Response Details
Status Code Description Response Headers 204 no error - 404 No such container - 500 Internal server error -
-
containerUpdateLibpod
Updates the configuration of an existing container, allowing changes to resource limits and healthchecks Updates the configuration of an existing container, allowing changes to resource limits and healthchecks.- Parameters:
name- Full or partial ID or full name of the container to update (required)- Returns:
- APIcontainerUpdateLibpodRequest
- Http Response Details
Status Code Description Response Headers 201 Update container - 400 Bad parameter in request - 404 No such container - 500 Internal server error -
-
containerWaitLibpod
Wait on a container Wait on a container to meet a given condition- Parameters:
name- the name or ID of the container (required)- Returns:
- APIcontainerWaitLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Status code - 404 No such container - 500 Internal server error -
-
containersStatsAllLibpod
Get stats for one or more containers Return a live stream of resource usage statistics of one or more container. If no container is specified, the statistics of all containers are returned.- Returns:
- APIcontainersStatsAllLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Get stats for one or more containers - 404 No such container - 500 Internal server error -
-
generateKubeLibpod
Generate a Kubernetes YAML file. Generate Kubernetes YAML based on a pod or container.- Parameters:
names- Name or ID of the container or pod. (required)- Returns:
- APIgenerateKubeLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Kubernetes YAML file describing pod - 500 Internal server error -
-
generateSystemdLibpod
Generate Systemd Units Generate Systemd Units based on a pod or container.- Parameters:
name- Name or ID of the container or pod. (required)- Returns:
- APIgenerateSystemdLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 no error - 500 Internal server error -
-
imageCommitLibpod
Commit Create a new image from a container- Parameters:
container- the name or ID of a container (required)- Returns:
- APIimageCommitLibpodRequest
- Http Response Details
Status Code Description Response Headers 201 no error - 404 No such image - 500 Internal server error -
-
kubeApplyLibpod
Apply a podman workload or Kubernetes YAML file. Deploy a podman container, pod, volume, or Kubernetes yaml to a Kubernetes cluster.- Returns:
- APIkubeApplyLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 Kubernetes YAML file successfully deployed to cluster - 500 Internal server error -
-
playKubeDownLibpod
Remove resources created from kube play Tears down pods, secrets, and volumes defined in a YAML file- Returns:
- APIplayKubeDownLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 PlayKube response - 500 Internal server error -
-
playKubeLibpod
Play a Kubernetes YAML file. Create and run pods based on a Kubernetes YAML file. ### Content-Type Then endpoint support two Content-Type - `plain/text` for yaml format - `application/x-tar` for sending context(s) required for building images #### Tar format The tar format must contain a `play.yaml` file at the root that will be used. If the file format requires context to build an image, it uses the image name and check for corresponding folder. For example, the client sends a tar file with the following structure: ``` └── content.tar ├── play.yaml └── foobar/ └── Containerfile ``` The `play.yaml` is the following, the `foobar` image means we are looking for a context with this name. ``` apiVersion: v1 kind: Pod metadata: name: demo-build-remote spec: containers: - name: container image: foobar ```- Returns:
- APIplayKubeLibpodRequest
- Http Response Details
Status Code Description Response Headers 200 PlayKube response - 500 Internal server error -
-
putContainerArchiveLibpod
public ContainersApi.APIputContainerArchiveLibpodRequest putContainerArchiveLibpod(String name, String path) Copy files into a container Copy a tar archive of files into a container- Parameters:
name- container name or id (required)path- Path to a directory in the container to extract (required)- Returns:
- APIputContainerArchiveLibpodRequest
- Http Response Details
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 -
-