Skip to content

Latest commit

 

History

History
1224 lines (801 loc) · 33.8 KB

WAFApi.md

File metadata and controls

1224 lines (801 loc) · 33.8 KB

\WAFApi

All URIs are relative to https://napi.arvancloud.ir/cdn/4.0

Method HTTP request Description
GlobalWafIndex Get /waf Get WAF presets
GlobalWafShowPackage Get /waf/packages/{packageId} Get WAF package details
WafPackageReprioritize Post /domains/{domain}/waf/actions/reprioritize-package Change priority of WAF packages
WafPackagesDestroy Delete /domains/{domain}/waf/packages/{id} Delete WAF package from domain
WafPackagesIndex Get /domains/{domain}/waf/packages Get WAF packages
WafPackagesShow Get /domains/{domain}/waf/packages/{id} Get WAF package information
WafPackagesStore Post /domains/{domain}/waf/packages Add new WAF package to domain
WafPackagesUpdate Patch /domains/{domain}/waf/packages/{id} Update the WAF package
WafReconfigure Post /domains/{domain}/waf/actions/reconfigure Reconfigure WAF module using a preset
WafReprioritize Post /domains/{domain}/waf/actions/reprioritize Change priority of WAF rules
WafRulesDestroy Delete /domains/{domain}/waf/rules/{id} Delete WAF rule
WafRulesIndex Get /domains/{domain}/waf/rules Get WAF Rules
WafRulesShow Get /domains/{domain}/waf/rules/{id} Get WAF rule information
WafRulesStore Post /domains/{domain}/waf/rules Create new WAF rule
WafRulesUpdate Patch /domains/{domain}/waf/rules/{id} Update the WAF rule
WafSettingsIndex Get /domains/{domain}/waf/settings Get WAF configuration
WafSettingsUpdate Patch /domains/{domain}/waf/settings Configure WAF module of the domain

GlobalWafIndex

WafPresetsData GlobalWafIndex(ctx).Execute()

Get WAF presets

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.GlobalWafIndex(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.GlobalWafIndex``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GlobalWafIndex`: WafPresetsData
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.GlobalWafIndex`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

WafPresetsData

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]

GlobalWafShowPackage

WafPackageDetailsData GlobalWafShowPackage(ctx, packageId).Execute()

