From 3ba78ae086658d5da7b5522549ff6291e9143733 Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 18:54:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EPOST=20/service/{serviceid}/stop?= =?UTF-8?q?=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- POST-%2Fservice%2F%7Bserviceid%7D%2Fstop.md | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 POST-%2Fservice%2F%7Bserviceid%7D%2Fstop.md diff --git a/POST-%2Fservice%2F%7Bserviceid%7D%2Fstop.md b/POST-%2Fservice%2F%7Bserviceid%7D%2Fstop.md new file mode 100644 index 0000000..d01b4b7 --- /dev/null +++ b/POST-%2Fservice%2F%7Bserviceid%7D%2Fstop.md @@ -0,0 +1,79 @@ +## **POST /service/{serviceid}/stop** + + +## **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/stop', + CURLOPT_CUSTOMREQUEST => 'POST', + 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 POST 'control.local/api/v2/service/12345/stop' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK" +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **400** - Power off failed. Is the Server already powered off?