availabilityzones

package
v2.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package availabilityzones provides the ability to get lists and detailed availability zone information and to extend a server result with availability zone information.

Example of Get Availability Zone Information

	allPages, err := availabilityzones.List(client).AllPages()
	if err != nil {
		panic(err)
	}

	availabilityZoneInfo, err := availabilityzones.ExtractAvailabilityZones(allPages)
	if err != nil {
		panic(err)
	}

	for _, zoneInfo := range availabilityZoneInfo {
  		fmt.Printf("%+v\n", zoneInfo)
	}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *eclcloud.ServiceClient) pagination.Pager

List will return the existing availability zones.

Types

type AvailabilityZone

type AvailabilityZone struct {
	ZoneName  string      `json:"zoneName"`
	ZoneState ZoneState   `json:"zoneState"`
	Hosts     interface{} `json:"hosts"`
}

AvailabilityZone contains all the information associated with an ECL AvailabilityZone.

func ExtractAvailabilityZones

func ExtractAvailabilityZones(r pagination.Page) ([]AvailabilityZone, error)

ExtractAvailabilityZones returns a slice of AvailabilityZones contained in a single page of results.

type AvailabilityZonePage

type AvailabilityZonePage struct {
	pagination.SinglePageBase
}

AvailabilityZonePage stores a single page of all AvailabilityZone results from a List call. Use the ExtractAvailabilityZones function to convert the results to a slice of AvailabilityZones.

type ZoneState

type ZoneState struct {
	// Returns true if the availability zone is available
	Available bool `json:"available"`
}

ZoneState represents the current state of the availability zone.

Directories

Path Synopsis
Package testing contains baremetal availability zone unit tests
Package testing contains baremetal availability zone unit tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL