parent
4df68195f3
commit
0cd11f5465
1 changed files with 205 additions and 0 deletions
@ -0,0 +1,205 @@ |
|||||||
|
## **GET /service - Ruft alle Services ab** |
||||||
|
|
||||||
|
|
||||||
|
## **Inhalt** |
||||||
|
--- |
||||||
|
- Parameter |
||||||
|
- Optionale Parameter |
||||||
|
- Beispiel Anfrage |
||||||
|
- Beispiel Antwort |
||||||
|
- Mögliche Fehlermeldungen |
||||||
|
--- |
||||||
|
|
||||||
|
### Parameter |
||||||
|
|
||||||
|
Es sind keine Parameter notwendig. |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### Optionale Parameter |
||||||
|
|
||||||
|
|Parameter | Typ | Beschreibung| |
||||||
|
|----------|-----|-------------| |
||||||
|
|?page | integer| Beschreibt die aktuelle Seitenzahl |
||||||
|
|?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?page=1&limit=10', |
||||||
|
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?page=1&limit=10' \ |
||||||
|
--header 'X-TOKEN: test-token' \ |
||||||
|
--header 'Content-Type: application/json' |
||||||
|
``` |
||||||
|
--- |
||||||
|
|
||||||
|
### Beispiel Antwort |
||||||
|
|
||||||
|
```json |
||||||
|
{ |
||||||
|
"status": "OK", |
||||||
|
"totalResults": 40, |
||||||
|
"page": 1, |
||||||
|
"itemsPerPage": 10, |
||||||
|
"maxPages": 4, |
||||||
|
"items": [ |
||||||
|
{ |
||||||
|
"serviceid": 12345, |
||||||
|
"product_id": 1, |
||||||
|
"name": "VPS 2G", |
||||||
|
"domain": "", |
||||||
|
"dedicatedip": "x.x.x.x", |
||||||
|
"assignedips": "", |
||||||
|
"suspensionreason": "", |
||||||
|
"firstpaymentamount": "0.00", |
||||||
|
"recurringamount": "0.00", |
||||||
|
"regdate": "2000-00-00", |
||||||
|
"nextduedate": "2000-00-00", |
||||||
|
"paymentmethod": "paypal", |
||||||
|
"billingcycle": "Monthly", |
||||||
|
"status": "Active", |
||||||
|
"customfields": [], |
||||||
|
"configoptions": [ |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "CPU", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "4vCores" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "RAM", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "2048MB" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Speicherplatz", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "100GB HDD" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Betriebssystem", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "Windows Server 2012 R2" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Anbindung", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "1Gbit/s" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "DDoS Protection", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "inklusive" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Standort", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "Frankfurt am Main" |
||||||
|
} |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"serviceid": 1234, |
||||||
|
"product_id": 1, |
||||||
|
"name": "RS Big 2020", |
||||||
|
"domain": "test.server", |
||||||
|
"dedicatedip": "x.x.x.x", |
||||||
|
"assignedips": "x.x.x.x", |
||||||
|
"suspensionreason": "", |
||||||
|
"firstpaymentamount": "0.00", |
||||||
|
"recurringamount": "0.00", |
||||||
|
"regdate": "2000-00-00", |
||||||
|
"nextduedate": "2022-00-00", |
||||||
|
"paymentmethod": "paypal", |
||||||
|
"billingcycle": "Monthly", |
||||||
|
"status": "Active", |
||||||
|
"customfields": [], |
||||||
|
"configoptions": [ |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "CPU Cores", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "3 Cores Intel Xeon" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Arbeitsspeicher (GB)", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "13GB ECC RAM" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "SSD Speicherplatz", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "150GB SSD" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "IPv4 Adressen", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "1 IPv4 Adresse" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "IPv6 Adressen", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "keine IPv6 Adresse" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Traffic", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "Unlimited Flat - FairUse" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Betriebssystem", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "Ubuntu18-64Bit" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"id": 1, |
||||||
|
"option": "Backup Slots", |
||||||
|
"type": "dropdown", |
||||||
|
"value": "2 Backup Slots" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### Mögliche Fehlermeldungen |
||||||
|
|
||||||
|
> :warning: Status Code **500** Failed to fetch service details. |
Loading…
Reference in new issue