4 GET /service/{serviceid}
Thomas Brinkmann edited this page 2 years ago

GET /service/{serviceid}

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
?page integer Beschreibt die aktuelle Seitenzahl
?limit integer Beschreibt die Anzahl der Elemente die pro Seite angezeigt werden sollen

Beispiel Anfrage

PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.dsh.gg/api/v2/service/12345',
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'X-TOKEN: test-token',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
cURL
curl --location --request GET 'https://api.dsh.gg/api/v2/service/12345' \
--header 'X-TOKEN: test-token' \
--header 'Content-Type: application/json'

Beispiel Antwort

{
    "status": "OK",
    "totalResults": 1,
    "items": [
        {
            "serviceid": 12345,
            "product_id": 1,
            "name": "KVM SSD Konfigurator Gen5",
            "domain": "test02.deinserverhost.icu",
            "dedicatedip": "0.0.0.0",
            "assignedips": "\n::1",
            "suspensionreason": "",
            "firstpaymentamount": "0.00",
            "recurringamount": "0.00",
            "regdate": "2000-00-00",
            "nextduedate": "2000-00-00",
            "paymentmethod": "paysafecard",
            "billingcycle": "Monthly",
            "status": "Active",
            "customfields": [
                {
                    "id": 1,
                    "name": "VMID",
                    "translated_name": "VMID",
                    "value": "1530"
                },
                {
                    "id": 1,
                    "name": "Node",
                    "translated_name": "Node",
                    "value": "dsh1432"
                },
                {
                    "id": 1,
                    "name": "VLAN Tag",
                    "translated_name": "VLAN Tag",
                    "value": ""
                },
                {
                    "id": 1,
                    "name": "Username",
                    "translated_name": "Username",
                    "value": ""
                },
                {
                    "id": 1,
                    "name": "Backup Storage",
                    "translated_name": "Backup Storage",
                    "value": ""
                },
                {
                    "id": 1,
                    "name": "SSH Public Key",
                    "translated_name": "SSH Public Key",
                    "value": ""
                },
                {
                    "id": 1,
                    "name": "Cloud-Init User",
                    "translated_name": "Cloud-Init User",
                    "value": ""
                },
                {
                    "id": 1,
                    "name": "Cloud-Init Password",
                    "translated_name": "Cloud-Init Password",
                    "value": ""
                }
            ],
            "configoptions": [
                {
                    "id": 1,
                    "option": "RAM",
                    "type": "dropdown",
                    "value": "1GB RAM"
                },
                {
                    "id": 1,
                    "option": "CPU Sockets",
                    "type": "quantity",
                    "value": 1
                },
                {
                    "id": 1,
                    "option": "CPU Weight For The VM",
                    "type": "quantity",
                    "value": 1000
                },
                {
                    "id": 1,
                    "option": "Limit Of CPU",
                    "type": "quantity",
                    "value": 0
                },
                {
                    "id": 1,
                    "option": "Xeon vCores",
                    "type": "quantity",
                    "value": 1
                },
                {
                    "id": 1,
                    "option": "SSD Speicher",
                    "type": "dropdown",
                    "value": "10GB"
                },
                {
                    "id": 1,
                    "option": "Additional Disks Space",
                    "type": "quantity",
                    "value": 0
                },
                {
                    "id": 1,
                    "option": "IPv4 Adresse/n",
                    "type": "quantity",
                    "value": 1
                },
                {
                    "id": 1,
                    "option": "IPv6 Adresse",
                    "type": "quantity",
                    "value": 1
                },
                {
                    "id": 1,
                    "option": "Backups Size",
                    "type": "quantity",
                    "value": 0
                },
                {
                    "id": 1,
                    "option": "Backup Files",
                    "type": "quantity",
                    "value": 0
                },
                {
                    "id": 1,
                    "option": "Traffic",
                    "type": "dropdown",
                    "value": "2TB Traffic inkl."
                },
                {
                    "id": 1,
                    "option": "Betriebssystem",
                    "type": "dropdown",
                    "value": "Ubuntu18-64Bit"
                },
                {
                    "id": 1,
                    "option": "Anbindung",
                    "type": "dropdown",
                    "value": "1GBit/s inkl.  (Shared)"
                },
                {
                    "id": 1,
                    "option": "VCPUs",
                    "type": "dropdown",
                    "value": "Unlimited"
                },
                {
                    "id": 1,
                    "option": "ISO Image",
                    "type": "dropdown",
                    "value": "None"
                },
                {
                    "id": 1,
                    "option": "OS Type",
                    "type": "dropdown",
                    "value": "Unspecified OS"
                }
            ]
        }
    ]
}

Mögliche Fehlermeldungen

Status Code 403 - Permission denied

Status Code 500 - Failed to fetch service details

Status Code 400 - No matching service found