webapplicationfirewallpolicies

package
v0.20241111.1164443 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies Documentation

The webapplicationfirewallpolicies SDK allows for interaction with Azure Resource Manager cdn (API Version 2024-02-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies"

Client Initialization

client := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: WebApplicationFirewallPoliciesClient.PoliciesCreateOrUpdate

ctx := context.TODO()
id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName")

payload := webapplicationfirewallpolicies.CdnWebApplicationFirewallPolicy{
	// ...
}


if err := client.PoliciesCreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: WebApplicationFirewallPoliciesClient.PoliciesDelete

ctx := context.TODO()
id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName")

read, err := client.PoliciesDelete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: WebApplicationFirewallPoliciesClient.PoliciesGet

ctx := context.TODO()
id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName")

read, err := client.PoliciesGet(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: WebApplicationFirewallPoliciesClient.PoliciesList

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.PoliciesList(ctx, id)` can be used to do batched pagination
items, err := client.PoliciesListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: WebApplicationFirewallPoliciesClient.PoliciesUpdate

ctx := context.TODO()
id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName")

payload := webapplicationfirewallpolicies.CdnWebApplicationFirewallPolicyPatchParameters{
	// ...
}


if err := client.PoliciesUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForActionType

func PossibleValuesForActionType() []string

func PossibleValuesForCustomRuleEnabledState

func PossibleValuesForCustomRuleEnabledState() []string

func PossibleValuesForDefaultCustomBlockResponseStatusCode

func PossibleValuesForDefaultCustomBlockResponseStatusCode() []string

func PossibleValuesForManagedRuleEnabledState

func PossibleValuesForManagedRuleEnabledState() []string

func PossibleValuesForOperator

func PossibleValuesForOperator() []string

func PossibleValuesForPolicyEnabledState

func PossibleValuesForPolicyEnabledState() []string

func PossibleValuesForPolicyMode

func PossibleValuesForPolicyMode() []string

func PossibleValuesForPolicyResourceState

func PossibleValuesForPolicyResourceState() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForSkuName

func PossibleValuesForSkuName() []string

func PossibleValuesForTransformType

func PossibleValuesForTransformType() []string

func PossibleValuesForWafMatchVariable

func PossibleValuesForWafMatchVariable() []string

func ValidateCdnWebApplicationFirewallPolicyID

func ValidateCdnWebApplicationFirewallPolicyID(input interface{}, key string) (warnings []string, errors []error)

ValidateCdnWebApplicationFirewallPolicyID checks that 'input' can be parsed as a Cdn Web Application Firewall Policy ID

Types

type ActionType

type ActionType string
const (
	ActionTypeAllow    ActionType = "Allow"
	ActionTypeBlock    ActionType = "Block"
	ActionTypeLog      ActionType = "Log"
	ActionTypeRedirect ActionType = "Redirect"
)

func (*ActionType) UnmarshalJSON

func (s *ActionType) UnmarshalJSON(bytes []byte) error

type CdnEndpoint

type CdnEndpoint struct {
	Id *string `json:"id,omitempty"`
}

type CdnWebApplicationFirewallPolicy

type CdnWebApplicationFirewallPolicy struct {
	Etag       *string                                    `json:"etag,omitempty"`
	Id         *string                                    `json:"id,omitempty"`
	Location   string                                     `json:"location"`
	Name       *string                                    `json:"name,omitempty"`
	Properties *CdnWebApplicationFirewallPolicyProperties `json:"properties,omitempty"`
	Sku        Sku                                        `json:"sku"`
	SystemData *systemdata.SystemData                     `json:"systemData,omitempty"`
	Tags       *map[string]string                         `json:"tags,omitempty"`
	Type       *string                                    `json:"type,omitempty"`
}

type CdnWebApplicationFirewallPolicyId

type CdnWebApplicationFirewallPolicyId struct {
	SubscriptionId                      string
	ResourceGroupName                   string
	CdnWebApplicationFirewallPolicyName string
}

CdnWebApplicationFirewallPolicyId is a struct representing the Resource ID for a Cdn Web Application Firewall Policy

func NewCdnWebApplicationFirewallPolicyID

func NewCdnWebApplicationFirewallPolicyID(subscriptionId string, resourceGroupName string, cdnWebApplicationFirewallPolicyName string) CdnWebApplicationFirewallPolicyId

NewCdnWebApplicationFirewallPolicyID returns a new CdnWebApplicationFirewallPolicyId struct

func ParseCdnWebApplicationFirewallPolicyID

func ParseCdnWebApplicationFirewallPolicyID(input string) (*CdnWebApplicationFirewallPolicyId, error)

ParseCdnWebApplicationFirewallPolicyID parses 'input' into a CdnWebApplicationFirewallPolicyId

func ParseCdnWebApplicationFirewallPolicyIDInsensitively

func ParseCdnWebApplicationFirewallPolicyIDInsensitively(input string) (*CdnWebApplicationFirewallPolicyId, error)

ParseCdnWebApplicationFirewallPolicyIDInsensitively parses 'input' case-insensitively into a CdnWebApplicationFirewallPolicyId note: this method should only be used for API response data and not user input

func (*CdnWebApplicationFirewallPolicyId) FromParseResult

func (CdnWebApplicationFirewallPolicyId) ID

ID returns the formatted Cdn Web Application Firewall Policy ID

func (CdnWebApplicationFirewallPolicyId) Segments

Segments returns a slice of Resource ID Segments which comprise this Cdn Web Application Firewall Policy ID

func (CdnWebApplicationFirewallPolicyId) String

String returns a human-readable description of this Cdn Web Application Firewall Policy ID

type CdnWebApplicationFirewallPolicyOperationPredicate

type CdnWebApplicationFirewallPolicyOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (CdnWebApplicationFirewallPolicyOperationPredicate) Matches

type CdnWebApplicationFirewallPolicyPatchParameters

type CdnWebApplicationFirewallPolicyPatchParameters struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type CdnWebApplicationFirewallPolicyProperties

type CdnWebApplicationFirewallPolicyProperties struct {
	CustomRules        *CustomRuleList      `json:"customRules,omitempty"`
	EndpointLinks      *[]CdnEndpoint       `json:"endpointLinks,omitempty"`
	ExtendedProperties *map[string]string   `json:"extendedProperties,omitempty"`
	ManagedRules       *ManagedRuleSetList  `json:"managedRules,omitempty"`
	PolicySettings     *PolicySettings      `json:"policySettings,omitempty"`
	ProvisioningState  *ProvisioningState   `json:"provisioningState,omitempty"`
	RateLimitRules     *RateLimitRuleList   `json:"rateLimitRules,omitempty"`
	ResourceState      *PolicyResourceState `json:"resourceState,omitempty"`
}

type CustomRule

type CustomRule struct {
	Action          ActionType              `json:"action"`
	EnabledState    *CustomRuleEnabledState `json:"enabledState,omitempty"`
	MatchConditions []MatchCondition        `json:"matchConditions"`
	Name            string                  `json:"name"`
	Priority        int64                   `json:"priority"`
}

type CustomRuleEnabledState

type CustomRuleEnabledState string
const (
	CustomRuleEnabledStateDisabled CustomRuleEnabledState = "Disabled"
	CustomRuleEnabledStateEnabled  CustomRuleEnabledState = "Enabled"
)

func (*CustomRuleEnabledState) UnmarshalJSON

func (s *CustomRuleEnabledState) UnmarshalJSON(bytes []byte) error

type CustomRuleList

type CustomRuleList struct {
	Rules *[]CustomRule `json:"rules,omitempty"`
}

type DefaultCustomBlockResponseStatusCode

type DefaultCustomBlockResponseStatusCode string
const (
	DefaultCustomBlockResponseStatusCodeFourTwoNine   DefaultCustomBlockResponseStatusCode = "429"
	DefaultCustomBlockResponseStatusCodeFourZeroFive  DefaultCustomBlockResponseStatusCode = "405"
	DefaultCustomBlockResponseStatusCodeFourZeroSix   DefaultCustomBlockResponseStatusCode = "406"
	DefaultCustomBlockResponseStatusCodeFourZeroThree DefaultCustomBlockResponseStatusCode = "403"
	DefaultCustomBlockResponseStatusCodeTwoHundred    DefaultCustomBlockResponseStatusCode = "200"
)

func (*DefaultCustomBlockResponseStatusCode) UnmarshalJSON

func (s *DefaultCustomBlockResponseStatusCode) UnmarshalJSON(bytes []byte) error

type ManagedRuleEnabledState

type ManagedRuleEnabledState string
const (
	ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled"
	ManagedRuleEnabledStateEnabled  ManagedRuleEnabledState = "Enabled"
)

func (*ManagedRuleEnabledState) UnmarshalJSON

func (s *ManagedRuleEnabledState) UnmarshalJSON(bytes []byte) error

type ManagedRuleGroupOverride

type ManagedRuleGroupOverride struct {
	RuleGroupName string                 `json:"ruleGroupName"`
	Rules         *[]ManagedRuleOverride `json:"rules,omitempty"`
}

type ManagedRuleOverride

type ManagedRuleOverride struct {
	Action       *ActionType              `json:"action,omitempty"`
	EnabledState *ManagedRuleEnabledState `json:"enabledState,omitempty"`
	RuleId       string                   `json:"ruleId"`
}

type ManagedRuleSet

type ManagedRuleSet struct {
	AnomalyScore       *int64                      `json:"anomalyScore,omitempty"`
	RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"`
	RuleSetType        string                      `json:"ruleSetType"`
	RuleSetVersion     string                      `json:"ruleSetVersion"`
}

type ManagedRuleSetList

type ManagedRuleSetList struct {
	ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"`
}

type MatchCondition

type MatchCondition struct {
	MatchValue      []string         `json:"matchValue"`
	MatchVariable   WafMatchVariable `json:"matchVariable"`
	NegateCondition *bool            `json:"negateCondition,omitempty"`
	Operator        Operator         `json:"operator"`
	Selector        *string          `json:"selector,omitempty"`
	Transforms      *[]TransformType `json:"transforms,omitempty"`
}

type Operator

type Operator string
const (
	OperatorAny                Operator = "Any"
	OperatorBeginsWith         Operator = "BeginsWith"
	OperatorContains           Operator = "Contains"
	OperatorEndsWith           Operator = "EndsWith"
	OperatorEqual              Operator = "Equal"
	OperatorGeoMatch           Operator = "GeoMatch"
	OperatorGreaterThan        Operator = "GreaterThan"
	OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual"
	OperatorIPMatch            Operator = "IPMatch"
	OperatorLessThan           Operator = "LessThan"
	OperatorLessThanOrEqual    Operator = "LessThanOrEqual"
	OperatorRegEx              Operator = "RegEx"
)

func (*Operator) UnmarshalJSON

func (s *Operator) UnmarshalJSON(bytes []byte) error

type PoliciesCreateOrUpdateOperationResponse

type PoliciesCreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CdnWebApplicationFirewallPolicy
}

