All URIs are relative to https://api.upcloud.com/1.2
Method | HTTP request | Description |
---|---|---|
createFirewallRule | POST /server/{serverId}/firewall_rule | Create firewall rule |
deleteFirewallRule | DELETE /server/{serverId}/firewall_rule/{firewallRuleNumber} | Remove firewall rule |
getFirewallRule | GET /server/{serverId}/firewall_rule/{firewallRuleNumber} | Get firewall rule details |
serverServerIdFirewallRuleGet | GET /server/{serverId}/firewall_rule | List firewall rules |
\Upcloud\ApiClient\Model\FirewallRuleCreateResponse createFirewallRule($server_id, $firewall_rule)
Create firewall rule
Creates a new firewall rule
<?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\FirewallApi();
$server_id = "server_id_example"; // string | Server id
$firewall_rule = new \Upcloud\ApiClient\Model\FirewallRuleRequest(); // \Upcloud\ApiClient\Model\FirewallRuleRequest |
try {
$result = $api_instance->createFirewallRule($server_id, $firewall_rule);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FirewallApi->createFirewallRule: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
server_id | string | Server id | |
firewall_rule | \Upcloud\ApiClient\Model\FirewallRuleRequest |
\Upcloud\ApiClient\Model\FirewallRuleCreateResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteFirewallRule($server_id, $firewall_rule_number)
Remove firewall rule
Removes a firewall rule from a server. Firewall rules must be removed individually. The positions of remaining firewall rules will be adjusted after a rule is removed.
<?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\FirewallApi();
$server_id = "server_id_example"; // string | Server id
$firewall_rule_number = 3.4; // float | Denotes the index of the firewall rule in the server's firewall rule list
try {
$api_instance->deleteFirewallRule($server_id, $firewall_rule_number);
} catch (Exception $e) {
echo 'Exception when calling FirewallApi->deleteFirewallRule: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
server_id | string | Server id | |
firewall_rule_number | float | Denotes the index of the firewall rule in the server's firewall rule list |
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\FirewallRuleCreateResponse getFirewallRule($server_id, $firewall_rule_number)
Get firewall rule details
Returns detailed information about a specific firewall rule
<?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\FirewallApi();
$server_id = "server_id_example"; // string | Server id
$firewall_rule_number = 3.4; // float | Denotes the index of the firewall rule in the server's firewall rule list
try {
$result = $api_instance->getFirewallRule($server_id, $firewall_rule_number);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FirewallApi->getFirewallRule: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
server_id | string | Server id | |
firewall_rule_number | float | Denotes the index of the firewall rule in the server's firewall rule list |
\Upcloud\ApiClient\Model\FirewallRuleCreateResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\FirewallRuleListResponse serverServerIdFirewallRuleGet($server_id)
List firewall rules
Returns a list of firewall rules for a specific 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\FirewallApi();
$server_id = "server_id_example"; // string | Server id
try {
$result = $api_instance->serverServerIdFirewallRuleGet($server_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FirewallApi->serverServerIdFirewallRuleGet: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
server_id | string | Server id |
\Upcloud\ApiClient\Model\FirewallRuleListResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]