From d426f3a7eeab0c842422dd83c7a4cfe4b26a9d16 Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 19:17:25 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EGET=20/service/{serviceid}/templates?= =?UTF-8?q?=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GET-%2Fservice%2F%7Bserviceid%7D%2Ftemplates.md | 161 ++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 GET-%2Fservice%2F%7Bserviceid%7D%2Ftemplates.md diff --git a/GET-%2Fservice%2F%7Bserviceid%7D%2Ftemplates.md b/GET-%2Fservice%2F%7Bserviceid%7D%2Ftemplates.md new file mode 100644 index 0000000..b54331a --- /dev/null +++ b/GET-%2Fservice%2F%7Bserviceid%7D%2Ftemplates.md @@ -0,0 +1,161 @@ +## **GET /service/{serviceid}/templates** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|serviceid | integer| Beschreibt die ID des Services + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| - | - | - | + + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|-| -| - + + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/service/12345/reset', + 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/reset' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", + "totalResults": 25, + "page": 1, + "itemsPerPage": 10, + "maxPages": 3, + "items": [ + { + "id": 1, + "name": "AlmaLinux 8", + "architecture": "amd64", + "tags": "centos8 almalinux8 kickstart linux" + }, + { + "id": 2, + "name": "CentOS 6 (latest)", + "architecture": "amd64", + "tags": "centos6 kickstart linux centos" + }, + { + "id": 3, + "name": "CentOS 7 (latest)", + "architecture": "amd64", + "tags": "centos7 kickstart linux centos8" + }, + { + "id": 4, + "name": "CentOS 8 (latest)", + "architecture": "amd64", + "tags": "centos8 kickstart linux" + }, + { + "id": 5, + "name": "Debian Bullseye", + "architecture": "amd64", + "tags": "debian preseed linux apt-get debian_64bit" + }, + { + "id": 6, + "name": "Debian Buster", + "architecture": "amd64", + "tags": "debian preseed linux apt-get debian_64bit" + }, + { + "id": 7, + "name": "Debian Jessie", + "architecture": "amd64", + "tags": "debian preseed linux apt-get debian_64bit" + }, + { + "id": 8, + "name": "Debian Stretch", + "architecture": "amd64", + "tags": "debian preseed linux apt-get debian_64bit" + }, + { + "id": 9, + "name": "Debian Wheezy", + "architecture": "amd64", + "tags": "debian preseed linux apt-get debian_64bit" + }, + { + "id": 10, + "name": "FreeBSD 11.1", + "architecture": "amd64", + "tags": "freebsd freebsd11" + } + ] +} +``` + +```json +{ + "status": "OK", + "totalResults": 2, + "page": 1, + "itemsPerPage": 10, + "maxPages": 1, + "items": [ + "Debian10-64Bit", + "Debian11-64Bit" + ] +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **400** - Reset failed. Is the Server powered off? + +> :warning: Status Code **500** - Empty profile list \ No newline at end of file