Documentation
¶
Index ¶
- Constants
- Variables
- func DescribeAvailabilityZones(regionName string) ([]ec2Types.AvailabilityZone, error)
- func FilterInstaceTypesOfferedByLocation(instanceTypes []string, args *LocationArgs) ([]string, error)
- func GetAvailabilityZones(region string, excludedZoneIDs []string) []string
- func GetBucketLocation(bucketName string) (*string, error)
- func GetBucketLocationFromS3Path(p string) (*string, error)
- func GetCluster(clusterName, region string) (*string, error)
- func GetDedicatedHost(hostID string) (*ec2Types.Host, error)
- func GetDedicatedHosts(r DedicatedHostResquest) ([]ec2Types.Host, error)
- func GetInstanceByRegion(r InstanceResquest, regionName string) ([]ec2Types.Instance, error)
- func GetRandomAvailabilityZone(region string, excludedAZs []string) (*string, error)
- func GetRandomPublicSubnet(region string) (*string, error)
- func GetRegions() ([]string, error)
- func GetRegionsByOptInStatus(optInStaus []string) ([]string, error)
- func GetRole(roleName string) (*string, error)
- func IsInstanceTypeOfferedByLocation(instanceType string, args *LocationArgs) (bool, error)
- func LokupRegionOfferingInstanceType(instanceType string) (*string, error)
- func SpotInfo(mCtx *mc.Context, args *SpotInfoArgs) (*spot.SpotResults, error)
- func ValidateS3Path(p string) bool
- type AvailabilityZonesResult
- type ComputeSelector
- type DedicatedHostResquest
- type ImageInfo
- type ImageRequest
- type InstanceResquest
- type LocationArgs
- type SpotInfoArgs
- type SpotInfoResult
- type SpotSelector
Constants ¶
const ERROR_NO_AMI = "no AMI"
Variables ¶
var ( ErrNoDefaultVPC = fmt.Errorf("no VPC marked as default") ErrNoRouteTableBySubnetID = fmt.Errorf("no Route table by association.subnet-id") )
var ( OptInStatusNotRequired string = "opt-in-not-required" OptInStatusOptedIn string = "opted-in" )
var ErrECSClusterNotFound = fmt.Errorf("cluster not found")
var RegionTimezones = map[string]string{
"us-east-1": "America/New_York",
"us-east-2": "America/New_York",
"us-west-1": "America/Los_Angeles",
"us-west-2": "America/Los_Angeles",
"af-south-1": "Africa/Johannesburg",
"ap-east-1": "Asia/Hong_Kong",
"ap-south-1": "Asia/Kolkata",
"ap-south-2": "Asia/Kolkata",
"ap-southeast-1": "Asia/Singapore",
"ap-southeast-2": "Australia/Sydney",
"ap-southeast-3": "Asia/Jakarta",
"ap-southeast-4": "Asia/Manila",
"ap-northeast-1": "Asia/Tokyo",
"ap-northeast-2": "Asia/Seoul",
"ap-northeast-3": "Asia/Tokyo",
"ca-central-1": "America/Toronto",
"eu-central-1": "Europe/Berlin",
"eu-central-2": "Europe/Zurich",
"eu-north-1": "Europe/Stockholm",
"eu-south-1": "Europe/Rome",
"eu-south-2": "Europe/Madrid",
"eu-west-1": "Europe/Dublin",
"eu-west-2": "Europe/London",
"eu-west-3": "Europe/Paris",
"me-central-1": "Asia/Riyadh",
"me-south-1": "Asia/Dubai",
"sa-east-1": "America/Sao_Paulo",
"il-central-1": "Asia/Jerusalem",
}
Functions ¶
func DescribeAvailabilityZones ¶
func DescribeAvailabilityZones(regionName string) ([]ec2Types.AvailabilityZone, error)
func FilterInstaceTypesOfferedByLocation ¶ added in v0.9.7
func FilterInstaceTypesOfferedByLocation(instanceTypes []string, args *LocationArgs) ([]string, error)
Get InstanceTypes offerings on current location it is valid for Regions or Azs
func GetAvailabilityZones ¶
func GetBucketLocation ¶ added in v0.8.0
func GetBucketLocationFromS3Path ¶ added in v0.8.0
func GetCluster ¶ added in v0.7.4
func GetDedicatedHosts ¶
func GetDedicatedHosts(r DedicatedHostResquest) ([]ec2Types.Host, error)
This function check on all regions for the dedicated host and return the list of hosts matching the request params
func GetInstanceByRegion ¶
func GetInstanceByRegion(r InstanceResquest, regionName string) ([]ec2Types.Instance, error)
func GetRandomPublicSubnet ¶ added in v0.7.4
func GetRegions ¶
func GetRegionsByOptInStatus ¶ added in v0.9.9
func IsInstanceTypeOfferedByLocation ¶ added in v0.9.7
func IsInstanceTypeOfferedByLocation(instanceType string, args *LocationArgs) (bool, error)
Check if InstanceType is offered on current location it is valid for Regions or Azs if az is nill it will check on region
func LokupRegionOfferingInstanceType ¶
Check on all regions which offers the type of instance got one having it
func SpotInfo ¶ added in v0.9.5
func SpotInfo(mCtx *mc.Context, args *SpotInfoArgs) (*spot.SpotResults, error)
This function checks worlwide which is the best place at any point in time to spin a spot machine it basically cross the information for spot prices and placement scores the target machine is defined through the inputs for the funtion: * productType to be executed within the machine * instanceTypes types of machines able to execute the workload * amiName ensures the ami is available on the spot option the output is the information realted to the best spot option for the target machine
func ValidateS3Path ¶ added in v0.8.0
Types ¶
type AvailabilityZonesResult ¶
type AvailabilityZonesResult struct {
AvailabilityZones []ec2Types.AvailabilityZone
Err error
}
type ComputeSelector ¶ added in v0.9.5
type ComputeSelector struct{}
func NewComputeSelector ¶ added in v0.9.5
func NewComputeSelector() *ComputeSelector
func (*ComputeSelector) Select ¶ added in v0.9.5
func (c *ComputeSelector) Select( args *computerequest.ComputeRequestArgs) ([]string, error)
type DedicatedHostResquest ¶
type ImageInfo ¶
func FindAMI ¶
This function check all regions to get the AMI filter by its name it will return the first region where the AMI is offered
func GetAMI ¶
func GetAMI(r ImageRequest) (*ImageInfo, error)
GetAMI based on params defined by request In case multiple AMIs it will return the newest
func IsAMIOffered ¶
func IsAMIOffered(r ImageRequest) (bool, *ImageInfo, error)
IsAMIOffered checks if an ami based on its Name is offered on a specific region
type ImageRequest ¶
type InstanceResquest ¶
type LocationArgs ¶ added in v0.9.7
type LocationArgs struct {
Region, Az *string
}
type SpotInfoArgs ¶ added in v0.9.5
type SpotInfoResult ¶ added in v0.9.5
type SpotSelector ¶ added in v0.9.5
type SpotSelector struct{}
func NewSpotSelector ¶ added in v0.9.5
func NewSpotSelector() *SpotSelector
func (*SpotSelector) Select ¶ added in v0.9.5
func (c *SpotSelector) Select(mCtx *mc.Context, args *spot.SpotRequestArgs) (*spot.SpotResults, error)