Get WAF package details

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    packageId := "packageId_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.GlobalWafShowPackage(context.Background(), packageId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.GlobalWafShowPackage``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GlobalWafShowPackage`: WafPackageDetailsData
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.GlobalWafShowPackage`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

WafPackageDetailsData

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]

WafPackageReprioritize

MessageResponse WafPackageReprioritize(ctx, domain).WafReprioritize(wafReprioritize).Execute()

Change priority of WAF packages

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    wafReprioritize := *openapiclient.NewWafReprioritize("PackageId_example") // WafReprioritize |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafPackageReprioritize(context.Background(), domain).WafReprioritize(wafReprioritize).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafPackageReprioritize``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafPackageReprioritize`: MessageResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafPackageReprioritize`: %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 apiWafPackageReprioritizeRequest struct via the builder pattern

Name Type Description Notes

wafReprioritize | WafReprioritize | |

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]

WafPackagesDestroy

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

Delete WAF package from domain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    id := "id_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafPackagesDestroy(context.Background(), domain, id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafPackagesDestroy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafPackagesDestroy`: MessageResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafPackagesDestroy`: %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 apiWafPackagesDestroyRequest 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]

WafPackagesIndex

DomainWafPackagesData WafPackagesIndex(ctx, domain).Available(available).Execute()

Get WAF packages

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    available := true // bool |  (optional) (default to false)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafPackagesIndex(context.Background(), domain).Available(available).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafPackagesIndex``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafPackagesIndex`: DomainWafPackagesData
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafPackagesIndex`: %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 apiWafPackagesIndexRequest struct via the builder pattern

Name Type Description Notes

available | bool | | [default to false]

Return type

DomainWafPackagesData

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]

WafPackagesShow

DomainWafPackageDetailsData WafPackagesShow(ctx, domain, id).Execute()

Get WAF package information

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    id := "id_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafPackagesShow(context.Background(), domain, id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafPackagesShow``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafPackagesShow`: DomainWafPackageDetailsData
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafPackagesShow`: %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 apiWafPackagesShowRequest struct via the builder pattern

Name Type Description Notes

Return type

DomainWafPackageDetailsData

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]

WafPackagesStore

WafPackagesStore200Response WafPackagesStore(ctx, domain).DomainWafPackageStore(domainWafPackageStore).Execute()

Add new WAF package to domain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    domainWafPackageStore := *openapiclient.NewDomainWafPackageStore("Id_example") // DomainWafPackageStore |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafPackagesStore(context.Background(), domain).DomainWafPackageStore(domainWafPackageStore).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafPackagesStore``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafPackagesStore`: WafPackagesStore200Response
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafPackagesStore`: %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 apiWafPackagesStoreRequest struct via the builder pattern

Name Type Description Notes

domainWafPackageStore | DomainWafPackageStore | |

Return type

WafPackagesStore200Response

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]

WafPackagesUpdate

WafPackagesUpdate200Response WafPackagesUpdate(ctx, domain, id).DomainWafPackage(domainWafPackage).Execute()

Update the WAF package

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    id := "id_example" // string | 
    domainWafPackage := *openapiclient.NewDomainWafPackage() // DomainWafPackage |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafPackagesUpdate(context.Background(), domain, id).DomainWafPackage(domainWafPackage).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafPackagesUpdate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafPackagesUpdate`: WafPackagesUpdate200Response
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafPackagesUpdate`: %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 apiWafPackagesUpdateRequest struct via the builder pattern

Name Type Description Notes

domainWafPackage | DomainWafPackage | |

Return type

WafPackagesUpdate200Response

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]

WafReconfigure

MessageResponse WafReconfigure(ctx, domain).WafReconfigure(wafReconfigure).Execute()

Reconfigure WAF module using a preset

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    wafReconfigure := *openapiclient.NewWafReconfigure() // WafReconfigure |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafReconfigure(context.Background(), domain).WafReconfigure(wafReconfigure).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafReconfigure``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafReconfigure`: MessageResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafReconfigure`: %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 apiWafReconfigureRequest struct via the builder pattern

Name Type Description Notes

wafReconfigure | WafReconfigure | |

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]

WafReprioritize

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

Change priority of WAF rules

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

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.WAFApi.WafReprioritize(context.Background(), domain).ReprioritizeRuleRequest(reprioritizeRuleRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafReprioritize``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafReprioritize`: MessageResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafReprioritize`: %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 apiWafReprioritizeRequest 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]

WafRulesDestroy

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

Delete WAF rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

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.WAFApi.WafRulesDestroy(context.Background(), domain, id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafRulesDestroy``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafRulesDestroy`: MessageResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafRulesDestroy`: %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 apiWafRulesDestroyRequest 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]

WafRulesIndex

WafRulesIndex200Response WafRulesIndex(ctx, domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()

Get WAF Rules

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

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.WAFApi.WafRulesIndex(context.Background(), domain).PerPage(perPage).OrderBy(orderBy).OrderType(orderType).Search(search).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafRulesIndex``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafRulesIndex`: WafRulesIndex200Response
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafRulesIndex`: %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 apiWafRulesIndexRequest struct via the builder pattern

Name Type Description Notes

perPage | int32 | | orderBy | string | | orderType | string | | search | string | |

Return type

WafRulesIndex200Response

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]

WafRulesShow

WafRuleResponse WafRulesShow(ctx, domain, id).Execute()

Get WAF rule information

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

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.WAFApi.WafRulesShow(context.Background(), domain, id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafRulesShow``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafRulesShow`: WafRuleResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafRulesShow`: %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 apiWafRulesShowRequest struct via the builder pattern

Name Type Description Notes

Return type

WafRuleResponse

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]

WafRulesStore

WafRuleResponse WafRulesStore(ctx, domain).WafRule(wafRule).Execute()

Create new WAF rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    wafRule := *openapiclient.NewWafRule() // WafRule |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafRulesStore(context.Background(), domain).WafRule(wafRule).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafRulesStore``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafRulesStore`: WafRuleResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafRulesStore`: %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 apiWafRulesStoreRequest struct via the builder pattern

Name Type Description Notes

wafRule | WafRule | |

Return type

WafRuleResponse

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]

WafRulesUpdate

WafRuleResponse WafRulesUpdate(ctx, domain, id).WafRule(wafRule).Execute()

Update the WAF rule

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 
    wafRule := *openapiclient.NewWafRule() // WafRule |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafRulesUpdate(context.Background(), domain, id).WafRule(wafRule).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafRulesUpdate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafRulesUpdate`: WafRuleResponse
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafRulesUpdate`: %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 apiWafRulesUpdateRequest struct via the builder pattern

Name Type Description Notes

wafRule | WafRule | |

Return type

WafRuleResponse

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]

WafSettingsIndex

WafSettingsData WafSettingsIndex(ctx, domain).Execute()

Get WAF configuration

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafSettingsIndex(context.Background(), domain).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafSettingsIndex``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafSettingsIndex`: WafSettingsData
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafSettingsIndex`: %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 apiWafSettingsIndexRequest struct via the builder pattern

Name Type Description Notes

Return type

WafSettingsData

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]

WafSettingsUpdate

WafSettingsData WafSettingsUpdate(ctx, domain).WafSettings(wafSettings).Execute()

Configure WAF module of the domain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/arash-r1c/cdn-go-sdk"
)

func main() {
    domain := "example.com" // string | Domain name
    wafSettings := *openapiclient.NewWafSettings() // WafSettings |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WAFApi.WafSettingsUpdate(context.Background(), domain).WafSettings(wafSettings).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WAFApi.WafSettingsUpdate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WafSettingsUpdate`: WafSettingsData
    fmt.Fprintf(os.Stdout, "Response from `WAFApi.WafSettingsUpdate`: %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 apiWafSettingsUpdateRequest struct via the builder pattern

Name Type Description Notes

wafSettings | WafSettings | |

Return type

WafSettingsData

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]