Alpenhost API Documentation

Alpenhost API Documentation

Welcome to the Alpenhost API documentation. This documentation will guide you through the available API endpoints and their expected request parameters and responses. The Alpenhost API allows you to manage servers, including server creation, listing, deletion, rebooting, shutting down, resetting, and creating backups.

Base URL

The base URL for all API requests is: https://api.alpenhost.at

Create a Server

Endpoint

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
        "type": "your_server_type",
        "hostname": "your_hostname",
        "password": "your_password",
        "os": "your_operating_system",
        "monitoring": "optional_monitoring_package",
        "ssh_key": "optional_ssh_key",
        "additional_vcpu": "optional_additional_vcpu",
        "additional_ram": "optional_additional_ram",
        "additional_ssd": "optional_additional_ssd",
        "additional_backup": "optional_additional_backup"
    }' \
    https://api.alpenhost.at/server/create
 

Parameters

  • type (string, required): The desired Alpenhost server type for the new server.
  • hostname (string, required): The desired hostname for the new server.
  • password (string, required): The password for the new server.
  • monitoring (string, optional): Choose Monitoring Package for the server.
  • os (string, required): The operating system for the new server.
  • ssh_key (string, optional): Authorize an SSH Key.
  • additional_vcpu (integer, optional): Additional virtual CPUs for the server (integer).
  • additional_ram (integer, optional): Additional RAM in gigabytes for the server (integer).
  • additional_ssd (integer, optional): Additional SSD storage in gigabytes for the server (integer).
  • additional_backup (integer, optional): Additional backup storage in gigabytes for the server (integer).

Response

{
  "success": true
}
 

List Servers

Endpoint

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
    https://api.alpenhost.at/servers/list
 

Response

An array of server objects, each containing the following information:

  • hostname (string): The hostname of the server.
  • os (string): The operating system of the server.
  • cpu (string): The CPU information of the server.
  • ram (integer): The RAM information of the server (in gigabytes).
  • status (string): The current status of the server.
  • ip (string): The public IP address of the server.

Response:

[
  {
    "hostname": "server1",
    "os": "Ubuntu 20.04",
    "cpu": 4,
    "ram": 16,
    "status": "Running",
    "ip": "203.0.113.1"
  },
  {
    "hostname": "server2",
    "os": "CentOS 7",
    "cpu": 2,
    "ram": 8,
    "status": "Stopped",
    "ip": "203.0.113.2"
  }
]
 

Server Metrics

Endpoint

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
    https://api.alpenhost.at/servers/{id}/metrics
 

Response

{
  "cpu_usage_percent": 35,
  "ram_usage_gb": 2.3,
  "disk_usage_gb": 84.2,
  "bandwith_usage_mb": 6276
}
 

Server Actions

Endpoint

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
    https://api.alpenhost.at/servers/{id}/{delete|reboot|stop|start|backup|snapshot|reinstall}
 

Response

{
  "success": true
}
 

Alpenhost

Endpoint

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
    https://api.alpenhost.at/ips/list
 

Response

[
  {
    "ip": "77.56.213.12",
    "used": false
  }
]
 
  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

So erstellen und löschen Sie Ihren API-Schlüssel im Alpenhost-Kundencenter

Titel: So erstellen und löschen Sie Ihren API-Schlüssel im Alpenhost-Kundencenter...