„GET /service/{serviceid}/templates“ ändern

master
Thomas Brinkmann 3 years ago
parent 4b8e2902eb
commit d426f3a7ee
  1. 161
      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
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '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
Loading…
Cancel
Save