Skip to content
Start here

List WAF packages

Deprecated
client.Firewall.WAF.Packages.List(ctx, params) (*V4PagePaginationArray[WAFPackageListResponse], error)
GET/zones/{zone_id}/firewall/waf/packages

Fetches WAF packages for a zone.

Note: Applies only to the previous version of WAF managed rules.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Firewall Services WriteFirewall Services Read
ParametersExpand Collapse
params WAFPackageListParams
ZoneID param.Field[string]

Path param: Defines an identifier.

maxLength32
Direction param.Field[WAFPackageListParamsDirection]Optional

Query param: The direction used to sort returned packages.

const WAFPackageListParamsDirectionAsc WAFPackageListParamsDirection = "asc"
const WAFPackageListParamsDirectionDesc WAFPackageListParamsDirection = "desc"
Match param.Field[WAFPackageListParamsMatch]Optional

Query param: When set to all, all the search requirements must match. When set to any, only one of the search requirements has to match.

const WAFPackageListParamsMatchAny WAFPackageListParamsMatch = "any"
const WAFPackageListParamsMatchAll WAFPackageListParamsMatch = "all"
Name param.Field[string]Optional

Query param: The name of the WAF package.

Order param.Field[WAFPackageListParamsOrder]Optional

Query param: The field used to sort returned packages.

const WAFPackageListParamsOrderName WAFPackageListParamsOrder = "name"
Page param.Field[float64]Optional

Query param: The page number of paginated results.

minimum1
PerPage param.Field[float64]Optional

Query param: The number of packages per page.

maximum100
minimum5
ReturnsExpand Collapse
type WAFPackageListResponse interface{…}

List WAF packages

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/firewall"
  "github.com/stainless-sdks/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Firewall.WAF.Packages.List(context.TODO(), firewall.WAFPackageListParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {}
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {}
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}