master
Models
FirewallRulesApi
All URIs are relative to https://api.ionos.com/cloudapi/v6
Method
HTTP request
Description
Delete /datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}
Delete firewall rules
Get /datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}
Retrieve firewall rules
Get /datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules
List firewall rules
Patch /datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}
Partially modify firewall rules
Post /datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules
Create firewall rules
Put /datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/firewallrules/{firewallruleId}
Modify firewall rules

DatacentersServersNicsFirewallrulesDelete

1
var result = DatacentersServersNicsFirewallrulesDelete(ctx, datacenterId, serverId, nicId, firewallruleId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Delete firewall rules

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
nicId := "nicId_example" // string | The unique ID of the NIC.
14
firewallruleId := "firewallruleId_example" // string | The unique ID of the firewall rule.
15
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
16
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
17
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
18
19
configuration := openapiclient.NewConfiguration()
20
apiClient := openapiclient.NewAPIClient(configuration)
21
resp, r, err := apiClient.FirewallRulesApi.DatacentersServersNicsFirewallrulesDelete(context.Background(), datacenterId, serverId, nicId, firewallruleId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
22
if err != nil {
23
fmt.Fprintf(os.Stderr, "Error when calling `FirewallRulesApi.DatacentersServersNicsFirewallrulesDelete``: %v\n", err)
24
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25
}
26
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
nicId
string
The unique ID of the NIC.
firewallruleId
string
The unique ID of the firewall rule.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersNicsFirewallrulesDeleteRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

(empty response body)

HTTP request headers

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

DatacentersServersNicsFirewallrulesFindById

1
var result FirewallRule = DatacentersServersNicsFirewallrulesFindById(ctx, datacenterId, serverId, nicId, firewallruleId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Retrieve firewall rules

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
nicId := "nicId_example" // string | The unique ID of the NIC.
14
firewallruleId := "firewallruleId_example" // string | The unique ID of the firewall rule.
15
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
16
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
17
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
18
19
configuration := openapiclient.NewConfiguration()
20
apiClient := openapiclient.NewAPIClient(configuration)
21
resp, r, err := apiClient.FirewallRulesApi.DatacentersServersNicsFirewallrulesFindById(context.Background(), datacenterId, serverId, nicId, firewallruleId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
22
if err != nil {
23
fmt.Fprintf(os.Stderr, "Error when calling `FirewallRulesApi.DatacentersServersNicsFirewallrulesFindById``: %v\n", err)
24
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25
}
26
// response from `DatacentersServersNicsFirewallrulesFindById`: FirewallRule
27
fmt.Fprintf(os.Stdout, "Response from `FirewallRulesApi.DatacentersServersNicsFirewallrulesFindById`: %v\n", resp)
28
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
nicId
string
The unique ID of the NIC.
firewallruleId
string
The unique ID of the firewall rule.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersNicsFirewallrulesFindByIdRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersNicsFirewallrulesGet

1
var result FirewallRules = DatacentersServersNicsFirewallrulesGet(ctx, datacenterId, serverId, nicId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Offset(offset)
6
.Limit(limit)
7
.Execute()
Copied!
List firewall rules

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
nicId := "nicId_example" // string | The unique ID of the NIC.
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
17
offset := int32(56) // int32 | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination). (optional) (default to 0)
18
limit := int32(56) // int32 | The maximum number of elements to return (use together with offset for pagination). (optional) (default to 1000)
19
20
configuration := openapiclient.NewConfiguration()
21
apiClient := openapiclient.NewAPIClient(configuration)
22
resp, r, err := apiClient.FirewallRulesApi.DatacentersServersNicsFirewallrulesGet(context.Background(), datacenterId, serverId, nicId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Offset(offset).Limit(limit).Execute()
23
if err != nil {
24
fmt.Fprintf(os.Stderr, "Error when calling `FirewallRulesApi.DatacentersServersNicsFirewallrulesGet``: %v\n", err)
25
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26
}
27
// response from `DatacentersServersNicsFirewallrulesGet`: FirewallRules
28
fmt.Fprintf(os.Stdout, "Response from `FirewallRulesApi.DatacentersServersNicsFirewallrulesGet`: %v\n", resp)
29
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
nicId
string
The unique ID of the NIC.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersNicsFirewallrulesGetRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
offset
int32
The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
[default to 0]
limit
int32
The maximum number of elements to return (use together with offset for pagination).
[default to 1000]

Return type

HTTP request headers

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

DatacentersServersNicsFirewallrulesPatch

1
var result FirewallRule = DatacentersServersNicsFirewallrulesPatch(ctx, datacenterId, serverId, nicId, firewallruleId)
2
.Firewallrule(firewallrule)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Partially modify firewall rules

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
nicId := "nicId_example" // string | The unique ID of the NIC.
14
firewallruleId := "firewallruleId_example" // string | The unique ID of the firewall rule.
15
firewallrule := *openapiclient.NewFirewallruleProperties("TCP") // FirewallruleProperties | The properties of the firewall rule to be updated.
16
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
17
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
18
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
19
20
configuration := openapiclient.NewConfiguration()
21
apiClient := openapiclient.NewAPIClient(configuration)
22
resp, r, err := apiClient.FirewallRulesApi.DatacentersServersNicsFirewallrulesPatch(context.Background(), datacenterId, serverId, nicId, firewallruleId).Firewallrule(firewallrule).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
23
if err != nil {
24
fmt.Fprintf(os.Stderr, "Error when calling `FirewallRulesApi.DatacentersServersNicsFirewallrulesPatch``: %v\n", err)
25
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26
}
27
// response from `DatacentersServersNicsFirewallrulesPatch`: FirewallRule
28
fmt.Fprintf(os.Stdout, "Response from `FirewallRulesApi.DatacentersServersNicsFirewallrulesPatch`: %v\n", resp)
29
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
nicId
string
The unique ID of the NIC.
firewallruleId
string
The unique ID of the firewall rule.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersNicsFirewallrulesPatchRequest struct via the builder pattern
Name
Type
Description
Notes
firewallrule
The properties of the firewall rule to be updated.
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersNicsFirewallrulesPost

1
var result FirewallRule = DatacentersServersNicsFirewallrulesPost(ctx, datacenterId, serverId, nicId)
2
.Firewallrule(firewallrule)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Create firewall rules

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
nicId := "nicId_example" // string | The unique ID of the NIC.
14
firewallrule := *openapiclient.NewFirewallRule(*openapiclient.NewFirewallruleProperties("TCP")) // FirewallRule | The firewall rule to create.
15
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
16
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
17
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
18
19
configuration := openapiclient.NewConfiguration()
20
apiClient := openapiclient.NewAPIClient(configuration)
21
resp, r, err := apiClient.FirewallRulesApi.DatacentersServersNicsFirewallrulesPost(context.Background(), datacenterId, serverId, nicId).Firewallrule(firewallrule).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
22
if err != nil {
23
fmt.Fprintf(os.Stderr, "Error when calling `FirewallRulesApi.DatacentersServersNicsFirewallrulesPost``: %v\n", err)
24
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25
}
26
// response from `DatacentersServersNicsFirewallrulesPost`: FirewallRule
27
fmt.Fprintf(os.Stdout, "Response from `FirewallRulesApi.DatacentersServersNicsFirewallrulesPost`: %v\n", resp)
28
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
nicId
string
The unique ID of the NIC.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersNicsFirewallrulesPostRequest struct via the builder pattern
Name
Type
Description
Notes
firewallrule
The firewall rule to create.
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersNicsFirewallrulesPut

1
var result FirewallRule = DatacentersServersNicsFirewallrulesPut(ctx, datacenterId, serverId, nicId, firewallruleId)
2
.Firewallrule(firewallrule)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Modify firewall rules

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
nicId := "nicId_example" // string | The unique ID of the NIC.
14
firewallruleId := "firewallruleId_example" // string | The unique ID of the firewall rule.
15
firewallrule := *openapiclient.NewFirewallRule(*openapiclient.NewFirewallruleProperties("TCP")) // FirewallRule | The modified firewall rule.
16
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
17
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
18
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
19
20
configuration := openapiclient.NewConfiguration()
21
apiClient := openapiclient.NewAPIClient(configuration)
22
resp, r, err := apiClient.FirewallRulesApi.DatacentersServersNicsFirewallrulesPut(context.Background(), datacenterId, serverId, nicId, firewallruleId).Firewallrule(firewallrule).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
23
if err != nil {
24
fmt.Fprintf(os.Stderr, "Error when calling `FirewallRulesApi.DatacentersServersNicsFirewallrulesPut``: %v\n", err)
25
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
26
}
27
// response from `DatacentersServersNicsFirewallrulesPut`: FirewallRule
28
fmt.Fprintf(os.Stdout, "Response from `FirewallRulesApi.DatacentersServersNicsFirewallrulesPut`: %v\n", resp)
29
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
nicId
string
The unique ID of the NIC.
firewallruleId
string
The unique ID of the firewall rule.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersNicsFirewallrulesPutRequest struct via the builder pattern
Name
Type
Description
Notes
firewallrule
The modified firewall rule.
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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