github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/elb/v3/listeners/results.go (about) 1 package listeners 2 3 import ( 4 "github.com/chnsz/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 // Whether enable proxy protocol 63 ProxyProtocolEnable bool `json:"proxy_protocol_enable"` 64 65 // The keepalive timeout of the Listener. 66 KeepaliveTimeout int `json:"keepalive_timeout"` 67 68 // The client timeout of the Listener. 69 ClientTimeout int `json:"client_timeout"` 70 71 // The member timeout of the Listener. 72 MemberTimeout int `json:"member_timeout"` 73 74 // The ipgroup of the Listener. 75 IpGroup IpGroup `json:"ipgroup"` 76 77 // The http insert headers of the Listener. 78 InsertHeaders InsertHeaders `json:"insert_headers"` 79 80 // Transparent client ip enable 81 TransparentClientIP bool `json:"transparent_client_ip_enable"` 82 83 // The creation time of the current listener 84 CreatedAt string `json:"created_at"` 85 86 // The update time of the current listener 87 UpdatedAt string `json:"updated_at"` 88 89 // The port range of the current listener 90 PortRanges []PortRange `json:"port_ranges"` 91 92 // ELB gzip enable 93 GzipEnable bool `json:"gzip_enable"` 94 95 // The QUIC configuration for the current listener 96 QuicConfig QuicConfig `json:"quic_config"` 97 98 // Security Policy ID 99 SecurityPolicyId string `json:"security_policy_id"` 100 101 // The SNI certificates used by the listener. 102 SniMatchAlgo string `json:"sni_match_algo"` 103 104 // Whether enable ssl early data 105 SslEarlyDataEnable bool `json:"ssl_early_data_enable"` 106 107 // Enhance L7policy enable 108 EnhanceL7policy bool `json:"enhance_l7policy_enable"` 109 110 // Update protection status 111 ProtectionStatus string `json:"protection_status"` 112 113 // Update protection reason 114 ProtectionReason string `json:"protection_reason"` 115 } 116 117 type commonResult struct { 118 golangsdk.Result 119 } 120 121 // Extract is a function that accepts a result and extracts a listener. 122 func (r commonResult) Extract() (*Listener, error) { 123 var s struct { 124 Listener *Listener `json:"listener"` 125 } 126 err := r.ExtractInto(&s) 127 return s.Listener, err 128 } 129 130 // CreateResult represents the result of a create operation. Call its Extract 131 // method to interpret it as a Listener. 132 type CreateResult struct { 133 commonResult 134 } 135 136 // GetResult represents the result of a get operation. Call its Extract 137 // method to interpret it as a Listener. 138 type GetResult struct { 139 commonResult 140 } 141 142 // UpdateResult represents the result of an update operation. Call its Extract 143 // method to interpret it as a Listener. 144 type UpdateResult struct { 145 commonResult 146 } 147 148 // DeleteResult represents the result of a delete operation. Call its 149 // ExtractErr method to determine if the request succeeded or failed. 150 type DeleteResult struct { 151 golangsdk.ErrResult 152 }