Skip to content

Latest commit

 

History

History
161 lines (105 loc) · 4.79 KB

HostsApi.md

File metadata and controls

161 lines (105 loc) · 4.79 KB

Upcloud\ApiClient\HostsApi

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

getListHosts

\Upcloud\ApiClient\Model\HostListResponse getListHosts()

List of available hosts

Returns a list of available hosts, along with basic statistics of them when available.

Example

<?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;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\Upcloud\ApiClient\Model\HostListResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getHostDetails

\Upcloud\ApiClient\Model\HostResponse getHostDetails($id)

Get Host details

Returns detailed information about a specific host.

Example

<?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;
}
?>

Parameters

Name Type Description Notes
id string Host Id

Return type

\Upcloud\ApiClient\Model\HostResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

modifyHost

\Upcloud\ApiClient\Model\HostResponse modifyHost($id, $host)

Modify host

Modifies description of a specific host.

Example

<?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;
}
?>

Parameters

Name Type Description Notes
id string Host Id
host \Upcloud\ApiClient\Model\ModifyHostRequest

Return type

\Upcloud\ApiClient\Model\HostResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]