Skip to content

Latest commit

 

History

History
430 lines (281 loc) · 14.3 KB

WafFirewallVersionsAPI.md

File metadata and controls

430 lines (281 loc) · 14.3 KB

WafFirewallVersionsAPI

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
CloneWafFirewallVersion PUT /waf/firewalls/{firewall_id}/versions/{firewall_version_number}/clone Clone a firewall version
CreateWafFirewallVersion POST /waf/firewalls/{firewall_id}/versions Create a firewall version
DeployActivateWafFirewallVersion PUT /waf/firewalls/{firewall_id}/versions/{firewall_version_number}/activate Deploy or activate a firewall version
GetWafFirewallVersion GET /waf/firewalls/{firewall_id}/versions/{firewall_version_number} Get a firewall version
ListWafFirewallVersions GET /waf/firewalls/{firewall_id}/versions List firewall versions
UpdateWafFirewallVersion PATCH /waf/firewalls/{firewall_id}/versions/{firewall_version_number} Update a firewall version

CloneWafFirewallVersion

Clone a firewall version

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    firewallID := "firewallId_example" // string | Alphanumeric string identifying a WAF Firewall.
    firewallVersionNumber := int32(56) // int32 | Integer identifying a WAF firewall version.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.WafFirewallVersionsAPI.CloneWafFirewallVersion(ctx, firewallID, firewallVersionNumber).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WafFirewallVersionsAPI.CloneWafFirewallVersion`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CloneWafFirewallVersion`: WafFirewallVersionResponse
    fmt.Fprintf(os.Stdout, "Response from `WafFirewallVersionsAPI.CloneWafFirewallVersion`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
firewallID string Alphanumeric string identifying a WAF Firewall.
firewallVersionNumber int32 Integer identifying a WAF firewall version.

Other Parameters

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

Name Type Description Notes

Return type

WafFirewallVersionResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

CreateWafFirewallVersion

Create a firewall version

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    firewallID := "firewallId_example" // string | Alphanumeric string identifying a WAF Firewall.
    wafFirewallVersion := *openapiclient.NewWafFirewallVersion() // WafFirewallVersion |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.WafFirewallVersionsAPI.CreateWafFirewallVersion(ctx, firewallID).WafFirewallVersion(wafFirewallVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WafFirewallVersionsAPI.CreateWafFirewallVersion`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateWafFirewallVersion`: WafFirewallVersionResponse
    fmt.Fprintf(os.Stdout, "Response from `WafFirewallVersionsAPI.CreateWafFirewallVersion`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
firewallID string Alphanumeric string identifying a WAF Firewall.

Other Parameters

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

Name Type Description Notes
wafFirewallVersion WafFirewallVersion

Return type

WafFirewallVersionResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

DeployActivateWafFirewallVersion

Deploy or activate a firewall version

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    firewallID := "firewallId_example" // string | Alphanumeric string identifying a WAF Firewall.
    firewallVersionNumber := int32(56) // int32 | Integer identifying a WAF firewall version.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.WafFirewallVersionsAPI.DeployActivateWafFirewallVersion(ctx, firewallID, firewallVersionNumber).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WafFirewallVersionsAPI.DeployActivateWafFirewallVersion`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeployActivateWafFirewallVersion`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `WafFirewallVersionsAPI.DeployActivateWafFirewallVersion`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
firewallID string Alphanumeric string identifying a WAF Firewall.
firewallVersionNumber int32 Integer identifying a WAF firewall version.

Other Parameters

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

Name Type Description Notes

Return type

map[string]any

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

GetWafFirewallVersion

Get a firewall version

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    firewallID := "firewallId_example" // string | Alphanumeric string identifying a WAF Firewall.
    firewallVersionNumber := int32(56) // int32 | Integer identifying a WAF firewall version.
    include := "waf_firewall,waf_active_rules" // string | Include relationships. Optional, comma-separated values. Permitted values: `waf_firewall` and `waf_active_rules`.  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.WafFirewallVersionsAPI.GetWafFirewallVersion(ctx, firewallID, firewallVersionNumber).Include(include).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WafFirewallVersionsAPI.GetWafFirewallVersion`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetWafFirewallVersion`: WafFirewallVersionResponse
    fmt.Fprintf(os.Stdout, "Response from `WafFirewallVersionsAPI.GetWafFirewallVersion`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
firewallID string Alphanumeric string identifying a WAF Firewall.
firewallVersionNumber int32 Integer identifying a WAF firewall version.

Other Parameters

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

Name Type Description Notes
include string Include relationships. Optional, comma-separated values. Permitted values: waf_firewall and waf_active_rules.

Return type

WafFirewallVersionResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

ListWafFirewallVersions

List firewall versions

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    firewallID := "firewallId_example" // string | Alphanumeric string identifying a WAF Firewall.
    include := "waf_firewall" // string | Include relationships. Optional. (optional)
    pageNumber := int32(1) // int32 | Current page. (optional)
    pageSize := int32(20) // int32 | Number of records per page. (optional) (default to 20)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.WafFirewallVersionsAPI.ListWafFirewallVersions(ctx, firewallID).Include(include).PageNumber(pageNumber).PageSize(pageSize).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WafFirewallVersionsAPI.ListWafFirewallVersions`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListWafFirewallVersions`: WafFirewallVersionsResponse
    fmt.Fprintf(os.Stdout, "Response from `WafFirewallVersionsAPI.ListWafFirewallVersions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
firewallID string Alphanumeric string identifying a WAF Firewall.

Other Parameters

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

Name Type Description Notes
include string Include relationships. Optional. pageNumber

Return type

WafFirewallVersionsResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

UpdateWafFirewallVersion

Update a firewall version

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    firewallID := "firewallId_example" // string | Alphanumeric string identifying a WAF Firewall.
    firewallVersionNumber := int32(56) // int32 | Integer identifying a WAF firewall version.
    wafFirewallVersion := *openapiclient.NewWafFirewallVersion() // WafFirewallVersion |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.WafFirewallVersionsAPI.UpdateWafFirewallVersion(ctx, firewallID, firewallVersionNumber).WafFirewallVersion(wafFirewallVersion).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WafFirewallVersionsAPI.UpdateWafFirewallVersion`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateWafFirewallVersion`: WafFirewallVersionResponse
    fmt.Fprintf(os.Stdout, "Response from `WafFirewallVersionsAPI.UpdateWafFirewallVersion`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
firewallID string Alphanumeric string identifying a WAF Firewall.
firewallVersionNumber int32 Integer identifying a WAF firewall version.

Other Parameters

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

Name Type Description Notes
wafFirewallVersion WafFirewallVersion

Return type

WafFirewallVersionResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README