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

     1  package loadbalancers
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  // LoadBalancer is the primary load balancing configuration object that
     8  // specifies the virtual IP address on which client traffic is received, as well
     9  // as other details such as the load balancing method to be use, protocol, etc.
    10  type LoadBalancer struct {
    11  	// The unique ID for the LoadBalancer.
    12  	ID string `json:"id"`
    13  
    14  	// Human-readable description for the Loadbalancer.
    15  	Description string `json:"description"`
    16  
    17  	// The provisioning status of the LoadBalancer.
    18  	// This value is ACTIVE, PENDING_CREATE or ERROR.
    19  	ProvisioningStatus string `json:"provisioning_status"`
    20  
    21  	// The administrative state of the Loadbalancer.
    22  	// A valid value is true (UP) or false (DOWN).
    23  	AdminStateUp bool `json:"admin_state_up"`
    24  
    25  	// The name of the provider.
    26  	Provider string `json:"provider"`
    27  
    28  	// Pools are the pools related to this Loadbalancer.
    29  	Pools []PoolRef `json:"pools"`
    30  
    31  	// Listeners are the listeners related to this Loadbalancer.
    32  	Listeners []ListenerRef `json:"listeners"`
    33  
    34  	// The operating status of the LoadBalancer. This value is ONLINE or OFFLINE.
    35  	OperatingStatus string `json:"operating_status"`
    36  
    37  	// The IP address of the Loadbalancer.
    38  	VipAddress string `json:"vip_address"`
    39  
    40  	// The UUID of the subnet on which to allocate the virtual IP for the
    41  	// Loadbalancer address.
    42  	VipSubnetCidrID string `json:"vip_subnet_cidr_id"`
    43  
    44  	// Human-readable name for the LoadBalancer. Does not have to be unique.
    45  	Name string `json:"name"`
    46  
    47  	// Owner of the LoadBalancer.
    48  	ProjectID string `json:"project_id"`
    49  
    50  	// The UUID of the port associated with the IP address.
    51  	VipPortID string `json:"vip_port_id"`
    52  
    53  	// The UUID of a flavor if set.
    54  	Tags []Tag `json:"tags"`
    55  
    56  	// Guaranteed.
    57  	Guaranteed bool `json:"guaranteed"`
    58  
    59  	// The VPC ID.
    60  	VpcID string `json:"vpc_id"`
    61  
    62  	// EIP Info.
    63  	Eips []EipInfo `json:"eips"`
    64  
    65  	// Ipv6 Vip Address.
    66  	Ipv6VipAddress string `json:"ipv6_vip_address"`
    67  
    68  	// Ipv6 Vip Virsubnet ID.
    69  	Ipv6VipVirsubnetID string `json:"ipv6_vip_virsubnet_id"`
    70  
    71  	// Ipv6 Vip Port ID.
    72  	Ipv6VipPortID string `json:"ipv6_vip_port_id"`
    73  
    74  	// Availability Zone List.
    75  	AvailabilityZoneList []string `json:"availability_zone_list"`
    76  
    77  	// The UUID of the enterprise project who owns the Loadbalancer.
    78  	EnterpriseProjectID string `json:"enterprise_project_id"`
    79  
    80  	// Billing Info.
    81  	BillingInfo string `json:"billing_info"`
    82  
    83  	// L4 Flavor ID.
    84  	L4FlavorID string `json:"l4_flavor_id"`
    85  
    86  	// L4 Scale Flavor ID.
    87  	L4ScaleFlavorID string `json:"l4_scale_flavor_id"`
    88  
    89  	// L7 Flavor ID.
    90  	L7FlavorID string `json:"l7_flavor_id"`
    91  
    92  	// L7 Scale Flavor ID.
    93  	L7ScaleFlavorID string `json:"l7_scale_flavor_id"`
    94  
    95  	// Public IP Info.
    96  	PublicIps []PublicIpInfo `json:"publicips"`
    97  
    98  	// Elb Virsubnet IDs.
    99  	ElbVirsubnetIDs []string `json:"elb_virsubnet_ids"`
   100  
   101  	// Elb Virsubnet Type.
   102  	ElbVirsubnetType string `json:"elb_virsubnet_type"`
   103  
   104  	// Ip Target Enable.
   105  	IpTargetEnable bool `json:"ip_target_enable"`
   106  
   107  	// Frozen Scene.
   108  	FrozenScene string `json:"frozen_scene"`
   109  
   110  	// Ipv6 Bandwidth.
   111  	IPV6Bandwidth BandwidthRef `json:"ipv6_bandwidth"`
   112  
   113  	// Deletion Protection Enable.
   114  	DeletionProtectionEnable bool `json:"deletion_protection_enable"`
   115  }
   116  
   117  // EipInfo
   118  type EipInfo struct {
   119  	// Eip ID
   120  	EipID string `json:"eip_id"`
   121  	// Eip Address
   122  	EipAddress string `json:"eip_address"`
   123  	// Eip Address
   124  	IpVersion int `json:"ip_version"`
   125  }
   126  
   127  // PoolRef
   128  type PoolRef struct {
   129  	ID string `json:"id"`
   130  }
   131  
   132  // ListenerRef
   133  type ListenerRef struct {
   134  	ID string `json:"id"`
   135  }
   136  
   137  // PublicIPInfo
   138  type PublicIpInfo struct {
   139  	// Public IP ID
   140  	PublicIpID string `json:"publicip_id"`
   141  	// Public IP Address
   142  	PublicIpAddress string `json:"publicip_address"`
   143  	// IP Version
   144  	IpVersion int `json:"ip_version"`
   145  }
   146  
   147  // StatusTree represents the status of a loadbalancer.
   148  type StatusTree struct {
   149  	Loadbalancer *LoadBalancer `json:"loadbalancer"`
   150  }
   151  
   152  type commonResult struct {
   153  	golangsdk.Result
   154  }
   155  
   156  // Extract is a function that accepts a result and extracts a loadbalancer.
   157  func (r commonResult) Extract() (*LoadBalancer, error) {
   158  	var s struct {
   159  		LoadBalancer *LoadBalancer `json:"loadbalancer"`
   160  	}
   161  	err := r.ExtractInto(&s)
   162  	return s.LoadBalancer, err
   163  }
   164  
   165  // GetStatusesResult represents the result of a GetStatuses operation.
   166  // Call its Extract method to interpret it as a StatusTree.
   167  type GetStatusesResult struct {
   168  	golangsdk.Result
   169  }
   170  
   171  // Extract is a function that accepts a result and extracts the status of
   172  // a Loadbalancer.
   173  func (r GetStatusesResult) Extract() (*StatusTree, error) {
   174  	var s struct {
   175  		Statuses *StatusTree `json:"statuses"`
   176  	}
   177  	err := r.ExtractInto(&s)
   178  	return s.Statuses, err
   179  }
   180  
   181  // CreateResult represents the result of a create operation. Call its Extract
   182  // method to interpret it as a LoadBalancer.
   183  type CreateResult struct {
   184  	commonResult
   185  }
   186  
   187  // GetResult represents the result of a get operation. Call its Extract
   188  // method to interpret it as a LoadBalancer.
   189  type GetResult struct {
   190  	commonResult
   191  }
   192  
   193  // UpdateResult represents the result of an update operation. Call its Extract
   194  // method to interpret it as a LoadBalancer.
   195  type UpdateResult struct {
   196  	commonResult
   197  }
   198  
   199  // DeleteResult represents the result of a delete operation. Call its
   200  // ExtractErr method to determine if the request succeeded or failed.
   201  type DeleteResult struct {
   202  	golangsdk.ErrResult
   203  }