github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/elb/v3/listeners/results.go (about)

     1  package listeners
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type LoadBalancerID struct {
     8  	ID string `json:"id"`
     9  }
    10  
    11  // Listener is the primary load balancing configuration object that specifies
    12  // the loadbalancer and port on which client traffic is received, as well
    13  // as other details such as the load balancing method to be use, protocol, etc.
    14  type Listener struct {
    15  	// The unique ID for the Listener.
    16  	ID string `json:"id"`
    17  
    18  	// The administrative state of the Listener. A valid value is true (UP) or false (DOWN).
    19  	AdminStateUp bool `json:"admin_state_up"`
    20  
    21  	// the ID of the CA certificate used by the listener.
    22  	CAContainerRef string `json:"client_ca_tls_container_ref"`
    23  
    24  	// The maximum number of connections allowed for the Loadbalancer.
    25  	// Default is -1, meaning no limit.
    26  	ConnLimit int `json:"connection_limit"`
    27  
    28  	// The UUID of default pool. Must have compatible protocol with listener.
    29  	DefaultPoolID string `json:"default_pool_id"`
    30  
    31  	// A reference to a Barbican container of TLS secrets.
    32  	DefaultTlsContainerRef string `json:"default_tls_container_ref"`
    33  
    34  	// Human-readable description for the Listener.
    35  	Description string `json:"description"`
    36  
    37  	// whether to use HTTP2.
    38  	Http2Enable bool `json:"http2_enable"`
    39  
    40  	// A list of load balancer IDs.
    41  	Loadbalancers []LoadBalancerID `json:"loadbalancers"`
    42  
    43  	// Human-readable name for the Listener. Does not have to be unique.
    44  	Name string `json:"name"`
    45  
    46  	// The protocol to loadbalance. A valid value is TCP, HTTP, or HTTPS.
    47  	Protocol string `json:"protocol"`
    48  
    49  	// The port on which to listen to client traffic that is associated with the
    50  	// Loadbalancer. A valid value is from 0 to 65535.
    51  	ProtocolPort int `json:"protocol_port"`
    52  
    53  	// The list of references to TLS secrets.
    54  	SniContainerRefs []string `json:"sni_container_refs"`
    55  
    56  	// Specifies the security policy used by the listener.
    57  	TlsCiphersPolicy string `json:"tls_ciphers_policy"`
    58  
    59  	// Whether enable member retry
    60  	EnableMemberRetry bool `json:"enable_member_retry"`
    61  
    62  	// The keepalive timeout of the Listener.
    63  	KeepaliveTimeout int `json:"keepalive_timeout"`
    64  
    65  	// The client timeout of the Listener.
    66  	ClientTimeout int `json:"client_timeout"`
    67  
    68  	// The member timeout of the Listener.
    69  	MemberTimeout int `json:"member_timeout"`
    70  
    71  	// The ipgroup of the Listener.
    72  	IpGroup IpGroup `json:"ipgroup"`
    73  
    74  	// The http insert headers of the Listener.
    75  	InsertHeaders InsertHeadersInfo `json:"insert_headers"`
    76  
    77  	// Transparent client ip enable
    78  	TransparentClientIP bool `json:"transparent_client_ip_enable"`
    79  
    80  	// Enhance L7policy enable
    81  	EnhanceL7policy bool `json:"enhance_l7policy_enable"`
    82  }
    83  
    84  type InsertHeadersInfo struct {
    85  	ForwardedELBIP   bool `json:"X-Forwarded-ELB-IP,omitempty"`
    86  	ForwardedPort    bool `json:"X-Forwarded-Port,omitempty"`
    87  	ForwardedForPort bool `json:"X-Forwarded-For-Port,omitempty"`
    88  	ForwardedHost    bool `json:"X-Forwarded-Host" required:"true"`
    89  }
    90  
    91  type commonResult struct {
    92  	golangsdk.Result
    93  }
    94  
    95  // Extract is a function that accepts a result and extracts a listener.
    96  func (r commonResult) Extract() (*Listener, error) {
    97  	var s struct {
    98  		Listener *Listener `json:"listener"`
    99  	}
   100  	err := r.ExtractInto(&s)
   101  	return s.Listener, err
   102  }
   103  
   104  // CreateResult represents the result of a create operation. Call its Extract
   105  // method to interpret it as a Listener.
   106  type CreateResult struct {
   107  	commonResult
   108  }
   109  
   110  // GetResult represents the result of a get operation. Call its Extract
   111  // method to interpret it as a Listener.
   112  type GetResult struct {
   113  	commonResult
   114  }
   115  
   116  // UpdateResult represents the result of an update operation. Call its Extract
   117  // method to interpret it as a Listener.
   118  type UpdateResult struct {
   119  	commonResult
   120  }
   121  
   122  // DeleteResult represents the result of a delete operation. Call its
   123  // ExtractErr method to determine if the request succeeded or failed.
   124  type DeleteResult struct {
   125  	golangsdk.ErrResult
   126  }