type PoliciesDeleteOperationResponse

type PoliciesDeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type PoliciesGetOperationResponse

type PoliciesGetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CdnWebApplicationFirewallPolicy
}

type PoliciesListCompleteResult

type PoliciesListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []CdnWebApplicationFirewallPolicy
}

type PoliciesListCustomPager

type PoliciesListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *PoliciesListCustomPager) NextPageLink() *odata.Link

type PoliciesListOperationResponse

type PoliciesListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]CdnWebApplicationFirewallPolicy
}

type PoliciesUpdateOperationResponse

type PoliciesUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CdnWebApplicationFirewallPolicy
}

type PolicyEnabledState

type PolicyEnabledState string
const (
	PolicyEnabledStateDisabled PolicyEnabledState = "Disabled"
	PolicyEnabledStateEnabled  PolicyEnabledState = "Enabled"
)

func (*PolicyEnabledState) UnmarshalJSON

func (s *PolicyEnabledState) UnmarshalJSON(bytes []byte) error

type PolicyMode

type PolicyMode string
const (
	PolicyModeDetection  PolicyMode = "Detection"
	PolicyModePrevention PolicyMode = "Prevention"
)

func (*PolicyMode) UnmarshalJSON

func (s *PolicyMode) UnmarshalJSON(bytes []byte) error

