Skip to main content

List Servers belonging to the executing user

GET/v2/servers
API version
v2
Request method
GET
Operation ID
project-list-servers

Request​

Responses​

Response headers
  • 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
Description

OK

  • Array[
    • *object
      • clusterNamestringrequired
      • createdAtstring (date-time)required
      • customerIdstringrequired
      • descriptionstringrequired
      • disabledReason"suspended"
      • groupIdstringrequired
      • idstring (uuid)required
      • imageRefIdstring (uuid)
      • isReadybooleandeprecatedrequired

        deprecated by property status

      • machineTypeobjectrequired
        • cpustringrequired
        • memorystringrequired
        • namestringrequired
      • primaryIpAddressesobject

        Primary public IP addresses of the Server, one per address family.

        • v4string (ipv4)
        • v6string (ipv6)
      • readinessstring (one of: creating, ready, unready)deprecatedrequired

        deprecated by property status

      • shortIdstringrequired
      • statisticsBaseDomainstring (hostname)
      • statusstring (one of: pending, ready, unready, suspended, migrating)required
      • storagestringrequired
    ]
Content-Type: application/json

[
{
"clusterName": "string",
"createdAt": "1985-10-26T01:21:00.000Z",
"customerId": "673c107f-75e1-451c-8eaa-5bf101bd2b2c",
"description": "My first Server!",
"disabledReason": "suspended",
"groupId": "string",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"imageRefId": "f0f86186-0a5a-45b2-aa33-502777496347",
"machineType": {
"cpu": "2",
"memory": "4Gi",
"name": "shared.large"
},
"primaryIpAddresses": {
"v4": "45.144.186.1",
"v6": "2a0f:d40:1::1"
},
"shortId": "s-4e7tz3",
"statisticsBaseDomain": "pe-prod.staging.mcloud.services",
"status": "pending",
"storage": "50Gi"
}
]
{
"items": {
"properties": {
"clusterName": {
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"customerId": {
"example": "673c107f-75e1-451c-8eaa-5bf101bd2b2c",
"type": "string"
},
"description": {
"example": "My first Server!",
"type": "string"
},
"disabledReason": {
"enum": [
"suspended"
],
"type": "string"
},
"groupId": {
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"imageRefId": {
"format": "uuid",
"type": "string"
},
"isReady": {
"deprecated": true,
"description": "deprecated by property status",
"type": "boolean"
},
"machineType": {
"properties": {
"cpu": {
"example": "2",
"type": "string"
},
"memory": {
"example": "4Gi",
"type": "string"
},
"name": {
"example": "shared.large",
"type": "string"
}
},
"required": [
"name",
"cpu",
"memory"
],
"type": "object"
},
"primaryIpAddresses": {
"description": "Primary public IP addresses of the Server, one per address family.",
"properties": {
"v4": {
"example": "45.144.186.1",
"format": "ipv4",
"type": "string"
},
"v6": {
"example": "2a0f:d40:1::1",
"format": "ipv6",
"type": "string"
}
},
"type": "object"
},
"readiness": {
"deprecated": true,
"description": "deprecated by property status",
"enum": [
"creating",
"ready",
"unready"
],
"type": "string"
},
"shortId": {
"example": "s-4e7tz3",
"type": "string"
},
"statisticsBaseDomain": {
"example": "pe-prod.staging.mcloud.services",
"format": "hostname",
"type": "string"
},
"status": {
"enum": [
"pending",
"ready",
"unready",
"suspended",
"migrating"
],
"type": "string"
},
"storage": {
"example": "50Gi",
"type": "string"
}
},
"required": [
"id",
"shortId",
"customerId",
"machineType",
"storage",
"description",
"isReady",
"readiness",
"createdAt",
"clusterName",
"status",
"groupId"
],
"type": "object"
},
"type": "array"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/servers?customerId=string&searchTerm=string&limit=50&page=1&sort=createdAt&order=asc
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.project.listServers({
"queryParameters": {
"customerId": "string",
"searchTerm": "string",
"limit": 50,
"page": 1,
"sort": "createdAt",
"order": "asc"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Project\ListServers\ListServersRequest;

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

$request = (new ListServersRequest())
->withCustomerId("string")
->withSearchTerm("string")
->withLimit(50)
->withPage(1)
->withSort("createdAt")
->withOrder("asc");
$response = $client->project()->listServers($request);

var_dump($response->getBody();

On this page