All URIs are relative to https://napi.arvancloud.ir/cdn/4.0
| Method | HTTP request | Description |
|---|---|---|
| DdosIndex | Get /domains/{domain}/ddos | Get DDoS protection settings |
| DdosReprioritize | Post /domains/{domain}/ddos/actions/reprioritize | Change priority of ddos rules |
| DdosRulesDestroy | Delete /domains/{domain}/ddos/rules/{id} | Delete DDoS protection rule |
| DdosRulesIndex | Get /domains/{domain}/ddos/rules | Get DDoS Protection Rules |
| DdosRulesShow | Get /domains/{domain}/ddos/rules/{id} | Get DDoS protection's rule information |
| DdosRulesStore | Post /domains/{domain}/ddos/rules | Create new DDoS protection rule |
| DdosRulesUpdate | Patch /domains/{domain}/ddos/rules/{id} | Update the DDoS protection rule |
| DdosSettingsIndex | Get /domains/{domain}/ddos/settings | Get DDoS protection settings |
| DdosSettingsUpdate | Patch /domains/{domain}/ddos/settings | Update domain's DDoS protection configuration |
| DdosUpdate | Patch /domains/{domain}/ddos | Update domain's DDoS protection configuration |
DdosData DdosIndex(ctx, domain).Execute()
Get DDoS protection settings
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.DDoSApi.DdosIndex(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosIndex`: DdosData
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosIndex`: %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 apiDdosIndexRequest 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 DdosReprioritize(ctx, domain).ReprioritizeRuleRequest(reprioritizeRuleRequest).Execute()
Change priority of ddos 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.DDoSApi.DdosReprioritize(context.Background(), domain).ReprioritizeRuleRequest(reprioritizeRuleRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosReprioritize``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosReprioritize`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosReprioritize`: %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 apiDdosReprioritizeRequest 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 DdosRulesDestroy(ctx, domain, id).Execute()
Delete DDoS protection 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.DDoSApi.DdosRulesDestroy(context.Background(), domain, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosRulesDestroy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosRulesDestroy`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosRulesDestroy`: %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 apiDdosRulesDestroyRequest 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]
DdosRulesIndex200Response DdosRulesIndex(ctx, domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()
Get DDoS Protection 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.DDoSApi.DdosRulesIndex(context.Background(), domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosRulesIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosRulesIndex`: DdosRulesIndex200Response
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosRulesIndex`: %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 apiDdosRulesIndexRequest 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]
DdosRuleData DdosRulesShow(ctx, domain, id).Execute()
Get DDoS protection's 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.DDoSApi.DdosRulesShow(context.Background(), domain, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosRulesShow``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosRulesShow`: DdosRuleData
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosRulesShow`: %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 apiDdosRulesShowRequest 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]
DdosRuleResponse DdosRulesStore(ctx, domain).DdosRule(ddosRule).Execute()
Create new DDoS protection rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
ddosRule := *openapiclient.NewDdosRule() // DdosRule | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DDoSApi.DdosRulesStore(context.Background(), domain).DdosRule(ddosRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosRulesStore``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosRulesStore`: DdosRuleResponse
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosRulesStore`: %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 apiDdosRulesStoreRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
ddosRule | DdosRule | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DdosRuleResponse DdosRulesUpdate(ctx, domain, id).DdosRule(ddosRule).Execute()
Update the DDoS protection 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 |
ddosRule := *openapiclient.NewDdosRule() // DdosRule | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DDoSApi.DdosRulesUpdate(context.Background(), domain, id).DdosRule(ddosRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosRulesUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosRulesUpdate`: DdosRuleResponse
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosRulesUpdate`: %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 apiDdosRulesUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
ddosRule | DdosRule | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DdosSettingsData DdosSettingsIndex(ctx, domain).Execute()
Get DDoS protection settings
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.DDoSApi.DdosSettingsIndex(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosSettingsIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosSettingsIndex`: DdosSettingsData
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosSettingsIndex`: %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 apiDdosSettingsIndexRequest 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]
DdosSettingsUpdate200Response DdosSettingsUpdate(ctx, domain).DdosSettings(ddosSettings).Execute()
Update domain's DDoS protection configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
ddosSettings := *openapiclient.NewDdosSettings() // DdosSettings | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DDoSApi.DdosSettingsUpdate(context.Background(), domain).DdosSettings(ddosSettings).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosSettingsUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosSettingsUpdate`: DdosSettingsUpdate200Response
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosSettingsUpdate`: %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 apiDdosSettingsUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
ddosSettings | DdosSettings | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DdosUpdate200Response DdosUpdate(ctx, domain).Ddos(ddos).Execute()
Update domain's DDoS protection configuration
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arvancloud/cdn-go"
)
func main() {
domain := "example.com" // string | Domain name
ddos := *openapiclient.NewDdos() // Ddos | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DDoSApi.DdosUpdate(context.Background(), domain).Ddos(ddos).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DDoSApi.DdosUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DdosUpdate`: DdosUpdate200Response
fmt.Fprintf(os.Stdout, "Response from `DDoSApi.DdosUpdate`: %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 apiDdosUpdateRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
ddos | Ddos | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]