github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/waf/v1/domains/results.go (about)

     1  package domains
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  )
     6  
     7  type Domain struct {
     8  	// Domain ID
     9  	Id string `json:"id"`
    10  	// Domain name
    11  	HostName string `json:"hostname"`
    12  	// Access Code
    13  	AccessCode string `json:"access_code"`
    14  	// CNAME value
    15  	Cname string `json:"cname"`
    16  	// TXT record
    17  	TxtCode string `json:"txt_code"`
    18  	// Sub Domain name
    19  	SubDomain string `json:"sub_domain"`
    20  	// Policy ID
    21  	PolicyID string `json:"policy_id"`
    22  	// WAF mode
    23  	ProtectStatus int `json:"protect_status"`
    24  	// Whether a domain name is connected to WAF
    25  	AccessStatus int `json:"access_status"`
    26  	// Protocol type
    27  	Protocol string `json:"protocol"`
    28  	// TLS version
    29  	TLS string `json:"tls"`
    30  	// Cipher suite
    31  	Cipher string `json:"cipher"`
    32  	// Certificate ID
    33  	CertificateId string `json:"certificate_id"`
    34  	// The original server information
    35  	Server []Server `json:"server"`
    36  	// Whether proxy is configured
    37  	Proxy bool `json:"proxy"`
    38  	// The type of the source IP header
    39  	SipHeaderName string `json:"sip_header_name"`
    40  	// The HTTP request header for identifying the real source IP.
    41  	SipHeaderList []string `json:"sip_header_list"`
    42  	// Alarm page configuration
    43  	BlockPage BlockPage `json:"block_page"`
    44  }
    45  
    46  type Server struct {
    47  	// Protocol type of the client
    48  	ClientProtocol string `json:"client_protocol" required:"true"`
    49  	// Protocol used by WAF to forward client requests to the server
    50  	ServerProtocol string `json:"server_protocol" required:"true"`
    51  	// IP address or domain name of the web server that the client accesses.
    52  	Address string `json:"address" required:"true"`
    53  	// Port number used by the web server
    54  	Port int `json:"port" required:"true"`
    55  }
    56  
    57  type commonResult struct {
    58  	golangsdk.Result
    59  }
    60  
    61  // Extract is a function that accepts a result and extracts a domain.
    62  func (r commonResult) Extract() (*Domain, error) {
    63  	s := new(Domain)
    64  	err := r.ExtractIntoStructPtr(s, "")
    65  	return s, err
    66  }
    67  
    68  // CreateResult represents the result of a create operation. Call its Extract
    69  // method to interpret it as a Domain.
    70  type CreateResult struct {
    71  	commonResult
    72  }
    73  
    74  // UpdateResult represents the result of a update operation. Call its Extract
    75  // method to interpret it as a Domain.
    76  type UpdateResult struct {
    77  	commonResult
    78  }
    79  
    80  // GetResult represents the result of a get operation. Call its Extract
    81  // method to interpret it as a Domain.
    82  type GetResult struct {
    83  	commonResult
    84  }
    85  
    86  // DeleteResult represents the result of a delete operation. Call its ExtractErr
    87  // method to determine if the request succeeded or failed.
    88  type DeleteResult struct {
    89  	golangsdk.ErrResult
    90  }