Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions openstack/elb/v3/listeners/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ type CreateOpts struct {
MemberTimeout *int `json:"member_timeout,omitempty"`

// The ipgroup of the Listener.
IpGroup IpGroup `json:"ipgroup,omitempty"`
IpGroup *IpGroup `json:"ipgroup,omitempty"`

// The http insert headers of the Listener.
InsertHeaders *InsertHeaders `json:"insert_headers,omitempty"`

// Transparent client ip enable
TransparentClientIP *bool `json:"transparent_client_ip_enable,omitempty"`
Expand All @@ -88,10 +91,17 @@ type CreateOpts struct {

type IpGroup struct {
IpGroupId string `json:"ipgroup_id" required:"true"`
Enable *bool `json:"enable_ipgroup" required:"true"`
Enable bool `json:"enable_ipgroup" required:"true"`
Type string `json:"type" required:"true"`
}

type InsertHeaders struct {
ForwardedELBIP *bool `json:"X-Forwarded-ELB-IP,omitempty"`
ForwardedPort *bool `json:"X-Forwarded-Port,omitempty"`
ForwardedForPort *bool `json:"X-Forwarded-For-Port,omitempty"`
ForwardedHost *bool `json:"X-Forwarded-Host" required:"true"`
}

// ToListenerCreateMap builds a request body from CreateOpts.
func (opts CreateOpts) ToListenerCreateMap() (map[string]interface{}, error) {
return golangsdk.BuildRequestBody(opts, "listener")
Expand Down Expand Up @@ -126,20 +136,25 @@ type UpdateOptsBuilder interface {
ToListenerUpdateMap() (map[string]interface{}, error)
}

type IpGroupUpdate struct {
IpGroupId string `json:"ipgroup_id,omitempty"`
Type string `json:"type,omitempty"`
}

// UpdateOpts represents options for updating a Listener.
type UpdateOpts struct {
// The administrative state of the Listener. A valid value is true (UP)
// or false (DOWN).
AdminStateUp *bool `json:"admin_state_up,omitempty"`

// the ID of the CA certificate used by the listener.
CAContainerRef string `json:"client_ca_tls_container_ref,omitempty"`
CAContainerRef *string `json:"client_ca_tls_container_ref,omitempty"`

// The ID of the default pool with which the Listener is associated.
DefaultPoolID string `json:"default_pool_id,omitempty"`

// A reference to a Barbican container of TLS secrets.
DefaultTlsContainerRef string `json:"default_tls_container_ref,omitempty"`
// A reference to a container of TLS secrets.
DefaultTlsContainerRef *string `json:"default_tls_container_ref,omitempty"`

// Human-readable description for the Listener.
Description string `json:"description,omitempty"`
Expand All @@ -151,10 +166,10 @@ type UpdateOpts struct {
Name string `json:"name,omitempty"`

// A list of references to TLS secrets.
SniContainerRefs []string `json:"sni_container_refs,omitempty"`
SniContainerRefs *[]string `json:"sni_container_refs,omitempty"`

// Specifies the security policy used by the listener.
TlsCiphersPolicy string `json:"tls_ciphers_policy,omitempty"`
TlsCiphersPolicy *string `json:"tls_ciphers_policy,omitempty"`

// Whether enable member retry
EnableMemberRetry *bool `json:"enable_member_retry,omitempty"`
Expand All @@ -169,7 +184,10 @@ type UpdateOpts struct {
MemberTimeout *int `json:"member_timeout,omitempty"`

// The ipgroup of the Listener.
IpGroup IpGroup `json:"ipgroup,omitempty"`
IpGroup *IpGroupUpdate `json:"ipgroup,omitempty"`

// The http insert headers of the Listener.
InsertHeaders *InsertHeaders `json:"insert_headers,omitempty"`

// Transparent client ip enable
TransparentClientIP *bool `json:"transparent_client_ip_enable,omitempty"`
Expand Down
28 changes: 17 additions & 11 deletions openstack/elb/v3/listeners/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,36 @@ type Listener struct {
// Specifies the security policy used by the listener.
TlsCiphersPolicy string `json:"tls_ciphers_policy"`

// The provisioning status of the listener.
// This value is ACTIVE, PENDING_* or ERROR.
ProvisioningStatus string `json:"provisioning_status"`

// Whether enable member retry
EnableMemberRetry *bool `json:"enable_member_retry,omitempty"`
EnableMemberRetry bool `json:"enable_member_retry"`

// The keepalive timeout of the Listener.
KeepaliveTimeout *int `json:"keepalive_timeout,omitempty"`
KeepaliveTimeout int `json:"keepalive_timeout"`

// The client timeout of the Listener.
ClientTimeout *int `json:"client_timeout,omitempty"`
ClientTimeout int `json:"client_timeout"`

// The member timeout of the Listener.
MemberTimeout *int `json:"member_timeout,omitempty"`
MemberTimeout int `json:"member_timeout"`

// The ipgroup of the Listener.
IpGroup IpGroup `json:"ipgroup,omitempty"`
IpGroup IpGroup `json:"ipgroup"`

// The http insert headers of the Listener.
InsertHeaders InsertHeadersInfo `json:"insert_headers"`

// Transparent client ip enable
TransparentClientIP *bool `json:"transparent_client_ip_enable,omitempty"`
TransparentClientIP bool `json:"transparent_client_ip_enable"`

// Enhance L7policy enable
EnhanceL7policy *bool `json:"enhance_l7policy_enable,omitempty"`
EnhanceL7policy bool `json:"enhance_l7policy_enable"`
}

type InsertHeadersInfo struct {
ForwardedELBIP bool `json:"X-Forwarded-ELB-IP,omitempty"`
ForwardedPort bool `json:"X-Forwarded-Port,omitempty"`
ForwardedForPort bool `json:"X-Forwarded-For-Port,omitempty"`
ForwardedHost bool `json:"X-Forwarded-Host" required:"true"`
}

type commonResult struct {
Expand Down