2018-02-12 17:10:05 +00:00
package egoscale
2018-09-14 08:06:03 +00:00
import (
"net"
)
2018-02-12 17:10:05 +00:00
// Zone represents a data center
2018-09-14 08:06:03 +00:00
//
// TODO: represent correctly the capacity field.
2018-02-12 17:10:05 +00:00
type Zone struct {
2018-09-14 08:06:03 +00:00
AllocationState string ` json:"allocationstate,omitempty" doc:"the allocation state of the cluster" `
Description string ` json:"description,omitempty" doc:"Zone description" `
DhcpProvider string ` json:"dhcpprovider,omitempty" doc:"the dhcp Provider for the Zone" `
DisplayText string ` json:"displaytext,omitempty" doc:"the display text of the zone" `
DNS1 net . IP ` json:"dns1,omitempty" doc:"the first DNS for the Zone" `
DNS2 net . IP ` json:"dns2,omitempty" doc:"the second DNS for the Zone" `
GuestCIDRAddress * CIDR ` json:"guestcidraddress,omitempty" doc:"the guest CIDR address for the Zone" `
ID * UUID ` json:"id,omitempty" doc:"Zone id" `
InternalDNS1 net . IP ` json:"internaldns1,omitempty" doc:"the first internal DNS for the Zone" `
InternalDNS2 net . IP ` json:"internaldns2,omitempty" doc:"the second internal DNS for the Zone" `
IP6DNS1 net . IP ` json:"ip6dns1,omitempty" doc:"the first IPv6 DNS for the Zone" `
IP6DNS2 net . IP ` json:"ip6dns2,omitempty" doc:"the second IPv6 DNS for the Zone" `
LocalStorageEnabled * bool ` json:"localstorageenabled,omitempty" doc:"true if local storage offering enabled, false otherwise" `
Name string ` json:"name,omitempty" doc:"Zone name" `
NetworkType string ` json:"networktype,omitempty" doc:"the network type of the zone; can be Basic or Advanced" `
ResourceDetails map [ string ] string ` json:"resourcedetails,omitempty" doc:"Meta data associated with the zone (key/value pairs)" `
SecurityGroupsEnabled * bool ` json:"securitygroupsenabled,omitempty" doc:"true if security groups support is enabled, false otherwise" `
Tags [ ] ResourceTag ` json:"tags,omitempty" doc:"the list of resource tags associated with zone." `
Vlan string ` json:"vlan,omitempty" doc:"the vlan range of the zone" `
ZoneToken string ` json:"zonetoken,omitempty" doc:"Zone Token" `
}
// ListRequest builds the ListZones request
func ( zone Zone ) ListRequest ( ) ( ListCommand , error ) {
req := & ListZones {
2019-03-14 10:04:04 +00:00
ID : zone . ID ,
Name : zone . Name ,
2018-09-14 08:06:03 +00:00
}
return req , nil
2018-02-12 17:10:05 +00:00
}
2019-03-14 10:04:04 +00:00
//go:generate go run generate/main.go -interface=Listable ListZones
2018-02-12 17:10:05 +00:00
// ListZones represents a query for zones
type ListZones struct {
2018-09-14 08:06:03 +00:00
Available * bool ` json:"available,omitempty" doc:"true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false." `
ID * UUID ` json:"id,omitempty" doc:"the ID of the zone" `
Keyword string ` json:"keyword,omitempty" doc:"List by keyword" `
Name string ` json:"name,omitempty" doc:"the name of the zone" `
2018-02-12 17:10:05 +00:00
Page int ` json:"page,omitempty" `
PageSize int ` json:"pagesize,omitempty" `
2018-09-14 08:06:03 +00:00
ShowCapacities * bool ` json:"showcapacities,omitempty" doc:"flag to display the capacity of the zones" `
Tags [ ] ResourceTag ` json:"tags,omitempty" doc:"List zones by resource tags (key/value pairs)" `
_ bool ` name:"listZones" description:"Lists zones" `
2018-02-12 17:10:05 +00:00
}
2018-09-14 08:06:03 +00:00
// ListZonesResponse represents a list of zones
type ListZonesResponse struct {
Count int ` json:"count" `
Zone [ ] Zone ` json:"zone" `
2018-02-12 17:10:05 +00:00
}