type PolicyResourceState

type PolicyResourceState string
const (
	PolicyResourceStateCreating  PolicyResourceState = "Creating"
	PolicyResourceStateDeleting  PolicyResourceState = "Deleting"
	PolicyResourceStateDisabled  PolicyResourceState = "Disabled"
	PolicyResourceStateDisabling PolicyResourceState = "Disabling"
	PolicyResourceStateEnabled   PolicyResourceState = "Enabled"
	PolicyResourceStateEnabling  PolicyResourceState = "Enabling"
)

func (*PolicyResourceState) UnmarshalJSON

func (s *PolicyResourceState) UnmarshalJSON(bytes []byte) error

type PolicySettings

type PolicySettings struct {
	DefaultCustomBlockResponseBody       *string                               `json:"defaultCustomBlockResponseBody,omitempty"`
	DefaultCustomBlockResponseStatusCode *DefaultCustomBlockResponseStatusCode `json:"defaultCustomBlockResponseStatusCode,omitempty"`
	DefaultRedirectURL                   *string                               `json:"defaultRedirectUrl,omitempty"`
	EnabledState                         *PolicyEnabledState                   `json:"enabledState,omitempty"`
	Mode                                 *PolicyMode                           `json:"mode,omitempty"`
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func (*ProvisioningState) UnmarshalJSON

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type RateLimitRule

type RateLimitRule struct {
	Action                     ActionType              `json:"action"`
	EnabledState               *CustomRuleEnabledState `json:"enabledState,omitempty"`
	MatchConditions            []MatchCondition        `json:"matchConditions"`
	Name                       string                  `json:"name"`
	Priority                   int64                   `json:"priority"`
	RateLimitDurationInMinutes int64                   `json:"rateLimitDurationInMinutes"`
	RateLimitThreshold         int64                   `json:"rateLimitThreshold"`
}

type RateLimitRuleList

type RateLimitRuleList struct {
	Rules *[]RateLimitRule `json:"rules,omitempty"`
}

type Sku

type Sku struct {
	Name *SkuName `json:"name,omitempty"`
}

type SkuName

type SkuName string
const (
	SkuNameCustomVerizon                             SkuName = "Custom_Verizon"
	SkuNamePremiumAzureFrontDoor                     SkuName = "Premium_AzureFrontDoor"
	SkuNamePremiumVerizon                            SkuName = "Premium_Verizon"
	SkuNameStandardAkamai                            SkuName = "Standard_Akamai"
	SkuNameStandardAvgBandWidthChinaCdn              SkuName = "Standard_AvgBandWidth_ChinaCdn"
	SkuNameStandardAzureFrontDoor                    SkuName = "Standard_AzureFrontDoor"
	SkuNameStandardChinaCdn                          SkuName = "Standard_ChinaCdn"
	SkuNameStandardMicrosoft                         SkuName = "Standard_Microsoft"
	SkuNameStandardNineFiveFiveBandWidthChinaCdn     SkuName = "Standard_955BandWidth_ChinaCdn"
	SkuNameStandardPlusAvgBandWidthChinaCdn          SkuName = "StandardPlus_AvgBandWidth_ChinaCdn"
	SkuNameStandardPlusChinaCdn                      SkuName = "StandardPlus_ChinaCdn"
	SkuNameStandardPlusNineFiveFiveBandWidthChinaCdn SkuName = "StandardPlus_955BandWidth_ChinaCdn"
	SkuNameStandardVerizon                           SkuName = "Standard_Verizon"
)

func (*SkuName) UnmarshalJSON

func (s *SkuName) UnmarshalJSON(bytes []byte) error

type TransformType

type TransformType string
const (
	TransformTypeLowercase   TransformType = "Lowercase"
	TransformTypeRemoveNulls TransformType = "RemoveNulls"
	TransformTypeTrim        TransformType = "Trim"
	TransformTypeURLDecode   TransformType = "UrlDecode"
	TransformTypeURLEncode   TransformType = "UrlEncode"
	TransformTypeUppercase   TransformType = "Uppercase"
)

func (*TransformType) UnmarshalJSON

func (s *TransformType) UnmarshalJSON(bytes []byte) error

type WafMatchVariable

type WafMatchVariable string
const (
	WafMatchVariableCookies       WafMatchVariable = "Cookies"
	WafMatchVariablePostArgs      WafMatchVariable = "PostArgs"
	WafMatchVariableQueryString   WafMatchVariable = "QueryString"
	WafMatchVariableRemoteAddr    WafMatchVariable = "RemoteAddr"
	WafMatchVariableRequestBody   WafMatchVariable = "RequestBody"
	WafMatchVariableRequestHeader WafMatchVariable = "RequestHeader"
	WafMatchVariableRequestMethod WafMatchVariable = "RequestMethod"
	WafMatchVariableRequestUri    WafMatchVariable = "RequestUri"
	WafMatchVariableSocketAddr    WafMatchVariable = "SocketAddr"
)

func (*WafMatchVariable) UnmarshalJSON

func (s *WafMatchVariable) UnmarshalJSON(bytes []byte) error

type WebApplicationFirewallPoliciesClient

type WebApplicationFirewallPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewWebApplicationFirewallPoliciesClientWithBaseURI

func NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*WebApplicationFirewallPoliciesClient, error)

func (WebApplicationFirewallPoliciesClient) PoliciesCreateOrUpdate

PoliciesCreateOrUpdate ...

func (WebApplicationFirewallPoliciesClient) PoliciesCreateOrUpdateThenPoll

PoliciesCreateOrUpdateThenPoll performs PoliciesCreateOrUpdate then polls until it's completed

func (WebApplicationFirewallPoliciesClient) PoliciesDelete

PoliciesDelete ...

func (WebApplicationFirewallPoliciesClient) PoliciesGet

PoliciesGet ...

func (WebApplicationFirewallPoliciesClient) PoliciesList

PoliciesList ...

func (WebApplicationFirewallPoliciesClient) PoliciesListComplete

PoliciesListComplete retrieves all the results into a single object

func (WebApplicationFirewallPoliciesClient) PoliciesListCompleteMatchingPredicate

PoliciesListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (WebApplicationFirewallPoliciesClient) PoliciesUpdate

PoliciesUpdate ...

func (WebApplicationFirewallPoliciesClient) PoliciesUpdateThenPoll

PoliciesUpdateThenPoll performs PoliciesUpdate then polls until it's completed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL