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 |
FirewallRuleCreateResponse createFirewallRule(serverId, firewallRule)
Create firewall rule
Creates a new firewall rule
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.FirewallApi();
var serverId = "serverId_example"; // String | Server id
var firewallRule = new upcloud.FirewallRuleRequest(); // FirewallRuleRequest |
apiInstance.createFirewallRule(serverId, firewallRule).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
firewallRule | FirewallRuleRequest |
- Content-Type: application/json
- Accept: application/json
deleteFirewallRule(serverId, firewallRuleNumber)
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.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.FirewallApi();
var serverId = "serverId_example"; // String | Server id
var firewallRuleNumber = 3.4; // Number | Denotes the index of the firewall rule in the server's firewall rule list
apiInstance.deleteFirewallRule(serverId, firewallRuleNumber).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
firewallRuleNumber | Number | Denotes the index of the firewall rule in the server's firewall rule list |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
FirewallRuleCreateResponse getFirewallRule(serverId, firewallRuleNumber)
Get firewall rule details
Returns detailed information about a specific firewall rule
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.FirewallApi();
var serverId = "serverId_example"; // String | Server id
var firewallRuleNumber = 3.4; // Number | Denotes the index of the firewall rule in the server's firewall rule list
apiInstance.getFirewallRule(serverId, firewallRuleNumber).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
firewallRuleNumber | Number | Denotes the index of the firewall rule in the server's firewall rule list |
- Content-Type: application/json
- Accept: application/json
FirewallRuleListResponse serverServerIdFirewallRuleGet(serverId, )
List firewall rules
Returns a list of firewall rules for a specific server.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.FirewallApi();
var serverId = "serverId_example"; // String | Server id
apiInstance.serverServerIdFirewallRuleGet(serverId, ).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id |
- Content-Type: application/json
- Accept: application/json