All URIs are relative to http://podman.io
Method | HTTP request | Description |
---|---|---|
volumeCreateLibpod | POST /libpod/volumes/create | Create a volume |
volumeDeleteLibpod | DELETE /libpod/volumes/{name} | Remove volume |
volumeExistsLibpod | GET /libpod/volumes/{name}/exists | Volume exists |
volumeInspectLibpod | GET /libpod/volumes/{name}/json | Inspect volume |
volumeListLibpod | GET /libpod/volumes/json | List volumes |
volumePruneLibpod | POST /libpod/volumes/prune | Prune volumes |
VolumeConfigResponse volumeCreateLibpod().create(create).execute();
Create a volume
// 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.VolumesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
VolumesApi apiInstance = new VolumesApi(defaultClient);
VolumeCreateOptions create = new VolumeCreateOptions(); // VolumeCreateOptions | attributes for creating a volume
try {
VolumeConfigResponse result = apiInstance.volumeCreateLibpod()
.create(create)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VolumesApi#volumeCreateLibpod");
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 |
---|---|---|---|
create | VolumeCreateOptions | attributes for creating a volume | [optional] |
No authorization required
- Content-Type: application/json, application/x-tar
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Volume details | - |
500 | Internal server error | - |
volumeDeleteLibpod(name).force(force).execute();
Remove volume
// 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.VolumesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
VolumesApi apiInstance = new VolumesApi(defaultClient);
String name = "name_example"; // String | the name or ID of the volume
Boolean force = true; // Boolean | force removal
try {
apiInstance.volumeDeleteLibpod(name)
.force(force)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling VolumesApi#volumeDeleteLibpod");
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 volume | |
force | Boolean | force removal | [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 volume | - |
409 | Volume is in use and cannot be removed | - |
500 | Internal server error | - |
volumeExistsLibpod(name).execute();
Volume exists
Check if a volume exists
// 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.VolumesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
VolumesApi apiInstance = new VolumesApi(defaultClient);
String name = "name_example"; // String | the name of the volume
try {
apiInstance.volumeExistsLibpod(name)
.execute();
} catch (ApiException e) {
System.err.println("Exception when calling VolumesApi#volumeExistsLibpod");
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 of the volume |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | volume exists | - |
404 | No such volume | - |
500 | Internal server error | - |
VolumeConfigResponse volumeInspectLibpod(name).execute();
Inspect volume
// 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.VolumesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
VolumesApi apiInstance = new VolumesApi(defaultClient);
String name = "name_example"; // String | the name or ID of the volume
try {
VolumeConfigResponse result = apiInstance.volumeInspectLibpod(name)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VolumesApi#volumeInspectLibpod");
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 volume |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Volume details | - |
404 | No such volume | - |
500 | Internal server error | - |
List<VolumeConfigResponse> volumeListLibpod().filters(filters).execute();
List volumes
Returns a list of volumes
// 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.VolumesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
VolumesApi apiInstance = new VolumesApi(defaultClient);
String filters = "filters_example"; // String | JSON encoded value of the filters (a map[string][]string) to process on the volumes list. Available filters: - driver=<volume-driver-name> Matches volumes based on their driver. - label=<key> or label=<key>:<value> Matches volumes based on the presence of a label alone or a label and a value. - name=<volume-name> Matches all of volume name. - opt=<driver-option> Matches a storage driver options - `until=<timestamp>` List volumes 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.
try {
List<VolumeConfigResponse> result = apiInstance.volumeListLibpod()
.filters(filters)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VolumesApi#volumeListLibpod");
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 | JSON encoded value of the filters (a map[string][]string) to process on the volumes list. Available filters: - driver=<volume-driver-name> Matches volumes based on their driver. - label=<key> or label=<key>:<value> Matches volumes based on the presence of a label alone or a label and a value. - name=<volume-name> Matches all of volume name. - opt=<driver-option> Matches a storage driver options - `until=<timestamp>` List volumes 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. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Volume list | - |
500 | Internal server error | - |
List<PruneReport> volumePruneLibpod().filters(filters).execute();
Prune volumes
// 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.VolumesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://podman.io");
VolumesApi apiInstance = new VolumesApi(defaultClient);
String filters = "filters_example"; // String | JSON encoded value of filters (a map[string][]string) to match volumes against before pruning. Available filters: - `until=<timestamp>` Prune volumes 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 volumes with (or without, in case `label!=...` is used) the specified labels.
try {
List<PruneReport> result = apiInstance.volumePruneLibpod()
.filters(filters)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling VolumesApi#volumePruneLibpod");
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 | JSON encoded value of filters (a map[string][]string) to match volumes against before pruning. Available filters: - `until=<timestamp>` Prune volumes 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 volumes 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 | Volume Prune | - |
500 | Internal server error | - |