Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*string, error)
Create is a method used to create a new cloud WAF using given parameters.
func Update ¶
func Update(client *golangsdk.ServiceClient, opts UpdateOpts) (*string, error)
Update is a method used to update the cloud WAF using given parameters.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // The ID of the project to which the cloud WAF belongs. ProjectId string `json:"project_id" required:"true"` // Whether the order is auto pay. IsAutoPay *bool `json:"is_auto_pay" required:"true"` // Whether auto renew is enabled for resource payment. IsAutoRenew *bool `json:"is_auto_renew" required:"true"` // The region where the cloud WAF is located. RegionId string `json:"region_id" required:"true"` // The configuration of the cloud WAF, such as specification code. ProductInfo *ProductInfo `json:"waf_product_info,omitempty"` // The configuration of the bandwidth extended packages. BandwidthExpackProductInfo *ExpackProductInfo `json:"bandwidth_expack_product_info,omitempty"` // The configuration of the domain extended packages. DomainExpackProductInfo *ExpackProductInfo `json:"domain_expack_product_info,omitempty"` // The configuration of the rule extended packages. RuleExpackProductInfo *ExpackProductInfo `json:"rule_expack_product_info,omitempty"` // The ID of the enterprise project to which the cloud WAF belongs. EnterpriseProjectId string `q:"enterprise_project_id" json:"-"` }
CreateOpts is the structure required by the 'Create' method to create a cloud WAF.
type ExpackProductInfo ¶
type ExpackProductInfo struct { // The number of the extended packages ResourceSize int `json:"resource_size,omitempty"` }
ExpackProductInfo is an object that represents the configuration of the extended packages.
type Instance ¶
type Instance struct { // The type of the cloud WAF. // + -2: Freezen // + -1: Not subscribed // + 2: Standard edition // + 3: Professional edition // + 4: Platinum edition // + 7: Introduction edition. // + 22: Post paid edition. Type int `json:"type"` // The list of all cloud WAF resources. Resources []Resource `json:"resources"` // Whether the current user is new user. IsNewUser bool `json:"isNewUser"` // The subscribe information of the dedicated mode. Premium Premium `json:"premium"` }
Instance is the structure that represents the details of the cloud WAF instance.
type Premium ¶
type Premium struct { // Whether the dedicated mode is opened. Purchased bool `json:"purchased"` // The number of the dedicated instances. Total int `json:"total"` // The number of the ELB instances. ELB int `json:"elb"` // The number of the dedicated WAFs. Dedicated int `json:"dedicated"` }
Premium is the structure that represents the configuration of the dedicated mode.
type ProductInfo ¶
type ProductInfo struct { // The specification of the cloud WAF. ResourceSpecCode string `json:"resource_spec_code,omitempty"` // The charging period unit of the cloud WAF. PeriodType string `json:"period_type,omitempty"` // The charging period of the cloud WAF. PeriodNum int `json:"period_num,omitempty"` }
ProductInfo is an object that represents the configuration of the cloud WAF.
type Resource ¶
type Resource struct { // Resource ID. ID string `json:"resourceId"` // Resource type. // + hws.resource.type.waf // + hws.resource.type.waf.domain // + hws.resource.type.waf.bandwidth // + hws.resource.type.waf.rule Type string `json:"resourceType"` // The number of the resources. Size int `json:"resourceSize"` // The cloud service type corresponding to the cloud service product. CloudServiceType string `json:"cloudServiceType"` // The specification code of the resource. SpecCode string `json:"resourceSpecCode"` // The current status of the resource. Status int `json:"status"` // The expire time of the resource. // + 0: normal // + 1: freezen ExpireTime string `json:"expireTime"` }
Resource is the structure that represents the details of the WAF resource.
type UpdateOpts ¶
type UpdateOpts struct { // The ID of the project to which the cloud WAF belongs. ProjectId string `json:"project_id" required:"true"` // Whether the order is auto pay. IsAutoPay *bool `json:"is_auto_pay" required:"true"` // The configuration of the cloud WAF, such as specification code. ProductInfo *UpdateProductInfo `json:"waf_product_info,omitempty"` // The configuration of the bandwidth extended packages. BandwidthExpackProductInfo *ExpackProductInfo `json:"bandwidth_expack_product_info,omitempty"` // The configuration of the domain extended packages. DomainExpackProductInfo *ExpackProductInfo `json:"domain_expack_product_info,omitempty"` // The configuration of the rule extended packages. RuleExpackProductInfo *ExpackProductInfo `json:"rule_expack_product_info,omitempty"` // The ID of the enterprise project to which the cloud WAF belongs. EnterpriseProjectId string `q:"enterprise_project_id" json:"-"` }
UpdateOpts is the structure required by the 'Update' method to update the cloud WAF configuration.
type UpdateProductInfo ¶
type UpdateProductInfo struct { // Whether the AS path attributes of the routes are not compared during load balancing. ResourceSpecCode string `json:"resource_spec_code,omitempty"` }
UpdateProductInfo is an object that represents the update configuration of the cloud WAF.