Documentation
¶
Overview ¶
Package wafapiv1 : Operations and models for the WafApiV1 service
Index ¶
- Constants
- func GetServiceURLForRegion(region string) (string, error)
- func UnmarshalWafResponse(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalWafResponseResult(m map[string]json.RawMessage, result interface{}) (err error)
- type GetWafSettingsOptions
- type UpdateWafSettingsOptions
- type WafApiV1
- func (wafApi *WafApiV1) Clone() *WafApiV1
- func (wafApi *WafApiV1) DisableRetries()
- func (wafApi *WafApiV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
- func (wafApi *WafApiV1) GetEnableGzipCompression() bool
- func (wafApi *WafApiV1) GetServiceURL() string
- func (wafApi *WafApiV1) GetWafSettings(getWafSettingsOptions *GetWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
- func (wafApi *WafApiV1) GetWafSettingsWithContext(ctx context.Context, getWafSettingsOptions *GetWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
- func (*WafApiV1) NewGetWafSettingsOptions() *GetWafSettingsOptions
- func (*WafApiV1) NewUpdateWafSettingsOptions() *UpdateWafSettingsOptions
- func (wafApi *WafApiV1) SetDefaultHeaders(headers http.Header)
- func (wafApi *WafApiV1) SetEnableGzipCompression(enableGzip bool)
- func (wafApi *WafApiV1) SetServiceURL(url string) error
- func (wafApi *WafApiV1) UpdateWafSettings(updateWafSettingsOptions *UpdateWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
- func (wafApi *WafApiV1) UpdateWafSettingsWithContext(ctx context.Context, updateWafSettingsOptions *UpdateWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
- type WafApiV1Options
- type WafResponse
- type WafResponseResult
Constants ¶
const ( UpdateWafSettingsOptions_Value_Off = "off" UpdateWafSettingsOptions_Value_On = "on" )
Constants associated with the UpdateWafSettingsOptions.Value property. value.
const DefaultServiceName = "waf_api"
DefaultServiceName is the default key used to find external configuration information.
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
GetServiceURLForRegion returns the service URL to be used for the specified region
func UnmarshalWafResponse ¶
func UnmarshalWafResponse(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalWafResponse unmarshals an instance of WafResponse from the specified map of raw messages.
func UnmarshalWafResponseResult ¶
func UnmarshalWafResponseResult(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalWafResponseResult unmarshals an instance of WafResponseResult from the specified map of raw messages.
Types ¶
type GetWafSettingsOptions ¶
type GetWafSettingsOptions struct {
// Allows users to set headers on API requests
Headers map[string]string
}
GetWafSettingsOptions : The GetWafSettings options.
func (*GetWafSettingsOptions) SetHeaders ¶
func (options *GetWafSettingsOptions) SetHeaders(param map[string]string) *GetWafSettingsOptions
SetHeaders : Allow user to set Headers
type UpdateWafSettingsOptions ¶
type UpdateWafSettingsOptions struct {
// value.
Value *string `json:"value,omitempty"`
// Allows users to set headers on API requests
Headers map[string]string
}
UpdateWafSettingsOptions : The UpdateWafSettings options.
func (*UpdateWafSettingsOptions) SetHeaders ¶
func (options *UpdateWafSettingsOptions) SetHeaders(param map[string]string) *UpdateWafSettingsOptions
SetHeaders : Allow user to set Headers
func (*UpdateWafSettingsOptions) SetValue ¶
func (options *UpdateWafSettingsOptions) SetValue(value string) *UpdateWafSettingsOptions
SetValue : Allow user to set Value
type WafApiV1 ¶
type WafApiV1 struct {
Service *core.BaseService
// cloud resource name.
Crn *string
// zone id.
ZoneID *string
}
WafApiV1 : This document describes CIS WAF API.
Version: 1.0.0
func NewWafApiV1 ¶
func NewWafApiV1(options *WafApiV1Options) (service *WafApiV1, err error)
NewWafApiV1 : constructs an instance of WafApiV1 with passed in options.
func NewWafApiV1UsingExternalConfig ¶
func NewWafApiV1UsingExternalConfig(options *WafApiV1Options) (wafApi *WafApiV1, err error)
NewWafApiV1UsingExternalConfig : constructs an instance of WafApiV1 with passed in options and external configuration.
func (*WafApiV1) Clone ¶ added in v0.12.1
Clone makes a copy of "wafApi" suitable for processing requests.
func (*WafApiV1) DisableRetries ¶ added in v0.12.1
func (wafApi *WafApiV1) DisableRetries()
DisableRetries disables automatic retries for requests invoked for this service instance.
func (*WafApiV1) EnableRetries ¶ added in v0.12.1
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 (*WafApiV1) GetEnableGzipCompression ¶ added in v0.12.1
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*WafApiV1) GetServiceURL ¶ added in v0.12.1
GetServiceURL returns the service URL
func (*WafApiV1) GetWafSettings ¶
func (wafApi *WafApiV1) GetWafSettings(getWafSettingsOptions *GetWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
GetWafSettings : Get WAF setting Get WAF of a specific zone.
func (*WafApiV1) GetWafSettingsWithContext ¶ added in v0.12.1
func (wafApi *WafApiV1) GetWafSettingsWithContext(ctx context.Context, getWafSettingsOptions *GetWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
GetWafSettingsWithContext is an alternate form of the GetWafSettings method which supports a Context parameter
func (*WafApiV1) NewGetWafSettingsOptions ¶
func (*WafApiV1) NewGetWafSettingsOptions() *GetWafSettingsOptions
NewGetWafSettingsOptions : Instantiate GetWafSettingsOptions
func (*WafApiV1) NewUpdateWafSettingsOptions ¶
func (*WafApiV1) NewUpdateWafSettingsOptions() *UpdateWafSettingsOptions
NewUpdateWafSettingsOptions : Instantiate UpdateWafSettingsOptions
func (*WafApiV1) SetDefaultHeaders ¶ added in v0.12.1
SetDefaultHeaders sets HTTP headers to be sent in every request
func (*WafApiV1) SetEnableGzipCompression ¶ added in v0.12.1
SetEnableGzipCompression sets the service's EnableGzipCompression field
func (*WafApiV1) SetServiceURL ¶
SetServiceURL sets the service URL
func (*WafApiV1) UpdateWafSettings ¶
func (wafApi *WafApiV1) UpdateWafSettings(updateWafSettingsOptions *UpdateWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
UpdateWafSettings : Set WAF setting Set WAF (on | off) for a specific zone.
func (*WafApiV1) UpdateWafSettingsWithContext ¶ added in v0.12.1
func (wafApi *WafApiV1) UpdateWafSettingsWithContext(ctx context.Context, updateWafSettingsOptions *UpdateWafSettingsOptions) (result *WafResponse, response *core.DetailedResponse, err error)
UpdateWafSettingsWithContext is an alternate form of the UpdateWafSettings method which supports a Context parameter
type WafApiV1Options ¶
type WafApiV1Options struct {
ServiceName string
URL string
Authenticator core.Authenticator
// cloud resource name.
Crn *string `validate:"required"`
// zone id.
ZoneID *string `validate:"required"`
}
WafApiV1Options : Service options
type WafResponse ¶
type WafResponse struct {
// success.
Success *bool `json:"success" validate:"required"`
// errors.
Errors [][]string `json:"errors" validate:"required"`
// messages.
Messages [][]string `json:"messages" validate:"required"`
// result.
Result *WafResponseResult `json:"result" validate:"required"`
}
WafResponse : waf response.