Zum Hauptinhalt springen

List Projects belonging to a Customer

GET/v2/customers/{customerId}/projects
API-Version
v2
Request-Methode
GET
Operation-ID
project-list-customer-projects

Request​

  • customerIdstringrequired

    ID of the Organization to list Projects 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
      • backupStorageUsageInBytesinteger (int64)required
      • backupStorageUsageInBytesSetAtstring (date-time)required
      • createdAtstring (date-time)required
      • customerIdstringrequired
      • customerMetaobjectrequired
        • idstringrequired
      • deletionRequestedbooleanrequired
      • descriptionstringrequired
      • disableReasonstring (einer von: maliciousCode, illegalContent, maliciousConduct, suspended)
      • disabledAtstring (date-time)
      • enabledbooleanrequired
      • featuresArray von string (einer von: redis, node, runtimeApps, container)deprecated

        Deprecated by 'supportedFeatures'.

        • Array[
          • *string (einer von: redis, node, runtimeApps, container)
          ]
      • idstringrequired
      • imageRefIdstring
      • isReadybooleandeprecatedrequired

        deprecated

      • primaryIpAddressesobject

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

        • v4string (ipv4)
        • v6string (ipv6)
      • projectHostingIdstring (uuid)
      • readinessstring (einer von: creating, ready, unready)deprecatedrequired

        deprecated by property status

      • serverGroupIdstringrequired
      • serverIdstring
      • serverShortIdstring
      • shortIdstringrequired
      • statusstring (einer von: pending, ready, preparingForVolumeMigration, migratingVolume, error, disabled)required
      • statusSetAtstring (date-time)required
      • supportedFeaturesArray von string (einer von: redis, node, runtimeApps, container)required
        • Array[
          • *string (einer von: redis, node, runtimeApps, container)
          ]
      • webStorageUsageInBytesinteger (int64)required
      • webStorageUsageInBytesSetAtstring (date-time)required
    ]
Content-Type: application/json

[
{
"backupStorageUsageInBytes": 123,
"backupStorageUsageInBytesSetAt": "1985-10-26T01:21:00.000Z",
"createdAt": "1985-10-26T01:21:00.000Z",
"customerId": "string",
"customerMeta": {
"id": "string"
},
"deletionRequested": true,
"description": "string",
"disableReason": "maliciousCode",
"disabledAt": "1985-10-26T01:21:00.000Z",
"enabled": true,
"id": "string",
"imageRefId": "string",
"primaryIpAddresses": {
"v4": "45.144.186.1",
"v6": "2a0f:d40:1::1"
},
"projectHostingId": "f0f86186-0a5a-45b2-aa33-502777496347",
"serverGroupId": "string",
"serverId": "string",
"serverShortId": "string",
"shortId": "string",
"status": "pending",
"statusSetAt": "1985-10-26T01:21:00.000Z",
"supportedFeatures": [
"redis"
],
"webStorageUsageInBytes": 123,
"webStorageUsageInBytesSetAt": "1985-10-26T01:21:00.000Z"
}
]
{
"items": {
"properties": {
"backupStorageUsageInBytes": {
"format": "int64",
"type": "integer"
},
"backupStorageUsageInBytesSetAt": {
"format": "date-time",
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"customerId": {
"type": "string"
},
"customerMeta": {
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"deletionRequested": {
"type": "boolean"
},
"description": {
"type": "string"
},
"disableReason": {
"enum": [
"maliciousCode",
"illegalContent",
"maliciousConduct",
"suspended"
],
"type": "string"
},
"disabledAt": {
"format": "date-time",
"type": "string"
},
"enabled": {
"type": "boolean"
},
"features": {
"deprecated": true,
"description": "Deprecated by 'supportedFeatures'.",
"items": {
"enum": [
"redis",
"node",
"runtimeApps",
"container"
],
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"imageRefId": {
"type": "string"
},
"isReady": {
"deprecated": true,
"description": "deprecated",
"type": "boolean"
},
"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"
},
"projectHostingId": {
"format": "uuid",
"type": "string"
},
"readiness": {
"deprecated": true,
"description": "deprecated by property status",
"enum": [
"creating",
"ready",
"unready"
],
"type": "string"
},
"serverGroupId": {
"type": "string"
},
"serverId": {
"type": "string"
},
"serverShortId": {
"type": "string"
},
"shortId": {
"type": "string"
},
"status": {
"enum": [
"pending",
"ready",
"preparingForVolumeMigration",
"migratingVolume",
"error",
"disabled"
],
"type": "string"
},
"statusSetAt": {
"format": "date-time",
"type": "string"
},
"supportedFeatures": {
"items": {
"enum": [
"redis",
"node",
"runtimeApps",
"container"
],
"type": "string"
},
"type": "array"
},
"webStorageUsageInBytes": {
"format": "int64",
"type": "integer"
},
"webStorageUsageInBytesSetAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"shortId",
"description",
"enabled",
"customerMeta",
"customerId",
"createdAt",
"isReady",
"readiness",
"status",
"statusSetAt",
"webStorageUsageInBytes",
"webStorageUsageInBytesSetAt",
"backupStorageUsageInBytes",
"backupStorageUsageInBytesSetAt",
"supportedFeatures",
"serverGroupId",
"deletionRequested"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/customers/15b8a787-8d46-43b0-907e-01af35032c0a/projects?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.listCustomerProjects({
"customerId": "15b8a787-8d46-43b0-907e-01af35032c0a",
"queryParameters": {
"searchTerm": "string",
"limit": 50,
"page": 1,
"sort": "createdAt",
"order": "asc"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Project\ListCustomerProjects\ListCustomerProjectsRequest;

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

$request = (new ListCustomerProjectsRequest(
customerId: "15b8a787-8d46-43b0-907e-01af35032c0a"
))
->withSearchTerm("string")
->withLimit(50)
->withPage(1)
->withSort("createdAt")
->withOrder("asc");
$response = $client->project()->listCustomerProjects($request);

var_dump($response->getBody();

Auf dieser Seite