Skip to content

Latest commit

 

History

History
727 lines (478 loc) · 21.1 KB

File metadata and controls

727 lines (478 loc) · 21.1 KB

\FirewallApi

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

FirewallIndex

FirewallIndex200Response FirewallIndex(ctx, domain).Execute()

Get domain's firewall configuration

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiFirewallIndexRequest struct via the builder pattern

Name Type Description Notes

Return type

FirewallIndex200Response

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallReprioritize

MessageResponse FirewallReprioritize(ctx, domain).ReprioritizeRuleRequest(reprioritizeRuleRequest).Execute()

Change priority of firewall rules

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiFirewallReprioritizeRequest struct via the builder pattern

Name Type Description Notes

reprioritizeRuleRequest | ReprioritizeRuleRequest | |

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallRulesDestroy

MessageResponse FirewallRulesDestroy(ctx, domain, id).Execute()

Delete firewall rule

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name
id string

Other Parameters

Other parameters are passed through a pointer to a apiFirewallRulesDestroyRequest struct via the builder pattern

Name Type Description Notes

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallRulesIndex

FirewallRulesIndex200Response FirewallRulesIndex(ctx, domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()

Get domain's firewall rules

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

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 | |

Return type

FirewallRulesIndex200Response

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallRulesShow

FirewallRuleResponse FirewallRulesShow(ctx, domain, id).Execute()

Get firewall rule information

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name
id string

Other Parameters

Other parameters are passed through a pointer to a apiFirewallRulesShowRequest struct via the builder pattern

Name Type Description Notes

Return type

FirewallRuleResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallRulesStore

FirewallRuleResponse FirewallRulesStore(ctx, domain).FirewallRule(firewallRule).Execute()

Create new firewall rule

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiFirewallRulesStoreRequest struct via the builder pattern

Name Type Description Notes

firewallRule | FirewallRule | |

Return type

FirewallRuleResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallRulesUpdate

FirewallRuleResponse FirewallRulesUpdate(ctx, domain, id).FirewallRule(firewallRule).Execute()

Update the firewall rule

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name
id string

Other Parameters

Other parameters are passed through a pointer to a apiFirewallRulesUpdateRequest struct via the builder pattern

Name Type Description Notes

firewallRule | FirewallRule | |

Return type

FirewallRuleResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallSettingsIndex

FirewallSettingsIndex200Response FirewallSettingsIndex(ctx, domain).Execute()

Get domain's firewall configuration

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiFirewallSettingsIndexRequest struct via the builder pattern

Name Type Description Notes

Return type

FirewallSettingsIndex200Response

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallSettingsUpdate

MessageResponse FirewallSettingsUpdate(ctx, domain).FirewallSettings(firewallSettings).Execute()

Update domain's firewall configuration

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiFirewallSettingsUpdateRequest struct via the builder pattern

Name Type Description Notes

firewallSettings | FirewallSettings | |

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FirewallUpdate

MessageResponse FirewallUpdate(ctx, domain).Firewall(firewall).Execute()

Update domain's firewall configuration

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiFirewallUpdateRequest struct via the builder pattern

Name Type Description Notes

firewall | Firewall | |

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]