- API-Referenz
- Projekt
- Get a Server
Get a Server
GET/v2/servers/{serverId}
API-Version
v2
Request-Methode
GET
Operation-ID
project-get-server
Request
- serverIdstringrequired
ID of the Server to be retrieved.
Responses
Format
application/json
Beschreibung
OK
- 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 (einer von: creating, ready, unready)deprecatedrequired
deprecated by property status
- shortIdstringrequired
- statisticsBaseDomainstring (hostname)
- statusstring (einer von: 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"
}
{
"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"
}
Format
application/json
Beschreibung
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"
}
}
}
Format
application/json
Beschreibung
The requested resource was not found
- 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"
}
}
}
Format
application/json
Beschreibung
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"
}
}
}
Format
application/json
Beschreibung
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/servers/string
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.getServer({
"serverId": "string"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Project\GetServer\GetServerRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetServerRequest(
serverId: "string"
));
$response = $client->project()->getServer($request);
var_dump($response->getBody();