Skip to main content

Get a Volume belonging to a Stack

GET/v2/stacks/{stackId}/volumes/{volumeId}
API version
v2
Request method
GET
Operation ID
container-get-volume

Request​

  • stackIdstring (uuid)required

    ID of the Stack the Volume belongs to.

  • volumeIdstring (uuid)required

    ID of the Volume to be retrieved.

Responses​

Format
application/json
Description

OK

  • idstring (uuid)required
  • linkedServicesarray of 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"
}
{
"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"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/stacks/f0f86186-0a5a-45b2-aa33-502777496347/volumes/f0f86186-0a5a-45b2-aa33-502777496347
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.getVolume({
"stackId": "f0f86186-0a5a-45b2-aa33-502777496347",
"volumeId": "f0f86186-0a5a-45b2-aa33-502777496347"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Container\GetVolume\GetVolumeRequest;

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

$request = (new GetVolumeRequest(
stackId: "f0f86186-0a5a-45b2-aa33-502777496347",
volumeId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->container()->getVolume($request);

var_dump($response->getBody();

On this page