wafrulesapiv1

package
v0.46.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package wafrulesapiv1 : Operations and models for the WafRulesApiV1 service

Index

Constants

View Source
const (
	ListWafRulesOptions_Mode_Off = "off"
	ListWafRulesOptions_Mode_On  = "on"
)

Constants associated with the ListWafRulesOptions.Mode property. The Rule Mode.

View Source
const (
	WafRuleBodyCis_Mode_Block     = "block"
	WafRuleBodyCis_Mode_Challenge = "challenge"
	WafRuleBodyCis_Mode_Default   = "default"
	WafRuleBodyCis_Mode_Disable   = "disable"
	WafRuleBodyCis_Mode_Simulate  = "simulate"
)

Constants associated with the WafRuleBodyCis.Mode property. mode to choose from.

View Source
const (
	WafRuleBodyOwasp_Mode_Off = "off"
	WafRuleBodyOwasp_Mode_On  = "on"
)

Constants associated with the WafRuleBodyOwasp.Mode property. mode to choose from. 'owasp' limited modes - on and off.

View Source
const (
	WafRuleResponseResult_Mode_Off = "off"
	WafRuleResponseResult_Mode_On  = "on"
)

Constants associated with the WafRuleResponseResult.Mode property. mode.

View Source
const (
	WafRulesResponseResultItem_Mode_Off = "off"
	WafRulesResponseResultItem_Mode_On  = "on"
)

Constants associated with the WafRulesResponseResultItem.Mode property. mode.

View Source
const DefaultServiceName = "waf_rules_api"

DefaultServiceName is the default key used to find external configuration information.

View Source
const DefaultServiceURL = "https://api.cis.cloud.ibm.com"

DefaultServiceURL is the default URL to make service requests to.

Variables

This section is empty.

Functions

func GetServiceURLForRegion added in v0.12.1

func GetServiceURLForRegion(region string) (string, error)

GetServiceURLForRegion returns the service URL to be used for the specified region

func UnmarshalWafRuleBodyCis

