ghostcompiler / hetzner-cloud
Hetzner Cloud PHP SDK
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^10.5
README
PHP library for the Hetzner Cloud API. HTTP is done with PHP’s curl extension only (no PECL http, no Guzzle, no stream wrappers), so you avoid common extension clashes across PHP installs.
Official OpenAPI description: cloud.spec.json.
Architecture diagram
Requirements
- PHP 8.1+ (works on current releases including 8.5+). PHP 7.4 and PHP 8.0 are not supported — the library uses PHP 8.1 syntax (
readonlyproperties, constructor property promotion, union types, and similar). - Extensions:
curl,json
Installation
composer require ghostcompiler/hetzner-cloud
Or add the path repository if you develop locally:
{
"repositories": [{ "type": "path", "url": "../hetzner" }],
"require": { "ghostcompiler/hetzner-cloud": "*" }
}
Quick start
<?php require __DIR__ . '/vendor/autoload.php'; use Ghostcompiler\Hetzner\HetznerClient; use Ghostcompiler\Hetzner\ApiException; $token = getenv('HETZNER_TOKEN') ?: ''; $hc = new HetznerClient($token); try { $data = $hc->locations->listLocations(); // $data is the decoded JSON root, e.g. [ 'locations' => [...], 'meta' => [...] ] } catch (ApiException $e) { echo $e->getMessage(), ' (HTTP ', $e->getHttpStatus(), ")\n"; if ($e->getApiErrorCode()) { echo 'API code: ', $e->getApiErrorCode(), "\n"; } }
Optional base URL
For testing or proxies, pass a second argument:
$hc = new HetznerClient($token, 'https://api.hetzner.cloud/v1');
Testing (PHPUnit)
Install dev dependencies, then run the default suite (no real API calls):
composer install composer test # same as: ./vendor/bin/phpunit
By default, integration tests that call Hetzner are excluded. To run them, set a project API token and enable the group:
export HETZNER_TOKEN='your-token-here' ./vendor/bin/phpunit --group integration
Interactive demo (browser)
The demo/ folder is a single-page explorer (uses a little JavaScript for fetch + copy):
- Enter your API token once at the top (optional Save in browser →
localStorage). - Expand any resource client — every public method is listed with an official summary, HTTP verb, path, and a short description (from Hetzner’s OpenAPI spec), plus usage hints.
- Adjust parameters (JSON in textareas for
query/body/ids, etc.), click Run for a live call viademo/api.php. - Copy response copies the full JSON (success or error). The page uses the Clipboard API when the browser reports a secure context (HTTPS, or
http://localhost/http://127.0.0.1with the built-in server). In other cases (for example plain HTTP to a hostname that is not treated as local), it falls back to a hiddentextareaanddocument.execCommand('copy'). If automatic copy still fails, an alert asks you to select the response text and use Cmd+C (macOS) or Ctrl+C (Windows/Linux).
Use the search box to filter clients/methods by name.
Security: local use only; do not expose demo/ on a public server.
Tip: Run the demo with php -S 127.0.0.1:8080 -t demo (or localhost) so clipboard-friendly origins match what browsers expect. Keep display_errors off in production PHP configs that serve JSON APIs — PHP warnings in the output break JSON.parse in the demo.
From the repository root:
composer install php -S 127.0.0.1:8080 -t demo
Open http://127.0.0.1:8080 in your browser.
Method reference (every command, with descriptions)
This README includes an “All functions (usage)” section (PHP signatures + HTTP + path + summary). docs/METHOD_REFERENCE.md lists the same methods with longer descriptions, aligned with the Hetzner Cloud OpenAPI spec. The interactive demo reads summaries from demo/includes/method_summaries.json.
How requests are built
flowchart LR app[Your_code] facade[HetznerClient] sub[Resource_clients] curl[CurlTransport] api[api.hetzner.cloud] app --> facade facade --> sub sub --> curl curl --> apiLoading
- You call a method on a resource client (for example
$hc->servers->listServers()). - The client builds a path and query/body and delegates to
CurlTransport. - cURL sends HTTPS with
Authorization: Bearer <token>andAccept: application/json. - On HTTP 2xx, the JSON body is decoded to a PHP
arrayand returned. - On HTTP 4xx/5xx or cURL failure, an
ApiExceptionis thrown.
cURL lifecycle (PHP 8+): From PHP 8.0, curl_init() returns a CurlHandle object that is freed when it goes out of scope. CurlTransport therefore does not call curl_close() on PHP 8.0 and later, which avoids the PHP 8.5 deprecation (curl_close() is a no-op since 8.0 and triggers notices in 8.5+). Those notices are especially harmful when display_errors is on, because they prepend HTML to JSON responses. The same helper still calls curl_close() only on PHP 7.x for legacy resource handles; this package’s Composer requirement is PHP 8.1+, so installs use the 8+ code path only.
Authentication
Create a token in the Hetzner Cloud Console under your project: Security → API Tokens. Pass it as the first constructor argument. Tokens are scoped to one project.
Pagination, sorting, filters
List endpoints accept an optional $query array. Keys are sent as query parameters. Array values become repeated keys (for example multiple sort or id values):
$hc->servers->listServers([ 'page' => 1, 'per_page' => 50, 'label_selector' => 'env=production', 'sort' => ['name:asc', 'id:desc'], ]);
See the official docs for each resource’s supported query parameters.
Rate limiting
Successful responses include headers such as RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset. This library throws on error status codes before you would read those headers on success responses. For advanced use, you could extend CurlTransport to expose full responses; by default resource methods return only the decoded JSON body as an array.
Errors
Failures throw Ghostcompiler\Hetzner\ApiException:
| Method | Meaning |
|---|---|
getMessage() |
Human-readable message (from API when available) |
getHttpStatus() |
HTTP status code |
getApiError() |
Full error object from JSON, if present |
getApiErrorCode() |
Short machine code, e.g. invalid_input |
getResponseHeaders() |
Parsed response headers (lowercase names) |
Error format reference: Hetzner API — Errors.
Important: global Actions list
GET /actions no longer lists all actions. You must pass one or more action IDs as repeated id query parameters. Use ActionsClient::getActions():
$hc->actions->getActions([1001, 1002], ['per_page' => 25]);
Resource clients and methods
Each method maps to one HTTP call. Bodies are PHP array values shaped like the JSON in the official API docs. Many POST actions send an empty JSON object {} internally when no fields are required.
Extended descriptions for each method: docs/METHOD_REFERENCE.md and the interactive demo. The complete PHP usage table (signatures + HTTP + path + summary) is in the next section.
What each HetznerClient property is for
| Property | PHP class | Purpose |
|---|---|---|
actions |
ActionsClient |
Fetch asynchronous Action objects (tasks) by id; global listing was removed by Hetzner—see note above. |
certificates |
CertificatesClient |
TLS certificates (uploaded PEM or managed Let's Encrypt via Hetzner DNS). |
datacenters |
DatacentersClient |
List datacenters (where servers can run). |
firewalls |
FirewallsClient |
Firewalls: rules, attach/detach to servers, etc. |
floatingIps |
FloatingIpsClient |
Floating IPv4/IPv6 addresses and assign/unassign to servers. |
images |
ImagesClient |
Images (OS, snapshots, backups): list, update labels, delete, protection. |
isos |
IsosClient |
ISO images for manual OS installs. |
loadBalancers |
LoadBalancersClient |
Load balancers, targets, services, networks, metrics. |
loadBalancerTypes |
LoadBalancerTypesClient |
Available load balancer product types and pricing hints. |
locations |
LocationsClient |
Locations (cities/regions) and metadata. |
networks |
NetworksClient |
Private networks, subnets, routes, vswitch coupling. |
placementGroups |
PlacementGroupsClient |
Placement groups (e.g. spread VMs across hardware). |
pricing |
PricingClient |
List prices for resource types in the project currency. |
primaryIps |
PrimaryIpsClient |
Primary IPs bound to a location; assign to servers. |
servers |
ServersClient |
Servers (VMs): CRUD, power, rescue, backups, networks, metrics, etc. |
serverTypes |
ServerTypesClient |
Server plans (cx22, …) and pricing hints. |
sshKeys |
SshKeysClient |
SSH public keys injected at server create. |
volumes |
VolumesClient |
Volumes (block storage): attach, detach, resize. |
zones |
ZonesClient |
DNS zones and RRsets (records) on Hetzner nameservers. |
Code examples
Create a server, manage DNS, TLS, and load balancer (field names must match the official API):
$hc->servers->createServer([ 'name' => 'app-1', 'server_type' => 'cx22', 'image' => 'ubuntu-22.04', 'location' => 'nbg1', 'ssh_keys' => [123456], ]); $hc->servers->poweronServer(42); $hc->certificates->createCertificate([ 'name' => 'api-cert', 'type' => 'managed', 'domain_names' => ['api.example.com'], ]); $hc->loadBalancers->createLoadBalancer([ 'name' => 'lb1', 'load_balancer_type' => 'lb11', 'location' => 'nbg1', 'network' => 12345, 'services' => [], 'targets' => [], ]); $hc->zones->listZones(); $hc->zones->getZoneRrset('example.com', '@', 'A'); $hc->zones->setZoneRrsetRecords('example.com', 'www', 'A', [ 'records' => [['value' => '1.2.3.4']], ]);
All functions (usage)
Each call returns a decoded JSON array (the API response root). Throws Ghostcompiler\Hetzner\ApiException on HTTP errors.
Pattern: $hc->{client}->{methodName}(...arguments...) where {client} is a property of HetznerClient.
actions — ActionsClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->actions->getAction(string |
int $id) | GET | /actions/{id} |
$hc->actions->getActions(array $ids, array $extra = []) |
GET | /actions |
Get multiple Actions |
certificates — CertificatesClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->certificates->createCertificate(array $body) |
POST | /certificates |
Create a Certificate |
$hc->certificates->deleteCertificate(string |
int $id) | DELETE | /certificates/{id} |
$hc->certificates->getCertificate(string |
int $id) | GET | /certificates/{id} |
$hc->certificates->getCertificateAction(string |
int $id, string | int $actionId) | GET |
$hc->certificates->getCertificatesAction(string |
int $id) | GET | /certificates/actions/{id} |
$hc->certificates->listCertificateActions(string |
int $id, array $query = []) | GET | /certificates/{id}/actions |
$hc->certificates->listCertificates(array $query = []) |
GET | /certificates |
List Certificates |
$hc->certificates->listCertificatesActions(array $query = []) |
GET | /certificates/actions |
List Actions |
$hc->certificates->retryCertificate(string |
int $id) | POST | /certificates/{id}/actions/retry |
$hc->certificates->updateCertificate(string |
int $id, array $body) | PUT | /certificates/{id} |
datacenters — DatacentersClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->datacenters->getDatacenter(string |
int $id) | GET | /datacenters/{id} |
$hc->datacenters->listDatacenters(array $query = []) |
GET | /datacenters |
List Data Centers |
firewalls — FirewallsClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->firewalls->applyFirewallToResources(string |
int $id, array $body) | POST | /firewalls/{id}/actions/apply_to_resources |
$hc->firewalls->createFirewall(array $body) |
POST | /firewalls |
Create a Firewall |
$hc->firewalls->deleteFirewall(string |
int $id) | DELETE | /firewalls/{id} |
$hc->firewalls->getFirewall(string |
int $id) | GET | /firewalls/{id} |
$hc->firewalls->getFirewallAction(string |
int $id, string | int $actionId) | GET |
$hc->firewalls->getFirewallsAction(string |
int $id) | GET | /firewalls/actions/{id} |
$hc->firewalls->listFirewallActions(string |
int $id, array $query = []) | GET | /firewalls/{id}/actions |
$hc->firewalls->listFirewalls(array $query = []) |
GET | /firewalls |
List Firewalls |
$hc->firewalls->listFirewallsActions(array $query = []) |
GET | /firewalls/actions |
List Actions |
$hc->firewalls->removeFirewallFromResources(string |
int $id, array $body) | POST | /firewalls/{id}/actions/remove_from_resources |
$hc->firewalls->setFirewallRules(string |
int $id, array $body) | POST | /firewalls/{id}/actions/set_rules |
$hc->firewalls->updateFirewall(string |
int $id, array $body) | PUT | /firewalls/{id} |
floatingIps — FloatingIpsClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->floatingIps->assignFloatingIp(string |
int $id, array $body) | POST | /floating_ips/{id}/actions/assign |
$hc->floatingIps->changeFloatingIpDnsPtr(string |
int $id, array $body) | POST | /floating_ips/{id}/actions/change_dns_ptr |
$hc->floatingIps->changeFloatingIpProtection(string |
int $id, array $body) | POST | /floating_ips/{id}/actions/change_protection |
$hc->floatingIps->createFloatingIp(array $body) |
POST | /floating_ips |
Create a Floating IP |
$hc->floatingIps->deleteFloatingIp(string |
int $id) | DELETE | /floating_ips/{id} |
$hc->floatingIps->getFloatingIp(string |
int $id) | GET | /floating_ips/{id} |
$hc->floatingIps->getFloatingIpAction(string |
int $id, string | int $actionId) | GET |
$hc->floatingIps->getFloatingIpsAction(string |
int $id) | GET | /floating_ips/actions/{id} |
$hc->floatingIps->listFloatingIpActions(string |
int $id, array $query = []) | GET | /floating_ips/{id}/actions |
$hc->floatingIps->listFloatingIps(array $query = []) |
GET | /floating_ips |
List Floating IPs |
$hc->floatingIps->listFloatingIpsActions(array $query = []) |
GET | /floating_ips/actions |
List Actions |
$hc->floatingIps->unassignFloatingIp(string |
int $id) | POST | /floating_ips/{id}/actions/unassign |
$hc->floatingIps->updateFloatingIp(string |
int $id, array $body) | PUT | /floating_ips/{id} |
images — ImagesClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->images->changeImageProtection(string |
int $id, array $body) | POST | /images/{id}/actions/change_protection |
$hc->images->deleteImage(string |
int $id) | DELETE | /images/{id} |
$hc->images->getImage(string |
int $id) | GET | /images/{id} |
$hc->images->getImageAction(string |
int $id, string | int $actionId) | GET |
$hc->images->getImagesAction(string |
int $id) | GET | /images/actions/{id} |
$hc->images->listImageActions(string |
int $id, array $query = []) | GET | /images/{id}/actions |
$hc->images->listImages(array $query = []) |
GET | /images |
List Images |
$hc->images->listImagesActions(array $query = []) |
GET | /images/actions |
List Actions |
$hc->images->updateImage(string |
int $id, array $body) | PUT | /images/{id} |
isos — IsosClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->isos->getIso(string |
int $id) | GET | /isos/{id} |
$hc->isos->listIsos(array $query = []) |
GET | /isos |
List ISOs |
loadBalancerTypes — LoadBalancerTypesClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->loadBalancerTypes->getLoadBalancerType(string |
int $id) | GET | /load_balancer_types/{id} |
$hc->loadBalancerTypes->listLoadBalancerTypes(array $query = []) |
GET | /load_balancer_types |
List Load Balancer Types |
loadBalancers — LoadBalancersClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->loadBalancers->addLoadBalancerService(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/add_service |
$hc->loadBalancers->addLoadBalancerTarget(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/add_target |
$hc->loadBalancers->attachLoadBalancerToNetwork(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/attach_to_network |
$hc->loadBalancers->changeLoadBalancerAlgorithm(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/change_algorithm |
$hc->loadBalancers->changeLoadBalancerDnsPtr(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/change_dns_ptr |
$hc->loadBalancers->changeLoadBalancerProtection(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/change_protection |
$hc->loadBalancers->changeLoadBalancerType(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/change_type |
$hc->loadBalancers->createLoadBalancer(array $body) |
POST | /load_balancers |
Create a Load Balancer |
$hc->loadBalancers->deleteLoadBalancer(string |
int $id) | DELETE | /load_balancers/{id} |
$hc->loadBalancers->deleteLoadBalancerService(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/delete_service |
$hc->loadBalancers->detachLoadBalancerFromNetwork(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/detach_from_network |
$hc->loadBalancers->disableLoadBalancerPublicInterface(string |
int $id) | POST | /load_balancers/{id}/actions/disable_public_interface |
$hc->loadBalancers->enableLoadBalancerPublicInterface(string |
int $id) | POST | /load_balancers/{id}/actions/enable_public_interface |
$hc->loadBalancers->getLoadBalancer(string |
int $id) | GET | /load_balancers/{id} |
$hc->loadBalancers->getLoadBalancerAction(string |
int $id, string | int $actionId) | GET |
$hc->loadBalancers->getLoadBalancerMetrics(string |
int $id, array $query) | GET | /load_balancers/{id}/metrics |
$hc->loadBalancers->getLoadBalancersAction(string |
int $id) | GET | /load_balancers/actions/{id} |
$hc->loadBalancers->listLoadBalancerActions(string |
int $id, array $query = []) | GET | /load_balancers/{id}/actions |
$hc->loadBalancers->listLoadBalancers(array $query = []) |
GET | /load_balancers |
List Load Balancers |
$hc->loadBalancers->listLoadBalancersActions(array $query = []) |
GET | /load_balancers/actions |
List Actions |
$hc->loadBalancers->removeLoadBalancerTarget(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/remove_target |
$hc->loadBalancers->updateLoadBalancer(string |
int $id, array $body) | PUT | /load_balancers/{id} |
$hc->loadBalancers->updateLoadBalancerService(string |
int $id, array $body) | POST | /load_balancers/{id}/actions/update_service |
locations — LocationsClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->locations->getLocation(string |
int $id) | GET | /locations/{id} |
$hc->locations->listLocations(array $query = []) |
GET | /locations |
List Locations |
networks — NetworksClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->networks->addNetworkRoute(string |
int $id, array $body) | POST | /networks/{id}/actions/add_route |
$hc->networks->addNetworkSubnet(string |
int $id, array $body) | POST | /networks/{id}/actions/add_subnet |
$hc->networks->changeNetworkIpRange(string |
int $id, array $body) | POST | /networks/{id}/actions/change_ip_range |
$hc->networks->changeNetworkProtection(string |
int $id, array $body) | POST | /networks/{id}/actions/change_protection |
$hc->networks->createNetwork(array $body) |
POST | /networks |
Create a Network |
$hc->networks->deleteNetwork(string |
int $id) | DELETE | /networks/{id} |
$hc->networks->deleteNetworkRoute(string |
int $id, array $body) | POST | /networks/{id}/actions/delete_route |
$hc->networks->deleteNetworkSubnet(string |
int $id, array $body) | POST | /networks/{id}/actions/delete_subnet |
$hc->networks->getNetwork(string |
int $id) | GET | /networks/{id} |
$hc->networks->getNetworkAction(string |
int $id, string | int $actionId) | GET |
$hc->networks->getNetworksAction(string |
int $id) | GET | /networks/actions/{id} |
$hc->networks->listNetworkActions(string |
int $id, array $query = []) | GET | /networks/{id}/actions |
$hc->networks->listNetworks(array $query = []) |
GET | /networks |
List Networks |
$hc->networks->listNetworksActions(array $query = []) |
GET | /networks/actions |
List Actions |
$hc->networks->updateNetwork(string |
int $id, array $body) | PUT | /networks/{id} |
placementGroups — PlacementGroupsClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->placementGroups->createPlacementGroup(array $body) |
POST | /placement_groups |
Create a PlacementGroup |
$hc->placementGroups->deletePlacementGroup(string |
int $id) | DELETE | /placement_groups/{id} |
$hc->placementGroups->getPlacementGroup(string |
int $id) | GET | /placement_groups/{id} |
$hc->placementGroups->listPlacementGroups(array $query = []) |
GET | /placement_groups |
List Placement Groups |
$hc->placementGroups->updatePlacementGroup(string |
int $id, array $body) | PUT | /placement_groups/{id} |
pricing — PricingClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->pricing->getPricing() |
GET | /pricing |
Get all prices |
primaryIps — PrimaryIpsClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->primaryIps->assignPrimaryIp(string |
int $id, array $body) | POST | /primary_ips/{id}/actions/assign |
$hc->primaryIps->changePrimaryIpDnsPtr(string |
int $id, array $body) | POST | /primary_ips/{id}/actions/change_dns_ptr |
$hc->primaryIps->changePrimaryIpProtection(string |
int $id, array $body) | POST | /primary_ips/{id}/actions/change_protection |
$hc->primaryIps->createPrimaryIp(array $body) |
POST | /primary_ips |
Create a Primary IP |
$hc->primaryIps->deletePrimaryIp(string |
int $id) | DELETE | /primary_ips/{id} |
$hc->primaryIps->getPrimaryIp(string |
int $id) | GET | /primary_ips/{id} |
$hc->primaryIps->getPrimaryIpAction(string |
int $id, string | int $actionId) | GET |
$hc->primaryIps->getPrimaryIpsAction(string |
int $id) | GET | /primary_ips/actions/{id} |
$hc->primaryIps->listPrimaryIpActions(string |
int $id, array $query = []) | GET | /primary_ips/{id}/actions |
$hc->primaryIps->listPrimaryIps(array $query = []) |
GET | /primary_ips |
List Primary IPs |
$hc->primaryIps->listPrimaryIpsActions(array $query = []) |
GET | /primary_ips/actions |
List Actions |
$hc->primaryIps->unassignPrimaryIp(string |
int $id) | POST | /primary_ips/{id}/actions/unassign |
$hc->primaryIps->updatePrimaryIp(string |
int $id, array $body) | PUT | /primary_ips/{id} |
serverTypes — ServerTypesClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->serverTypes->getServerType(string |
int $id) | GET | /server_types/{id} |
$hc->serverTypes->listServerTypes(array $query = []) |
GET | /server_types |
List Server Types |
servers — ServersClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->servers->addServerToPlacementGroup(string |
int $id, array $body) | POST | /servers/{id}/actions/add_to_placement_group |
$hc->servers->attachServerIso(string |
int $id, array $body) | POST | /servers/{id}/actions/attach_iso |
$hc->servers->attachServerToNetwork(string |
int $id, array $body) | POST | /servers/{id}/actions/attach_to_network |
$hc->servers->changeServerAliasIps(string |
int $id, array $body) | POST | /servers/{id}/actions/change_alias_ips |
$hc->servers->changeServerDnsPtr(string |
int $id, array $body) | POST | /servers/{id}/actions/change_dns_ptr |
$hc->servers->changeServerProtection(string |
int $id, array $body) | POST | /servers/{id}/actions/change_protection |
$hc->servers->changeServerType(string |
int $id, array $body) | POST | /servers/{id}/actions/change_type |
$hc->servers->createServer(array $body) |
POST | /servers |
Create a Server |
$hc->servers->createServerImage(string |
int $id, array $body) | POST | /servers/{id}/actions/create_image |
$hc->servers->deleteServer(string |
int $id) | DELETE | /servers/{id} |
$hc->servers->detachServerFromNetwork(string |
int $id, array $body) | POST | /servers/{id}/actions/detach_from_network |
$hc->servers->detachServerIso(string |
int $id) | POST | /servers/{id}/actions/detach_iso |
$hc->servers->disableServerBackup(string |
int $id) | POST | /servers/{id}/actions/disable_backup |
$hc->servers->disableServerRescue(string |
int $id) | POST | /servers/{id}/actions/disable_rescue |
$hc->servers->enableServerBackup(string |
int $id) | POST | /servers/{id}/actions/enable_backup |
$hc->servers->enableServerRescue(string |
int $id, array $body = []) | POST | /servers/{id}/actions/enable_rescue |
$hc->servers->getServer(string |
int $id) | GET | /servers/{id} |
$hc->servers->getServerAction(string |
int $id, string | int $actionId) | GET |
$hc->servers->getServerMetrics(string |
int $id, array $query) | GET | /servers/{id}/metrics |
$hc->servers->getServersAction(string |
int $id) | GET | /servers/actions/{id} |
$hc->servers->listServerActions(string |
int $id, array $query = []) | GET | /servers/{id}/actions |
$hc->servers->listServers(array $query = []) |
GET | /servers |
List Servers |
$hc->servers->listServersActions(array $query = []) |
GET | /servers/actions |
List Actions |
$hc->servers->poweroffServer(string |
int $id) | POST | /servers/{id}/actions/poweroff |
$hc->servers->poweronServer(string |
int $id) | POST | /servers/{id}/actions/poweron |
$hc->servers->rebootServer(string |
int $id) | POST | /servers/{id}/actions/reboot |
$hc->servers->rebuildServer(string |
int $id, array $body) | POST | /servers/{id}/actions/rebuild |
$hc->servers->removeServerFromPlacementGroup(string |
int $id) | POST | /servers/{id}/actions/remove_from_placement_group |
$hc->servers->requestServerConsole(string |
int $id) | POST | /servers/{id}/actions/request_console |
$hc->servers->resetServer(string |
int $id) | POST | /servers/{id}/actions/reset |
$hc->servers->resetServerPassword(string |
int $id) | POST | /servers/{id}/actions/reset_password |
$hc->servers->shutdownServer(string |
int $id) | POST | /servers/{id}/actions/shutdown |
$hc->servers->updateServer(string |
int $id, array $body) | PUT | /servers/{id} |
sshKeys — SshKeysClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->sshKeys->createSshKey(array $body) |
POST | /ssh_keys |
Create an SSH key |
$hc->sshKeys->deleteSshKey(string |
int $id) | DELETE | /ssh_keys/{id} |
$hc->sshKeys->getSshKey(string |
int $id) | GET | /ssh_keys/{id} |
$hc->sshKeys->listSshKeys(array $query = []) |
GET | /ssh_keys |
List SSH keys |
$hc->sshKeys->updateSshKey(string |
int $id, array $body) | PUT | /ssh_keys/{id} |
volumes — VolumesClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->volumes->attachVolume(string |
int $id, array $body) | POST | /volumes/{id}/actions/attach |
$hc->volumes->changeVolumeProtection(string |
int $id, array $body) | POST | /volumes/{id}/actions/change_protection |
$hc->volumes->createVolume(array $body) |
POST | /volumes |
Create a Volume |
$hc->volumes->deleteVolume(string |
int $id) | DELETE | /volumes/{id} |
$hc->volumes->detachVolume(string |
int $id) | POST | /volumes/{id}/actions/detach |
$hc->volumes->getVolume(string |
int $id) | GET | /volumes/{id} |
$hc->volumes->getVolumeAction(string |
int $id, string | int $actionId) | GET |
$hc->volumes->getVolumesAction(string |
int $id) | GET | /volumes/actions/{id} |
$hc->volumes->listVolumeActions(string |
int $id, array $query = []) | GET | /volumes/{id}/actions |
$hc->volumes->listVolumes(array $query = []) |
GET | /volumes |
List Volumes |
$hc->volumes->listVolumesActions(array $query = []) |
GET | /volumes/actions |
List Actions |
$hc->volumes->resizeVolume(string |
int $id, array $body) | POST | /volumes/{id}/actions/resize |
$hc->volumes->updateVolume(string |
int $id, array $body) | PUT | /volumes/{id} |
zones — ZonesClient
| PHP usage | HTTP | Path | What it does |
|---|---|---|---|
$hc->zones->addZoneRrsetRecords(string |
int $idOrName, string $rrName, string $rrType, array $body) | POST | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type}/actions/add_records |
$hc->zones->changeZonePrimaryNameservers(string |
int $idOrName, array $body) | POST | /zones/{id_or_name}/actions/change_primary_nameservers |
$hc->zones->changeZoneProtection(string |
int $idOrName, array $body) | POST | /zones/{id_or_name}/actions/change_protection |
$hc->zones->changeZoneRrsetProtection(string |
int $idOrName, string $rrName, string $rrType, array $body) | POST | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type}/actions/change_protection |
$hc->zones->changeZoneRrsetTtl(string |
int $idOrName, string $rrName, string $rrType, array $body) | POST | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type}/actions/change_ttl |
$hc->zones->changeZoneTtl(string |
int $idOrName, array $body) | POST | /zones/{id_or_name}/actions/change_ttl |
$hc->zones->createZone(array $body) |
POST | /zones |
Create a Zone |
$hc->zones->createZoneRrset(string |
int $idOrName, array $body) | POST | /zones/{id_or_name}/rrsets |
$hc->zones->deleteZone(string |
int $idOrName) | DELETE | /zones/{id_or_name} |
$hc->zones->deleteZoneRrset(string |
int $idOrName, string $rrName, string $rrType) | DELETE | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type} |
$hc->zones->getZone(string |
int $idOrName) | GET | /zones/{id_or_name} |
$hc->zones->getZoneAction(string |
int $idOrName, string | int $actionId) | GET |
$hc->zones->getZoneRrset(string |
int $idOrName, string $rrName, string $rrType) | GET | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type} |
$hc->zones->getZoneZonefile(string |
int $idOrName, array $query = []) | GET | /zones/{id_or_name}/zonefile |
$hc->zones->getZonesAction(string |
int $id) | GET | /zones/actions/{id} |
$hc->zones->importZoneZonefile(string |
int $idOrName, array $body) | POST | /zones/{id_or_name}/actions/import_zonefile |
$hc->zones->listZoneActions(string |
int $idOrName, array $query = []) | GET | /zones/{id_or_name}/actions |
$hc->zones->listZoneRrsets(string |
int $idOrName, array $query = []) | GET | /zones/{id_or_name}/rrsets |
$hc->zones->listZones(array $query = []) |
GET | /zones |
List Zones |
$hc->zones->listZonesActions(array $query = []) |
GET | /zones/actions |
List Actions |
$hc->zones->removeZoneRrsetRecords(string |
int $idOrName, string $rrName, string $rrType, array $body) | POST | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type}/actions/remove_records |
$hc->zones->setZoneRrsetRecords(string |
int $idOrName, string $rrName, string $rrType, array $body) | POST | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type}/actions/set_records |
$hc->zones->updateZone(string |
int $idOrName, array $body) | PUT | /zones/{id_or_name} |
$hc->zones->updateZoneRrset(string |
int $idOrName, string $rrName, string $rrType, array $body) | PUT | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type} |
$hc->zones->updateZoneRrsetRecords(string |
int $idOrName, string $rrName, string $rrType, array $body) | POST | /zones/{id_or_name}/rrsets/{rr_name}/{rr_type}/actions/update_records |
License
SPDX: MIT (see composer.json).