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 CreateOpts ¶
type CreateOpts struct { // Domain name HostName string `json:"hostname" required:"true"` // The original server information Servers []ServerOpts `json:"server" required:"true"` // Whether proxy is configured Proxy *bool `json:"proxy" required:"true"` // Certificate ID CertificateId string `json:"certificate_id,omitempty"` // The type of the source IP header SipHeaderName string `json:"sip_header_name,omitempty"` // The HTTP request header for identifying the real source IP. SipHeaderList []string `json:"sip_header_list,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 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 Cname string `json:"cname"` // TXT record TxtCode string `json:"txt_code"` // Sub Domain name SubDomain string `json:"sub_domain"` // Policy ID PolicyID string `json:"policy_id"` // 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"` // Certificate ID CertificateId string `json:"certificate_id"` //The original server information Servers []Server `json:"server"` //Whether proxy is configured Proxy bool `json:"proxy"` //The type of the source IP header SipHeaderName string `json:"sip_header_name"` //The HTTP request header for identifying the real source IP. SipHeaderList []string `json:"sip_header_list"` // 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 ClientProtocol string `json:"client_protocol"` // Protocol used by WAF to forward client requests to the server ServerProtocol string `json:"server_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"` }
type ServerOpts ¶
type ServerOpts struct { // Protocol type of the client ClientProtocol string `json:"client_protocol" required:"true"` // Protocol used by WAF to forward client requests to the server ServerProtocol string `json:"server_protocol" required:"true"` // IP address or domain name of the web server that the client accesses. Address string `json:"address" required:"true"` // Port number used by the web server, the value ranges from 0 to 65535. Port string `json:"port" required:"true"` }
ServerOpts contains the origin server information.
type UpdateOpts ¶
type UpdateOpts struct { // Certificate ID CertificateId string `json:"certificate_id,omitempty"` // The original server information Servers []ServerOpts `json:"server,omitempty"` // Whether proxy is configured Proxy *bool `json:"proxy,omitempty"` // The type of the source IP header SipHeaderName string `json:"sip_header_name,omitempty"` // The HTTP request header for identifying the real source IP. SipHeaderList []string `json:"sip_header_list,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