From 0cd11f5465c35a64cf37ff7ebf2b486056c8e99f Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 18:25:51 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9Eget-service=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get-service.md | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 get-service.md diff --git a/get-service.md b/get-service.md new file mode 100644 index 0000000..0646fb2 --- /dev/null +++ b/get-service.md @@ -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 + '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. \ No newline at end of file