domains

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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"`
	PaidType            string       `json:"paid_type,omitempty"`
	EnterpriseProjectId string       `q:"enterprise_project_id" json:"-"`
}

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

type CreateOptsBuilder interface {
	ToDomainCreateMap() (map[string]interface{}, error)
}

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.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Domain, error)

Extract is a function that accepts a result and extracts a domain.

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"`
	EnterpriseProjectId string `q:"enterprise_project_id"`
}

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

type DeleteOptsBuilder interface {
	ToDeleteQuery() (string, error)
}

DeleteOptsBuilder allows extensions to add additional parameters to the delete request.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

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.

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular Domain based on its unique ID.

func GetWithEpsID

func GetWithEpsID(c *golangsdk.ServiceClient, id, epsID string) (r GetResult)

func (GetResult) Extract

func (r GetResult) Extract() (*Domain, error)

Extract is a function that accepts a result and extracts 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"`
	EnterpriseProjectId string            `q:"enterprise_project_id" json:"-"`
}

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

type UpdateOptsBuilder interface {
	ToDomainUpdateMap() (map[string]interface{}, error)
}

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

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Domain, error)

Extract is a function that accepts a result and extracts a domain.

Jump to

Keyboard shortcuts

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