- API-Referenz
- Projekt
- List Projects belonging to the executing user
List Projects belonging to the executing user
Request
- customerIdstring
ID of the Organization to list Projects for.
- serverIdstring (uuid)
ID of the Server to list Projects for.
- searchTermstring
Search term to list Projects for. The fields id, shortId, and description are searchable.
- limitinteger (≥ 0)
The max count of resources to return in the list response.
- skipinteger
Number of items to skip. Should be multiple of
limit. - pageinteger (≥ 0)
Page to display.
skipandpageend up doing the same. If bothpageandskipare set, skip is used. - sortstring (einer von: createdAt, description)
Sort the result by this field.
- orderstring (einer von: asc, desc)
Should the result be sorted ascending or descending? Default ascending.
Responses
- 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.
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"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects?customerId=15b8a787-8d46-43b0-907e-01af35032c0a&serverId=f0f86186-0a5a-45b2-aa33-502777496347&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.listProjects({
"queryParameters": {
"customerId": "15b8a787-8d46-43b0-907e-01af35032c0a",
"serverId": "f0f86186-0a5a-45b2-aa33-502777496347",
"searchTerm": "string",
"limit": 50,
"page": 1,
"sort": "createdAt",
"order": "asc"
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Project\ListProjects\ListProjectsRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new ListProjectsRequest())
->withCustomerId("15b8a787-8d46-43b0-907e-01af35032c0a")
->withServerId("f0f86186-0a5a-45b2-aa33-502777496347")
->withSearchTerm("string")
->withLimit(50)
->withPage(1)
->withSort("createdAt")
->withOrder("asc");
$response = $client->project()->listProjects($request);
var_dump($response->getBody();