„GET /service/{serviceid}“ ändern

master
Thomas Brinkmann 3 years ago
parent 8c4e6e0795
commit 6056a583a3
  1. 221
      GET-%2Fservice%2F%7Bserviceid%7D.md

@ -31,3 +31,224 @@
|?limit | integer| Beschreibt die Anzahl der Elemente die pro Seite angezeigt werden sollen |?limit | integer| Beschreibt die Anzahl der Elemente die pro Seite angezeigt werden sollen
--- ---
### Beispiel Anfrage
##### PHP
```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'control.local/api/v2/service/12345',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-TOKEN: test-token',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```
##### cURL
```bash
curl --location --request GET 'control.local/api/v2/service/12345' \
--header 'X-TOKEN: test-token' \
--header 'Content-Type: application/json'
```
---
### Beispiel Antwort
```json
{
"status": "OK",
"totalResults": 1,
"items": [
{
"serviceid": 12345,
"product_id": 1,
"name": "KVM SSD Konfigurator Gen5",
"domain": "test02.deinserverhost.icu",
"dedicatedip": "0.0.0.0",
"assignedips": "\n::1",
"suspensionreason": "",
"firstpaymentamount": "0.00",
"recurringamount": "0.00",
"regdate": "2000-00-00",
"nextduedate": "2000-00-00",
"paymentmethod": "paysafecard",
"billingcycle": "Monthly",
"status": "Active",
"customfields": [
{
"id": 1,
"name": "VMID",
"translated_name": "VMID",
"value": "1530"
},
{
"id": 1,
"name": "Node",
"translated_name": "Node",
"value": "dsh1432"
},
{
"id": 1,
"name": "VLAN Tag",
"translated_name": "VLAN Tag",
"value": ""
},
{
"id": 1,
"name": "Username",
"translated_name": "Username",
"value": ""
},
{
"id": 1,
"name": "Backup Storage",
"translated_name": "Backup Storage",
"value": ""
},
{
"id": 1,
"name": "SSH Public Key",
"translated_name": "SSH Public Key",
"value": ""
},
{
"id": 1,
"name": "Cloud-Init User",
"translated_name": "Cloud-Init User",
"value": ""
},
{
"id": 1,
"name": "Cloud-Init Password",
"translated_name": "Cloud-Init Password",
"value": ""
}
],
"configoptions": [
{
"id": 1,
"option": "RAM",
"type": "dropdown",
"value": "1GB RAM"
},
{
"id": 1,
"option": "CPU Sockets",
"type": "quantity",
"value": 1
},
{
"id": 1,
"option": "CPU Weight For The VM",
"type": "quantity",
"value": 1000
},
{
"id": 1,
"option": "Limit Of CPU",
"type": "quantity",
"value": 0
},
{
"id": 1,
"option": "Xeon vCores",
"type": "quantity",
"value": 1
},
{
"id": 1,
"option": "SSD Speicher",
"type": "dropdown",
"value": "10GB"
},
{
"id": 1,
"option": "Additional Disks Space",
"type": "quantity",
"value": 0
},
{
"id": 1,
"option": "IPv4 Adresse/n",
"type": "quantity",
"value": 1
},
{
"id": 1,
"option": "IPv6 Adresse",
"type": "quantity",
"value": 1
},
{
"id": 1,
"option": "Backups Size",
"type": "quantity",
"value": 0
},
{
"id": 1,
"option": "Backup Files",
"type": "quantity",
"value": 0
},
{
"id": 1,
"option": "Traffic",
"type": "dropdown",
"value": "2TB Traffic inkl."
},
{
"id": 1,
"option": "Betriebssystem",
"type": "dropdown",
"value": "Ubuntu18-64Bit"
},
{
"id": 1,
"option": "Anbindung",
"type": "dropdown",
"value": "1GBit/s inkl. (Shared)"
},
{
"id": 1,
"option": "VCPUs",
"type": "dropdown",
"value": "Unlimited"
},
{
"id": 1,
"option": "ISO Image",
"type": "dropdown",
"value": "None"
},
{
"id": 1,
"option": "OS Type",
"type": "dropdown",
"value": "Unspecified OS"
}
]
}
]
}
```
### Mögliche Fehlermeldungen
> :warning: Status Code **403** - Permission denied
> :warning: Status Code **500** - Failed to fetch service details
> :warning: Status Code **400** - No matching service found
Loading…
Cancel
Save