Documentation
¶
Index ¶
- Constants
- func GetDeployedInstances(c chan RegionSummary, region string, tags map[string]string, action string, ...)
- func GetInstanceRegion(accSum AccountSummary, id string) (string, error)
- func GetRegions() (regions []string)
- func IDs(instances []Instance) []string
- func ModifyInstanceType(region string, instanceType string, instanceID string) (err error)
- func StartStopInstance(region string, action string, instanceIDs []string) ([]types.InstanceStateChange, error)
- func TerminateInstances(region string, instances []string) (err error)
- func WriteTable(data []Instance)
- type AccountSummary
- type Instance
- type RegionSummary
Constants ¶
const ( // InstanceStart is the action to start an instance InstanceStart string = "start" // InstanceStop is the action to stop an instance InstanceStop string = "stop" // InstanceStatus is the action to query status of instance InstanceStatus string = "status" // InstanceHibernate is the action to hibernate an instance InstanceHibernate string = "hibernate" // DryRunOperation is the error code for dry run operation DryRunOperation string = "DryRunOperation" )
Variables ¶
This section is empty.
Functions ¶
func GetDeployedInstances ¶
func GetDeployedInstances(c chan RegionSummary, region string, tags map[string]string, action string, instanceIDs []string)
GetDeployedInstances retrieves the status of all deployed instances in a given region
func GetInstanceRegion ¶
func GetInstanceRegion(accSum AccountSummary, id string) (string, error)
GetInstanceRegion returns the region of an instance given an account summary
func GetRegions ¶
func GetRegions() (regions []string)
GetRegions is a function to retrieve all active regions in an account
func ModifyInstanceType ¶
ModifyInstanceType modifies an AWS Instance type
func StartStopInstance ¶
func StartStopInstance(region string, action string, instanceIDs []string) ([]types.InstanceStateChange, error)
StartStopInstance starts or stops an AWS Instance
func TerminateInstances ¶
func WriteTable ¶
func WriteTable(data []Instance)
Types ¶
type AccountSummary ¶
type AccountSummary []RegionSummary
AccountSummary is a structure holding a slice of regions summaries across an entire account
func (AccountSummary) Print ¶
func (u AccountSummary) Print()
Print prints the summary of instances in an account in tabular format
func (AccountSummary) Prompt ¶
func (u AccountSummary) Prompt(action string) AccountSummary
Prompt prompts user for confirmation
type Instance ¶
type Instance struct { Name string ID string Status types.InstanceStateName Type types.InstanceType Lifecycle string Environment string IP string SpotInstanceType types.SpotInstanceType Region string AZ string Hibernation bool }
Instance is a struct to hold instance characteristics
type RegionSummary ¶
RegionSummary is a structure holding deployed instances in a given region
func (RegionSummary) Print ¶
func (u RegionSummary) Print()
Print prints the summary of instances in a given region in tabular format