Zum Hauptinhalt springen

List Volumes belonging to a Project

GET/v2/projects/{projectId}/volumes
API-Version
v2
Request-Methode
GET
Operation-ID
container-list-volumes

Request​

  • projectIdstringrequired

    ID of the Project to list Volumes for.

Responses​

Response-Header
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Beschreibung

OK

  • Array[
    • *object
      • idstring (uuid)required
      • linkedServicesArray von string (uuid)
        • Array[
          • *string (uuid)
          ]
      • namestringrequired
      • orphanedbooleanrequired

        Whether no service of the Stack mounts this Volume. An orphaned Volume still belongs to its Stack and keeps its data until it is deleted explicitly using DELETE /v2/stacks/{stackId}/volumes/{volumeId}.

      • stackIdstring (uuid)required
      • storageUsageInBytesinteger (int64)required
      • storageUsageInBytesSetAtstring (date-time)required
    ]
Content-Type: application/json

[
{
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"linkedServices": [
"f0f86186-0a5a-45b2-aa33-502777496347"
],
"name": "string",
"orphaned": true,
"stackId": "f0f86186-0a5a-45b2-aa33-502777496347",
"storageUsageInBytes": 123,
"storageUsageInBytesSetAt": "1985-10-26T01:21:00.000Z"
}
]
{
"items": {
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"linkedServices": {
"items": {
"format": "uuid",
"type": "string"
},
"type": "array"
},
"name": {
"type": "string"
},
"orphaned": {
"description": "Whether no service of the Stack mounts this Volume. An orphaned Volume still belongs to its Stack and keeps its data until it is deleted explicitly using `DELETE /v2/stacks/{stackId}/volumes/{volumeId}`.\n",
"type": "boolean"
},
"stackId": {
"format": "uuid",
"type": "string"
},
"storageUsageInBytes": {
"format": "int64",
"type": "integer"
},
"storageUsageInBytesSetAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"stackId",
"name",
"orphaned",
"storageUsageInBytes",
"storageUsageInBytesSetAt"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/string/volumes?stackId=f0f86186-0a5a-45b2-aa33-502777496347&searchTerm=string&sortOrder=nameAsc&limit=50&page=1
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.container.listVolumes({
"projectId": "string",
"queryParameters": {
"stackId": "f0f86186-0a5a-45b2-aa33-502777496347",
"searchTerm": "string",
"sortOrder": "nameAsc",
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Container\ListVolumes\ListVolumesRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ListVolumesRequest(
projectId: "string"
))
->withStackId("f0f86186-0a5a-45b2-aa33-502777496347")
->withSearchTerm("string")
->withSortOrder("nameAsc")
->withLimit(50)
->withPage(1);
$response = $client->container()->listVolumes($request);

var_dump($response->getBody();

Auf dieser Seite