All URIs are relative to https://api.upcloud.com/1.2
Method | HTTP request | Description |
---|---|---|
addIp | POST /ip_address | Assign IP address |
deleteIp | DELETE /ip_address/{ip} | Release IP address |
getDetails | GET /ip_address/{ip} | Get IP address details |
listIps | GET /ip_address | List IP addresses |
modifyIp | PUT /ip_address/{ip} | Modify IP address |
\Upcloud\ApiClient\Model\AssignIpResponse addIp($ip_address)
Assign IP address
Assigns a new IP address to a server.
<?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\IPAddressApi();
$ip_address = new \Upcloud\ApiClient\Model\AddIpRequest(); // \Upcloud\ApiClient\Model\AddIpRequest |
try {
$result = $api_instance->addIp($ip_address);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IPAddressApi->addIp: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
ip_address | \Upcloud\ApiClient\Model\AddIpRequest | [optional] |
\Upcloud\ApiClient\Model\AssignIpResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteIp($ip)
Release IP address
Removes an IP address from a server.
<?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\IPAddressApi();
$ip = "ip_example"; // string | Ip address
try {
$api_instance->deleteIp($ip);
} catch (Exception $e) {
echo 'Exception when calling IPAddressApi->deleteIp: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
ip | string | Ip address |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\AssignIpResponse getDetails($ip)
Get IP address details
Returns detailed information about a specific IP address.
<?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\IPAddressApi();
$ip = "ip_example"; // string | Ip address
try {
$result = $api_instance->getDetails($ip);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IPAddressApi->getDetails: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
ip | string | Ip address |
\Upcloud\ApiClient\Model\AssignIpResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\IpAddressListResponse listIps()
List IP addresses
Returns a list of all IP addresses assigned to servers on the current user account.
<?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\IPAddressApi();
try {
$result = $api_instance->listIps();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IPAddressApi->listIps: ', $e->getMessage(), PHP_EOL;
}
?>
This endpoint does not need any parameter.
\Upcloud\ApiClient\Model\IpAddressListResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\AssignIpResponse modifyIp($ip, $ip_address)
Modify IP address
Modifies the reverse DNS PTR record corresponding to an IP address. The PTR record can only be set to public IP address.
<?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\IPAddressApi();
$ip = "ip_example"; // string | Ip address
$ip_address = new \Upcloud\ApiClient\Model\ModifyIpRequest(); // \Upcloud\ApiClient\Model\ModifyIpRequest |
try {
$result = $api_instance->modifyIp($ip, $ip_address);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling IPAddressApi->modifyIp: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
ip | string | Ip address | |
ip_address | \Upcloud\ApiClient\Model\ModifyIpRequest | [optional] |
\Upcloud\ApiClient\Model\AssignIpResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]