Documentation ¶
Index ¶
- func AttachVolume(c context.Context, api EC2CreateVolumeAPI, input *ec2.AttachVolumeInput) (*ec2.AttachVolumeOutput, error)
- func CreateTags(c context.Context, api EC2DescribeInstancesAPI, input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
- func DelKeyPair(c context.Context, api EC2StopInstancesAPI, input *ec2.DeleteKeyPairInput) (*ec2.DeleteKeyPairOutput, error)
- func DeleteVolume(c context.Context, api EC2DeleteVolumeAPI, input *ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error)
- func DetachVolume(c context.Context, api EC2DeleteVolumeAPI, input *ec2.DetachVolumeInput) (*ec2.DetachVolumeOutput, error)
- func GetImages(c context.Context, api EC2DescribeAMIAPI, input *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error)
- func GetInstanceStatus(c context.Context, api EC2DescribeInstancesAPI, ...) (*ec2.DescribeInstanceStatusOutput, error)
- func GetInstanceType(hosts *v1.Hosts) types.InstanceType
- func GetInstances(c context.Context, api EC2DescribeInstancesAPI, ...) (*ec2.DescribeInstancesOutput, error)
- func GetVolume(c context.Context, api EC2DescribeVolumesAPI, input *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error)
- func GetVolumes(c context.Context, api EC2DescribeVolumesAPI, input *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error)
- func MakeInstance(c context.Context, api EC2CreateInstanceAPI, input *ec2.RunInstancesInput) (*ec2.RunInstancesOutput, error)
- func MakeKeyPair(c context.Context, api EC2CreateInstanceAPI, input *ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error)
- func MakeTags(c context.Context, api EC2CreateInstanceAPI, input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
- func MakeVolume(c context.Context, api EC2CreateVolumeAPI, input *ec2.CreateVolumeInput) (*ec2.CreateVolumeOutput, error)
- func ModifyInstances(c context.Context, api EC2ModifyInstancesAPI, ...) (*ec2.ModifyInstanceAttributeOutput, error)
- func ModifyVolume(c context.Context, api EC2ModifyVolumeAPI, input *ec2.ModifyVolumeInput) (*ec2.ModifyVolumeOutput, error)
- func StartInstances(c context.Context, api EC2ModifyInstancesAPI, input *ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error)
- func StopInstance(c context.Context, api EC2StopInstancesAPI, input *ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error)
- type Driver
- func (d Driver) CreateInstances(hosts *v1.Hosts, infra *v1.Infra) error
- func (d Driver) CreateKeyPair(infra *v1.Infra) error
- func (d Driver) CreateVolumes(infra *v1.Infra, host *v1.Hosts, disks []v1.Disk) error
- func (d Driver) DeleteInfra(infra *v1.Infra) error
- func (d Driver) DeleteInstanceByID(_ string, _ *v1.Infra) error
- func (d Driver) DeleteInstances(hosts *v1.Hosts) error
- func (d Driver) DeleteKeyPair(infra *v1.Infra) error
- func (d Driver) DeleteVolume(disksID []string) error
- func (d Driver) GetBlockDeviceMappings(hosts *v1.Hosts, rootDeviceName string, infra *v1.Infra) []types.BlockDeviceMapping
- func (d Driver) GetInstances(infra *v1.Infra, status string) ([]v1.Hosts, error)
- func (d Driver) GetInstancesByLabel(key string, value string, infra *v1.Infra) (*v1.Hosts, error)
- func (d Driver) GetTags(hosts *v1.Hosts, infra *v1.Infra) []types.Tag
- func (d Driver) GetVolumeTags(hosts *v1.Hosts, infra *v1.Infra) []types.Tag
- func (d Driver) ModifyInstances(curHosts *v1.Hosts, desHosts *v1.Hosts) error
- func (d Driver) ModifyVolume(curDisk *v1.Disk, desDisk *v1.Disk) error
- func (d Driver) StopInstances(hosts *v1.Hosts) error
- func (d Driver) WaitInstanceRunning(instances []types.Instance) error
- type EC2CreateInstanceAPI
- type EC2CreateVolumeAPI
- type EC2DeleteVolumeAPI
- type EC2DescribeAMIAPI
- type EC2DescribeInstancesAPI
- type EC2DescribeVolumesAPI
- type EC2ModifyInstancesAPI
- type EC2ModifyVolumeAPI
- type EC2StopInstancesAPI
- type GarbageCollector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachVolume ¶
func AttachVolume(c context.Context, api EC2CreateVolumeAPI, input *ec2.AttachVolumeInput) (*ec2.AttachVolumeOutput, error)
func CreateTags ¶
func CreateTags(c context.Context, api EC2DescribeInstancesAPI, input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
func DelKeyPair ¶
func DelKeyPair(c context.Context, api EC2StopInstancesAPI, input *ec2.DeleteKeyPairInput) (*ec2.DeleteKeyPairOutput, error)
func DeleteVolume ¶
func DeleteVolume(c context.Context, api EC2DeleteVolumeAPI, input *ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error)
func DetachVolume ¶
func DetachVolume(c context.Context, api EC2DeleteVolumeAPI, input *ec2.DetachVolumeInput) (*ec2.DetachVolumeOutput, error)
func GetImages ¶
func GetImages(c context.Context, api EC2DescribeAMIAPI, input *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error)
GetImages retrieves information about your Amazon Elastic Compute Cloud (Amazon EC2) images. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a DescribeImagesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to DescribeImages.
func GetInstanceStatus ¶
func GetInstanceStatus(c context.Context, api EC2DescribeInstancesAPI, input *ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error)
GetInstanceStatus retrieves information about your Amazon Elastic Compute Cloud (Amazon EC2) instances. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a DescribeInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to DescribeInstances.
func GetInstanceType ¶
func GetInstanceType(hosts *v1.Hosts) types.InstanceType
func GetInstances ¶
func GetInstances(c context.Context, api EC2DescribeInstancesAPI, input *ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
GetInstances retrieves information about your Amazon Elastic Compute Cloud (Amazon EC2) instances. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a DescribeInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to DescribeInstances.
func GetVolume ¶
func GetVolume(c context.Context, api EC2DescribeVolumesAPI, input *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error)
func GetVolumes ¶
func GetVolumes(c context.Context, api EC2DescribeVolumesAPI, input *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error)
GetVolumes retrieves volumes information about your Amazon Elastic Compute Cloud (Amazon EC2) instances. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a DescribeInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to DescribeInstances.
func MakeInstance ¶
func MakeInstance(c context.Context, api EC2CreateInstanceAPI, input *ec2.RunInstancesInput) (*ec2.RunInstancesOutput, error)
MakeInstance creates an Amazon Elastic Compute Cloud (Amazon EC2) instance. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a RunInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to RunInstances.
func MakeKeyPair ¶
func MakeKeyPair(c context.Context, api EC2CreateInstanceAPI, input *ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error)
func MakeTags ¶
func MakeTags(c context.Context, api EC2CreateInstanceAPI, input *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
MakeTags creates tags for an Amazon Elastic Compute Cloud (Amazon EC2) instance. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a CreateTagsOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to CreateTags.
func MakeVolume ¶
func MakeVolume(c context.Context, api EC2CreateVolumeAPI, input *ec2.CreateVolumeInput) (*ec2.CreateVolumeOutput, error)
func ModifyInstances ¶
func ModifyInstances(c context.Context, api EC2ModifyInstancesAPI, input *ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error)
func ModifyVolume ¶
func ModifyVolume(c context.Context, api EC2ModifyVolumeAPI, input *ec2.ModifyVolumeInput) (*ec2.ModifyVolumeOutput, error)
func StartInstances ¶
func StartInstances(c context.Context, api EC2ModifyInstancesAPI, input *ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error)
func StopInstance ¶
func StopInstance(c context.Context, api EC2StopInstancesAPI, input *ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error)
StopInstance stops an Amazon Elastic Compute Cloud (Amazon EC2) instance. Inputs:
c is the context of the method call, which includes the AWS Region. api is the interface that defines the method call. input defines the input arguments to the service call.
Output:
If success, a StopInstancesOutput object containing the result of the service call and nil. Otherwise, nil and an error from the call to StopInstances.
Types ¶
type Driver ¶
func (Driver) CreateInstances ¶
func (Driver) CreateVolumes ¶
func (Driver) DeleteVolume ¶
func (Driver) GetBlockDeviceMappings ¶
func (d Driver) GetBlockDeviceMappings(hosts *v1.Hosts, rootDeviceName string, infra *v1.Infra) []types.BlockDeviceMapping
GetBlockDeviceMappings generate blockDeviceMappings from hosts
func (Driver) GetInstances ¶
func (Driver) GetInstancesByLabel ¶
func (Driver) GetVolumeTags ¶
GetVolumeTags get tags
func (Driver) ModifyInstances ¶
type EC2CreateInstanceAPI ¶
type EC2CreateInstanceAPI interface { RunInstances(ctx context.Context, params *ec2.RunInstancesInput, optFns ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error) CreateTags(ctx context.Context, params *ec2.CreateTagsInput, optFns ...func(*ec2.Options)) (*ec2.CreateTagsOutput, error) CreateKeyPair(ctx context.Context, params *ec2.CreateKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.CreateKeyPairOutput, error) }
EC2CreateInstanceAPI defines the interface for the RunInstances and CreateTags functions. We use this interface to test the functions using a mocked service.
type EC2CreateVolumeAPI ¶
type EC2CreateVolumeAPI interface { CreateVolume(ctx context.Context, params *ec2.CreateVolumeInput, optFns ...func(*ec2.Options)) (*ec2.CreateVolumeOutput, error) AttachVolume(ctx context.Context, params *ec2.AttachVolumeInput, optFns ...func(*ec2.Options)) (*ec2.AttachVolumeOutput, error) }
type EC2DeleteVolumeAPI ¶
type EC2DeleteVolumeAPI interface { DeleteVolume(ctx context.Context, params *ec2.DeleteVolumeInput, optFns ...func(*ec2.Options)) (*ec2.DeleteVolumeOutput, error) DetachVolume(ctx context.Context, params *ec2.DetachVolumeInput, optFns ...func(*ec2.Options)) (*ec2.DetachVolumeOutput, error) }
type EC2DescribeAMIAPI ¶
type EC2DescribeAMIAPI interface { DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) }
EC2DescribeAMIAPI defines the interface for the DescribeInstances function. We use this interface to test the function using a mocked service.
type EC2DescribeInstancesAPI ¶
type EC2DescribeInstancesAPI interface { DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error) DescribeInstanceStatus(ctx context.Context, params *ec2.DescribeInstanceStatusInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceStatusOutput, error) CreateTags(ctx context.Context, params *ec2.CreateTagsInput, optFns ...func(*ec2.Options)) (*ec2.CreateTagsOutput, error) }
EC2DescribeInstancesAPI defines the interface for the DescribeInstances function. We use this interface to test the function using a mocked service.
type EC2DescribeVolumesAPI ¶
type EC2DescribeVolumesAPI interface { DescribeVolumes(ctx context.Context, params *ec2.DescribeVolumesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVolumesOutput, error) }
EC2DescribeVolumesAPI defines the interface for the DescribeVolumes function. We use this interface to test the function using a mocked service.
type EC2ModifyInstancesAPI ¶
type EC2ModifyInstancesAPI interface { ModifyInstanceAttribute(ctx context.Context, params *ec2.ModifyInstanceAttributeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyInstanceAttributeOutput, error) StartInstances(ctx context.Context, params *ec2.StartInstancesInput, optFns ...func(*ec2.Options)) (*ec2.StartInstancesOutput, error) }
type EC2ModifyVolumeAPI ¶
type EC2ModifyVolumeAPI interface { ModifyVolume(ctx context.Context, params *ec2.ModifyVolumeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyVolumeOutput, error) }
type EC2StopInstancesAPI ¶
type EC2StopInstancesAPI interface { StopInstances(ctx context.Context, params *ec2.StopInstancesInput, optFns ...func(*ec2.Options)) (*ec2.StopInstancesOutput, error) DeleteKeyPair(ctx context.Context, params *ec2.DeleteKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.DeleteKeyPairOutput, error) DescribeVolumes(ctx context.Context, params *ec2.DescribeVolumesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVolumesOutput, error) }
EC2StopInstancesAPI defines the interface for the StopInstances function. We use this interface to test the function using a mocked service.
type GarbageCollector ¶
type GarbageCollector struct {
// contains filtered or unexported fields
}
func NewGarbageCollector ¶
func NewGarbageCollector() (*GarbageCollector, error)
func (*GarbageCollector) InstanceGC ¶
func (g *GarbageCollector) InstanceGC() error
func (*GarbageCollector) KeyPairGC ¶
func (g *GarbageCollector) KeyPairGC() error
list and delete users' key pair