github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/waf_hw/v1/domains/results.go (about)

     1  package domains
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type Domain struct {
     8  	// Domain ID
     9  	Id string `json:"id"`
    10  	// Domain name
    11  	HostName string `json:"hostname"`
    12  	// CNAME value
    13  	PolicyId string `json:"policyid"`
    14  	// Access Code
    15  	AccessCode string `json:"access_code"`
    16  	// WAF mode: 0 - disabled, 1 - enabled, -1 - bypassed.
    17  	ProtectStatus int `json:"protect_status"`
    18  	// Whether a domain name is connected to WAF
    19  	AccessStatus int `json:"access_status"`
    20  	// Protocol type
    21  	Protocol string `json:"protocol,omitempty"`
    22  	// Certificate ID
    23  	CertificateId string `json:"certificateid"`
    24  	// Certificate name
    25  	CertificateName string `json:"certificatename"`
    26  	//The original server information
    27  	Servers []Server `json:"server"`
    28  	//Whether proxy is configured
    29  	Proxy *bool `json:"proxy"`
    30  	// the time when the domain is created in unix timestamp
    31  	Timestamp int `json:"timestamp"`
    32  }
    33  
    34  type Server struct {
    35  	// Protocol type of the client
    36  	FrontProtocol string `json:"front_protocol"`
    37  	// Protocol used by WAF to forward client requests to the server
    38  	BackProtocol string `json:"back_protocol"`
    39  	// IP address or domain name of the web server that the client accesses.
    40  	Address string `json:"address"`
    41  	// Port number used by the web server
    42  	Port int `json:"port"`
    43  	// The type of network: ipv4, ipv6. Default: ipv4
    44  	Type string `json:"type"`
    45  	// VPC ID where the site is located
    46  	VpcId string `json:"vpc_id"`
    47  }
    48  
    49  type commonResult struct {
    50  	golangsdk.Result
    51  }
    52  
    53  // Extract is a function that accepts a result and extracts a domain.
    54  func (r commonResult) Extract() (*Domain, error) {
    55  	var response Domain
    56  	err := r.ExtractInto(&response)
    57  	return &response, err
    58  }
    59  
    60  // CreateResult represents the result of a create operation. Call its Extract
    61  // method to interpret it as a Domain.
    62  type CreateResult struct {
    63  	commonResult
    64  }
    65  
    66  // UpdateResult represents the result of a update operation. Call its Extract
    67  // method to interpret it as a Domain.
    68  type UpdateResult struct {
    69  	commonResult
    70  }
    71  
    72  // GetResult represents the result of a get operation. Call its Extract
    73  // method to interpret it as a Domain.
    74  type GetResult struct {
    75  	commonResult
    76  }
    77  
    78  // DeleteResult represents the result of a delete operation. Call its ExtractErr
    79  // method to determine if the request succeeded or failed.
    80  type DeleteResult struct {
    81  	golangsdk.ErrResult
    82  }