func UnmarshalWafRuleBodyCis(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRuleBodyCis unmarshals an instance of WafRuleBodyCis from the specified map of raw messages.

func UnmarshalWafRuleBodyOwasp

func UnmarshalWafRuleBodyOwasp(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRuleBodyOwasp unmarshals an instance of WafRuleBodyOwasp from the specified map of raw messages.

func UnmarshalWafRuleResponse

func UnmarshalWafRuleResponse(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRuleResponse unmarshals an instance of WafRuleResponse from the specified map of raw messages.

func UnmarshalWafRuleResponseResult

func UnmarshalWafRuleResponseResult(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRuleResponseResult unmarshals an instance of WafRuleResponseResult from the specified map of raw messages.

func UnmarshalWafRuleResponseResultGroup

func UnmarshalWafRuleResponseResultGroup(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRuleResponseResultGroup unmarshals an instance of WafRuleResponseResultGroup from the specified map of raw messages.

func UnmarshalWafRulesResponse

func UnmarshalWafRulesResponse(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRulesResponse unmarshals an instance of WafRulesResponse from the specified map of raw messages.

func UnmarshalWafRulesResponseResultInfo

func UnmarshalWafRulesResponseResultInfo(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRulesResponseResultInfo unmarshals an instance of WafRulesResponseResultInfo from the specified map of raw messages.

func UnmarshalWafRulesResponseResultItem

func UnmarshalWafRulesResponseResultItem(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRulesResponseResultItem unmarshals an instance of WafRulesResponseResultItem from the specified map of raw messages.

func UnmarshalWafRulesResponseResultItemGroup

func UnmarshalWafRulesResponseResultItemGroup(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalWafRulesResponseResultItemGroup unmarshals an instance of WafRulesResponseResultItemGroup from the specified map of raw messages.

Types

type GetWafRuleOptions

type GetWafRuleOptions struct {
	// package id.
	PackageID *string `json:"package_id" validate:"required,ne="`

	// rule identifier.
	Identifier *string `json:"identifier" validate:"required,ne="`

	// Allows users to set headers on API requests
	Headers map[string]string
}

GetWafRuleOptions : The GetWafRule options.

func (*GetWafRuleOptions) SetHeaders

func (options *GetWafRuleOptions) SetHeaders(param map[string]string) *GetWafRuleOptions

SetHeaders : Allow user to set Headers

func (*GetWafRuleOptions) SetIdentifier

func (options *GetWafRuleOptions) SetIdentifier(identifier string) *GetWafRuleOptions

SetIdentifier : Allow user to set Identifier

func (*GetWafRuleOptions) SetPackageID

func (options *GetWafRuleOptions) SetPackageID(packageID string) *GetWafRuleOptions

SetPackageID : Allow user to set PackageID

type ListWafRulesOptions

type ListWafRulesOptions struct {
	// package id.
	PackageID *string `json:"package_id" validate:"required,ne="`

	// The Rule Mode.
	Mode *string `json:"mode,omitempty"`

	// The order in which the individual rule is executed within the related group.
	Priority *string `json:"priority,omitempty"`

	// Whether to match all search requirements or at least one. default value: all. valid values: any, all.
	Match *string `json:"match,omitempty"`

	// Field to order rules by. valid values: priority, group_id, description.
	Order *string `json:"order,omitempty"`

	// WAF group identifier tag. max length: 32; Read-only.
	GroupID *string `json:"group_id,omitempty"`

	// Public description of the rule.
	Description *string `json:"description,omitempty"`

	// Direction to order rules. valid values: asc, desc.
	Direction *string `json:"direction,omitempty"`

	// Page number of paginated results. default value: 1; min value:1.
	Page *int64 `json:"page,omitempty"`

	// Number of rules per page. default value: 50; min value:5; max value:100.
	PerPage *int64 `json:"per_page,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

ListWafRulesOptions : The ListWafRules options.

func (*ListWafRulesOptions) SetDescription

func (options *ListWafRulesOptions) SetDescription(description string) *ListWafRulesOptions

SetDescription : Allow user to set Description

func (*ListWafRulesOptions) SetDirection

func (options *ListWafRulesOptions) SetDirection(direction string) *ListWafRulesOptions

SetDirection : Allow user to set Direction

func (*ListWafRulesOptions) SetGroupID

func (options *ListWafRulesOptions) SetGroupID(groupID string) *ListWafRulesOptions

SetGroupID : Allow user to set GroupID

func (*ListWafRulesOptions) SetHeaders

func (options *ListWafRulesOptions) SetHeaders(param map[string]string) *ListWafRulesOptions

SetHeaders : Allow user to set Headers

func (*ListWafRulesOptions) SetMatch

func (options *ListWafRulesOptions) SetMatch(match string) *ListWafRulesOptions

SetMatch : Allow user to set Match

func (*ListWafRulesOptions) SetMode

func (options *ListWafRulesOptions) SetMode(mode string) *ListWafRulesOptions

SetMode : Allow user to set Mode

func (*ListWafRulesOptions) SetOrder

func (options *ListWafRulesOptions) SetOrder(order string) *ListWafRulesOptions

SetOrder : Allow user to set Order

func (*ListWafRulesOptions) SetPackageID

func (options *ListWafRulesOptions) SetPackageID(packageID string) *ListWafRulesOptions

SetPackageID : Allow user to set PackageID

func (*ListWafRulesOptions) SetPage

func (options *ListWafRulesOptions) SetPage(page int64) *ListWafRulesOptions

SetPage : Allow user to set Page

func (*ListWafRulesOptions) SetPerPage

func (options *ListWafRulesOptions) SetPerPage(perPage int64) *ListWafRulesOptions

SetPerPage : Allow user to set PerPage

func (*ListWafRulesOptions) SetPriority

func (options *ListWafRulesOptions) SetPriority(priority string) *ListWafRulesOptions

SetPriority : Allow user to set Priority

type UpdateWafRuleOptions

type UpdateWafRuleOptions struct {
	// package id.
	PackageID *string `json:"package_id" validate:"required,ne="`

	// rule identifier.
	Identifier *string `json:"identifier" validate:"required,ne="`

	// cis package.
	Cis *WafRuleBodyCis `json:"cis,omitempty"`

	// owasp package.
	Owasp *WafRuleBodyOwasp `json:"owasp,omitempty"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

UpdateWafRuleOptions : The UpdateWafRule options.

func (*UpdateWafRuleOptions) SetCis

SetCis : Allow user to set Cis

func (*UpdateWafRuleOptions) SetHeaders

func (options *UpdateWafRuleOptions) SetHeaders(param map[string]string) *UpdateWafRuleOptions

SetHeaders : Allow user to set Headers

func (*UpdateWafRuleOptions) SetIdentifier

func (options *UpdateWafRuleOptions) SetIdentifier(identifier string) *UpdateWafRuleOptions

SetIdentifier : Allow user to set Identifier

func (*UpdateWafRuleOptions) SetOwasp

func (options *UpdateWafRuleOptions) SetOwasp(owasp *WafRuleBodyOwasp) *UpdateWafRuleOptions

SetOwasp : Allow user to set Owasp

func (*UpdateWafRuleOptions) SetPackageID

func (options *UpdateWafRuleOptions) SetPackageID(packageID string) *UpdateWafRuleOptions

SetPackageID : Allow user to set PackageID

type WafRuleBodyCis

type WafRuleBodyCis struct {
	// mode to choose from.
	Mode *string `json:"mode" validate:"required"`
}

WafRuleBodyCis : cis package.

type WafRuleBodyOwasp

type WafRuleBodyOwasp struct {
	// mode to choose from. 'owasp' limited modes - on and off.
	Mode *string `json:"mode" validate:"required"`
}

WafRuleBodyOwasp : owasp package.

type WafRuleResponse

type WafRuleResponse struct {
	// Was operation successful.
	Success *bool `json:"success" validate:"required"`

	// Array of errors encountered.
	Errors [][]string `json:"errors" validate:"required"`

	// Array of messages returned.
	Messages [][]string `json:"messages" validate:"required"`

	// Information about a Rule.
	Result *WafRuleResponseResult `json:"result" validate:"required"`
}

WafRuleResponse : waf rule response.

type WafRuleResponseResult

type WafRuleResponseResult struct {
	// ID.
	ID *string `json:"id,omitempty"`

	// description.
	Description *string `json:"description,omitempty"`

	// priority.
	Priority *string `json:"priority,omitempty"`

	// group definition.
	Group *WafRuleResponseResultGroup `json:"group,omitempty"`

	// package id.
	PackageID *string `json:"package_id,omitempty"`

	// allowed modes.
	AllowedModes []string `json:"allowed_modes,omitempty"`

	// mode.
	Mode *string `json:"mode,omitempty"`
}

WafRuleResponseResult : Information about a Rule.

type WafRuleResponseResultGroup

type WafRuleResponseResultGroup struct {
	// group id.
	ID *string `json:"id,omitempty"`

	// group name.
	Name *string `json:"name,omitempty"`
}

WafRuleResponseResultGroup : group definition.

type WafRulesApiV1

type WafRulesApiV1 struct {
	Service *core.BaseService

	// cloud resource name.
	Crn *string

	// zone id.
	ZoneID *string
}

WafRulesApiV1 : This document describes CIS WAF Rules API.

Version: 1.0.0

func NewWafRulesApiV1

func NewWafRulesApiV1(options *WafRulesApiV1Options) (service *WafRulesApiV1, err error)

NewWafRulesApiV1 : constructs an instance of WafRulesApiV1 with passed in options.

func NewWafRulesApiV1UsingExternalConfig

func NewWafRulesApiV1UsingExternalConfig(options *WafRulesApiV1Options) (wafRulesApi *WafRulesApiV1, err error)

NewWafRulesApiV1UsingExternalConfig : constructs an instance of WafRulesApiV1 with passed in options and external configuration.

func (*WafRulesApiV1) Clone added in v0.12.1

func (wafRulesApi *WafRulesApiV1) Clone() *WafRulesApiV1

Clone makes a copy of "wafRulesApi" suitable for processing requests.

func (*WafRulesApiV1) DisableRetries added in v0.12.1

func (wafRulesApi *WafRulesApiV1) DisableRetries()

DisableRetries disables automatic retries for requests invoked for this service instance.

func (*WafRulesApiV1) EnableRetries added in v0.12.1

func (wafRulesApi *WafRulesApiV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)

EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.

func (*WafRulesApiV1) GetEnableGzipCompression added in v0.12.1

func (wafRulesApi *WafRulesApiV1) GetEnableGzipCompression() bool

GetEnableGzipCompression returns the service's EnableGzipCompression field

func (*WafRulesApiV1) GetServiceURL added in v0.12.1

func (wafRulesApi *WafRulesApiV1) GetServiceURL() string

GetServiceURL returns the service URL

func (*WafRulesApiV1) GetWafRule

func (wafRulesApi *WafRulesApiV1) GetWafRule(getWafRuleOptions *GetWafRuleOptions) (result *WafRuleResponse, response *core.DetailedResponse, err error)

GetWafRule : Get WAF rule Get individual information about a rule.

func (*WafRulesApiV1) GetWafRuleWithContext added in v0.12.1

func (wafRulesApi *WafRulesApiV1) GetWafRuleWithContext(ctx context.Context, getWafRuleOptions *GetWafRuleOptions) (result *WafRuleResponse, response *core.DetailedResponse, err error)

GetWafRuleWithContext is an alternate form of the GetWafRule method which supports a Context parameter

func (*WafRulesApiV1) ListWafRules

func (wafRulesApi *WafRulesApiV1) ListWafRules(listWafRulesOptions *ListWafRulesOptions) (result *WafRulesResponse, response *core.DetailedResponse, err error)

ListWafRules : List all WAF rules List all Web Application Firewall (WAF) rules.

func (*WafRulesApiV1) ListWafRulesWithContext added in v0.12.1

func (wafRulesApi *WafRulesApiV1) ListWafRulesWithContext(ctx context.Context, listWafRulesOptions *ListWafRulesOptions) (result *WafRulesResponse, response *core.DetailedResponse, err error)

ListWafRulesWithContext is an alternate form of the ListWafRules method which supports a Context parameter

func (*WafRulesApiV1) NewGetWafRuleOptions

func (*WafRulesApiV1) NewGetWafRuleOptions(packageID string, identifier string) *GetWafRuleOptions

NewGetWafRuleOptions : Instantiate GetWafRuleOptions

func (*WafRulesApiV1) NewListWafRulesOptions

func (*WafRulesApiV1) NewListWafRulesOptions(packageID string) *ListWafRulesOptions

NewListWafRulesOptions : Instantiate ListWafRulesOptions

func (*WafRulesApiV1) NewUpdateWafRuleOptions

func (*WafRulesApiV1) NewUpdateWafRuleOptions(packageID string, identifier string) *UpdateWafRuleOptions

NewUpdateWafRuleOptions : Instantiate UpdateWafRuleOptions

func (*WafRulesApiV1) NewWafRuleBodyCis

func (*WafRulesApiV1) NewWafRuleBodyCis(mode string) (model *WafRuleBodyCis, err error)

NewWafRuleBodyCis : Instantiate WafRuleBodyCis (Generic Model Constructor)

func (*WafRulesApiV1) NewWafRuleBodyOwasp

func (*WafRulesApiV1) NewWafRuleBodyOwasp(mode string) (model *WafRuleBodyOwasp, err error)

NewWafRuleBodyOwasp : Instantiate WafRuleBodyOwasp (Generic Model Constructor)

func (*WafRulesApiV1) SetDefaultHeaders added in v0.12.1

func (wafRulesApi *WafRulesApiV1) SetDefaultHeaders(headers http.Header)

SetDefaultHeaders sets HTTP headers to be sent in every request

func (*WafRulesApiV1) SetEnableGzipCompression added in v0.12.1

func (wafRulesApi *WafRulesApiV1) SetEnableGzipCompression(enableGzip bool)

SetEnableGzipCompression sets the service's EnableGzipCompression field

func (*WafRulesApiV1) SetServiceURL

func (wafRulesApi *WafRulesApiV1) SetServiceURL(url string) error

SetServiceURL sets the service URL

func (*WafRulesApiV1) UpdateWafRule

func (wafRulesApi *WafRulesApiV1) UpdateWafRule(updateWafRuleOptions *UpdateWafRuleOptions) (result *WafRuleResponse, response *core.DetailedResponse, err error)

UpdateWafRule : Update WAF rule Update the action the rule will perform if triggered on the zone.

func (*WafRulesApiV1) UpdateWafRuleWithContext added in v0.12.1

func (wafRulesApi *WafRulesApiV1) UpdateWafRuleWithContext(ctx context.Context, updateWafRuleOptions *UpdateWafRuleOptions) (result *WafRuleResponse, response *core.DetailedResponse, err error)

UpdateWafRuleWithContext is an alternate form of the UpdateWafRule method which supports a Context parameter

type WafRulesApiV1Options

type WafRulesApiV1Options struct {
	ServiceName   string
	URL           string
	Authenticator core.Authenticator

	// cloud resource name.
	Crn *string `validate:"required"`

	// zone id.
	ZoneID *string `validate:"required"`
}

WafRulesApiV1Options : Service options

type WafRulesResponse

type WafRulesResponse struct {
	// Was operation successful.
	Success *bool `json:"success" validate:"required"`

	// Array of errors encountered.
	Errors [][]string `json:"errors" validate:"required"`

	// Array of messages returned.
	Messages [][]string `json:"messages" validate:"required"`

	// Array of Rules.
	Result []WafRulesResponseResultItem `json:"result" validate:"required"`

	// result information.
	ResultInfo *WafRulesResponseResultInfo `json:"result_info,omitempty"`
}

WafRulesResponse : waf rule response.

type WafRulesResponseResultInfo

type WafRulesResponseResultInfo struct {
	// current page.
	Page *int64 `json:"page,omitempty"`

	// number of data per page.
	PerPage *int64 `json:"per_page,omitempty"`

	// count.
	Count *int64 `json:"count,omitempty"`

	// total count of data.
	TotalCount *int64 `json:"total_count,omitempty"`
}

WafRulesResponseResultInfo : result information.

type WafRulesResponseResultItem

type WafRulesResponseResultItem struct {
	// ID.
	ID *string `json:"id,omitempty"`

	// description.
	Description *string `json:"description,omitempty"`

	// priority.
	Priority *string `json:"priority,omitempty"`

	// group definition.
	Group *WafRulesResponseResultItemGroup `json:"group,omitempty"`

	// package id.
	PackageID *string `json:"package_id,omitempty"`

	// allowed modes.
	AllowedModes []string `json:"allowed_modes,omitempty"`

	// mode.
	Mode *string `json:"mode,omitempty"`
}

WafRulesResponseResultItem : WafRulesResponseResultItem struct

type WafRulesResponseResultItemGroup

type WafRulesResponseResultItemGroup struct {
	// group id.
	ID *string `json:"id,omitempty"`

	// group name.
	Name *string `json:"name,omitempty"`
}

WafRulesResponseResultItemGroup : group definition.

Jump to

Keyboard shortcuts

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