Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
This section is empty.
Types ¶
type BlockPage ¶
type BlockPage struct { Template string `json:"template" required:"true"` CustomPages []CustomPage `json:"custom_page,omitempty"` RedirectUrl string `json:"redirect_url,omitempty"` }
BlockPage contains the alarm page information
type CreateOpts ¶
type CreateOpts struct { HostName string `json:"hostname" required:"true"` Servers []ServerOpts `json:"server" required:"true"` PolicyId string `json:"policyid,omitempty"` CertificateId string `json:"certificateid,omitempty"` CertificateName string `json:"certificatename,omitempty"` Proxy *bool `json:"proxy,omitempty"` }
CreateOpts contains all the values needed to create a new backup.
func (CreateOpts) ToDomainCreateMap ¶
func (opts CreateOpts) ToDomainCreateMap() (map[string]interface{}, error)
ToDomainCreateMap builds a create request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Domain.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create will create a new Domain based on the values in CreateOpts.
type CustomPage ¶
type CustomPage struct { StatusCode string `json:"status_code" required:"true"` ContentType string `json:"content_type" required:"true"` Content string `json:"content" required:"true"` }
CustomPage contains the customized alarm page information
type DeleteOpts ¶
type DeleteOpts struct { // KeepPolicy specifies whether to retain the policy when deleting a domain name // the default value is false KeepPolicy bool `q:"keepPolicy"` }
DeleteOpts contains all the values needed to delete a domain.
func (DeleteOpts) ToDeleteQuery ¶
func (opts DeleteOpts) ToDeleteQuery() (string, error)
ToDeleteQuery builds a delete request body from DeleteOpts.
type DeleteOptsBuilder ¶
DeleteOptsBuilder allows extensions to add additional parameters to the delete request.
type DeleteResult ¶
DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func Delete ¶
func Delete(c *golangsdk.ServiceClient, id string, opts DeleteOptsBuilder) (r DeleteResult)
Delete will permanently delete a particular Domain based on its unique ID.
type Domain ¶
type Domain struct { // Domain ID Id string `json:"id"` // Domain name HostName string `json:"hostname"` // CNAME value PolicyId string `json:"policyid"` // Access Code AccessCode string `json:"access_code"` // WAF mode: 0 - disabled, 1 - enabled, -1 - bypassed. ProtectStatus int `json:"protect_status"` // Whether a domain name is connected to WAF AccessStatus int `json:"access_status"` // Protocol type Protocol string `json:"protocol,omitempty"` // Certificate ID CertificateId string `json:"certificateid"` // Certificate name CertificateName string `json:"certificatename"` //The original server information Servers []Server `json:"server"` //Whether proxy is configured Proxy *bool `json:"proxy"` // the time when the domain is created in unix timestamp Timestamp int `json:"timestamp"` }
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Domain.
type Server ¶
type Server struct { // Protocol type of the client FrontProtocol string `json:"front_protocol"` // Protocol used by WAF to forward client requests to the server BackProtocol string `json:"back_protocol"` // IP address or domain name of the web server that the client accesses. Address string `json:"address"` // Port number used by the web server Port int `json:"port"` // The type of network: ipv4, ipv6. Default: ipv4 Type string `json:"type"` // VPC ID where the site is located VpcId string `json:"vpc_id"` }
type ServerOpts ¶
type ServerOpts struct { FrontProtocol string `json:"front_protocol" required:"true"` BackProtocol string `json:"back_protocol" required:"true"` Address string `json:"address" required:"true"` Port int `json:"port" required:"true"` Type string `json:"type,omitempty"` VpcId string `json:"vpc_id,omitempty"` }
ServerOpts contains the origin server information.
type TrafficMark ¶
type TrafficMark struct { Sip []string `json:"sip,omitempty"` Cookie string `json:"cookie,omitempty"` Params string `json:"params,omitempty"` }
TrafficMark contains the traffic identification
type UpdateOpts ¶
type UpdateOpts struct { Proxy *bool `json:"proxy,omitempty"` CertificateId string `json:"certificateid,omitempty"` CertificateName string `json:"certificatename,omitempty"` Servers []ServerOpts `json:"server,omitempty"` Tls string `json:"tls,omitempty"` Cipher string `json:"cipher,omitempty"` BlockPages []BlockPage `json:"block_page,omitempty"` TrafficMarks []TrafficMark `json:"traffic_mark,omitempty"` Flag map[string]string `json:"flag,omitempty"` Extend map[string]string `json:"extend,omitempty"` }
UpdateOpts contains all the values needed to update a Domain.
func (UpdateOpts) ToDomainUpdateMap ¶
func (opts UpdateOpts) ToDomainUpdateMap() (map[string]interface{}, error)
ToDomainUpdateMap builds a update request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of a update operation. Call its Extract method to interpret it as a Domain.
func Update ¶
func Update(c *golangsdk.ServiceClient, domainID string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and uses the values to update a Domain.The response code from api is 200