Skip to content

Latest commit

 

History

History
398 lines (308 loc) · 14.2 KB

VolumesApi.md

File metadata and controls

398 lines (308 loc) · 14.2 KB

VolumesApi

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

volumeCreateLibpod

VolumeConfigResponse volumeCreateLibpod().create(create).execute();

Create a volume

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
create VolumeCreateOptions attributes for creating a volume [optional]

Return type

VolumeConfigResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-tar
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Volume details -
500 Internal server error -

volumeDeleteLibpod

volumeDeleteLibpod(name).force(force).execute();

Remove volume

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
name String the name or ID of the volume
force Boolean force removal [optional]

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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

volumeExistsLibpod(name).execute();

Volume exists

Check if a volume exists

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
name String the name of the volume

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 volume exists -
404 No such volume -
500 Internal server error -

volumeInspectLibpod

VolumeConfigResponse volumeInspectLibpod(name).execute();

Inspect volume

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
name String the name or ID of the volume

Return type

VolumeConfigResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Volume details -
404 No such volume -
500 Internal server error -

volumeListLibpod

List<VolumeConfigResponse> volumeListLibpod().filters(filters).execute();

List volumes

Returns a list of volumes

Example

// 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();
    }
  }
}

Parameters

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]

Return type

List<VolumeConfigResponse>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Volume list -
500 Internal server error -

volumePruneLibpod

List<PruneReport> volumePruneLibpod().filters(filters).execute();

Prune volumes

Example

// 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();
    }
  }
}

Parameters

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]

Return type

List<PruneReport>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Volume Prune -
500 Internal server error -