All URIs are relative to https://api.upcloud.com/1.3
Method | HTTP request | Description |
---|---|---|
getListHosts | GET /host | List of available hosts |
getHostDetails | GET /host/{id} | Get detailed information about a specific host |
modifyHost | PATCH /host/{id} | Modify specific host |
\Upcloud\ApiClient\Model\HostListResponse getListHosts()
List of available hosts
Returns a list of available hosts, along with basic statistics of them when available.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\HostsApi();
try {
$result = $api_instance->getListHosts();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HostsApi->getListHosts: ', $e->getMessage(), PHP_EOL;
}
?>
This endpoint does not need any parameter.
\Upcloud\ApiClient\Model\HostListResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\HostResponse getHostDetails($id)
Get Host details
Returns detailed information about a specific host.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\HostsApi();
$id = "id_example"; // string | Host id
try {
$result = $api_instance->getHostDetails($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HostsApi->getHostDetails: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | Host Id |
\Upcloud\ApiClient\Model\HostResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\HostResponse modifyHost($id, $host)
Modify host
Modifies description of a specific host.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\HostsApi();
$id = "id_example"; // string | Host Id
$host = new \Upcloud\ApiClient\Model\ModifyHostRequest(); // \Upcloud\ApiClient\Model\ModifyHostRequest |
try {
$result = $api_instance->modifyHost($id, $host);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HostsApi->modifyHost: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | string | Host Id | |
host | \Upcloud\ApiClient\Model\ModifyHostRequest |
\Upcloud\ApiClient\Model\HostResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]