All URIs are relative to https://napi.arvancloud.ir/cdn/4.0
| Method | HTTP request | Description |
|---|---|---|
| FirewallIndex | Get /domains/{domain}/firewall | Get domain's firewall configuration |
| FirewallReprioritize | Post /domains/{domain}/firewall/actions/reprioritize | Change priority of firewall rules |
| FirewallRulesDestroy | Delete /domains/{domain}/firewall/rules/{id} | Delete firewall rule |
| FirewallRulesIndex | Get /domains/{domain}/firewall/rules | Get domain's firewall rules |
| FirewallRulesShow | Get /domains/{domain}/firewall/rules/{id} | Get firewall rule information |
| FirewallRulesStore | Post /domains/{domain}/firewall/rules | Create new firewall rule |
| FirewallRulesUpdate | Patch /domains/{domain}/firewall/rules/{id} | Update the firewall rule |
| FirewallSettingsIndex | Get /domains/{domain}/firewall/settings | Get domain's firewall configuration |
| FirewallSettingsUpdate | Patch /domains/{domain}/firewall/settings | Update domain's firewall configuration |
| FirewallUpdate | Patch /domains/{domain}/firewall | Update domain's firewall configuration |
FirewallIndex200Response FirewallIndex(ctx, domain).Execute()
Get domain's firewall configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallIndex(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallIndex`: FirewallIndex200Response
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallIndex`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallIndexRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse FirewallReprioritize(ctx, domain).ReprioritizeRuleRequest(reprioritizeRuleRequest).Execute()
Change priority of firewall rules
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
reprioritizeRuleRequest := *openapiclient.NewReprioritizeRuleRequest("RuleId_example") // ReprioritizeRuleRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallReprioritize(context.Background(), domain).ReprioritizeRuleRequest(reprioritizeRuleRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallReprioritize``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallReprioritize`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallReprioritize`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallReprioritizeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
reprioritizeRuleRequest | ReprioritizeRuleRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse FirewallRulesDestroy(ctx, domain, id).Execute()
Delete firewall rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallRulesDestroy(context.Background(), domain, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallRulesDestroy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallRulesDestroy`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallRulesDestroy`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name | |
| id | string |
Other parameters are passed through a pointer to a apiFirewallRulesDestroyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FirewallRulesIndex200Response FirewallRulesIndex(ctx, domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()
Get domain's firewall rules
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
perPage := int32(56) // int32 | (optional)
orderBy := "orderBy_example" // string | (optional)
orderType := "orderType_example" // string | (optional)
search := "search_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallRulesIndex(context.Background(), domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallRulesIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallRulesIndex`: FirewallRulesIndex200Response
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallRulesIndex`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallRulesIndexRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
perPage | int32 | | orderBy | string | | orderType | string | | search | string | |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FirewallRuleResponse FirewallRulesShow(ctx, domain, id).Execute()
Get firewall rule information
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallRulesShow(context.Background(), domain, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallRulesShow``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallRulesShow`: FirewallRuleResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallRulesShow`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name | |
| id | string |
Other parameters are passed through a pointer to a apiFirewallRulesShowRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FirewallRuleResponse FirewallRulesStore(ctx, domain).FirewallRule(firewallRule).Execute()
Create new firewall rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
firewallRule := *openapiclient.NewFirewallRule("Name_example", "ip.geoip.country in {"IR" "TH" "US"} and ssl", "Action_example") // FirewallRule | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallRulesStore(context.Background(), domain).FirewallRule(firewallRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallRulesStore``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallRulesStore`: FirewallRuleResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallRulesStore`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallRulesStoreRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
firewallRule | FirewallRule | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FirewallRuleResponse FirewallRulesUpdate(ctx, domain, id).FirewallRule(firewallRule).Execute()
Update the firewall rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string |
firewallRule := *openapiclient.NewFirewallRule("Name_example", "ip.geoip.country in {"IR" "TH" "US"} and ssl", "Action_example") // FirewallRule | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallRulesUpdate(context.Background(), domain, id).FirewallRule(firewallRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallRulesUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallRulesUpdate`: FirewallRuleResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallRulesUpdate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name | |
| id | string |
Other parameters are passed through a pointer to a apiFirewallRulesUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
firewallRule | FirewallRule | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FirewallSettingsIndex200Response FirewallSettingsIndex(ctx, domain).Execute()
Get domain's firewall configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallSettingsIndex(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallSettingsIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallSettingsIndex`: FirewallSettingsIndex200Response
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallSettingsIndex`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallSettingsIndexRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
FirewallSettingsIndex200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse FirewallSettingsUpdate(ctx, domain).FirewallSettings(firewallSettings).Execute()
Update domain's firewall configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
firewallSettings := *openapiclient.NewFirewallSettings() // FirewallSettings | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallSettingsUpdate(context.Background(), domain).FirewallSettings(firewallSettings).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallSettingsUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallSettingsUpdate`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallSettingsUpdate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallSettingsUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
firewallSettings | FirewallSettings | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse FirewallUpdate(ctx, domain).Firewall(firewall).Execute()
Update domain's firewall configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
firewall := *openapiclient.NewFirewall() // Firewall | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.FirewallApi.FirewallUpdate(context.Background(), domain).Firewall(firewall).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `FirewallApi.FirewallUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FirewallUpdate`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `FirewallApi.FirewallUpdate`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| domain | string | Domain name |
Other parameters are passed through a pointer to a apiFirewallUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
firewall | Firewall | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]