Documentation ¶
Overview ¶
Package awsinstance will help one in creating/deleting/updating/fetching instances in aws. But this is tailor made for this application if one needs customized result, he/she has to write one similar to this for them by calling the (master) interface. This package is capable of returining both custom response and raw from cloud depending on what you pass.
Index ¶
- type CommonComputeInput
- type CommonComputeResponse
- type CreateServerInput
- type DeleteServerInput
- type DescribeInstanceInput
- func (d *DescribeInstanceInput) GetAllServers(con aws.EstablishConnectionInput) ([]ServerResponse, error)
- func (d *DescribeInstanceInput) GetServersDetails(con aws.EstablishConnectionInput) ([]ServerResponse, error)
- func (d *DescribeInstanceInput) GetServersFromNetwork(con aws.EstablishConnectionInput) ([]ServerResponse, error)
- func (d *DescribeInstanceInput) GetServersFromSubnet(con aws.EstablishConnectionInput) ([]ServerResponse, error)
- type Filters
- type ServerResponse
- type UpdateServerInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonComputeInput ¶
CommonComputeInput implements methods to perform common actions against instances.
func (*CommonComputeInput) GetInstanceFromVpc ¶
func (des *CommonComputeInput) GetInstanceFromVpc(con aws.EstablishConnectionInput) (CommonComputeResponse, error)
GetInstanceFromVpc will help in fetching the information about the instance from the vpc selected.
func (*CommonComputeInput) SearchInstance ¶
func (des *CommonComputeInput) SearchInstance(con aws.EstablishConnectionInput) (bool, error)
SearchInstance will help in finding the existence of the selected instance/vm.
type CommonComputeResponse ¶
type CommonComputeResponse struct { InstanceIds []string `json:"InstanceIds,omitempty"` GetInstRaw *ec2.DescribeInstancesOutput `json:"DescribeInstRaw,omitempty"` }
CommonComputeResponse contains the filtered/unfiletred output of instances from aws.
type CreateServerInput ¶
type CreateServerInput struct { InstanceName string ImageId string InstanceType string KeyName string MaxCount int64 MinCount int64 SubnetId string SecGroupId string UserData string AssignPubIp bool GetRaw bool }
CreateServerInput will implement the methods for creating instances and holds the value for the same.
func (*CreateServerInput) CreateServer ¶
func (csrv *CreateServerInput) CreateServer(con aws.EstablishConnectionInput) ([]ServerResponse, error)
CreateServer will help in creating instances/vms with the configuration passed.
type DeleteServerInput ¶
DeleteServerInput will implement the methods to delete servers/vm and other related activities.
func (*DeleteServerInput) DeleteServer ¶
func (d *DeleteServerInput) DeleteServer(con aws.EstablishConnectionInput) ([]ServerResponse, error)
DeleteServer will delete the server who's Id was selected.
func (*DeleteServerInput) DeleteServerFromVpc ¶
func (d *DeleteServerInput) DeleteServerFromVpc(con aws.EstablishConnectionInput) ([]ServerResponse, error)
DeleteServerFromVpc deletes every single instances from the vpc selected.
type DescribeInstanceInput ¶
type DescribeInstanceInput struct { InstanceIds []string VpcIds []string SubnetIds []string Filters Filters GetRaw bool }
DescribeInstanceInput implements various methods such as GetServersFromNetwork, GetServersFromSubnet, GetAllServers and GetServersDetails.
func (*DescribeInstanceInput) GetAllServers ¶
func (d *DescribeInstanceInput) GetAllServers(con aws.EstablishConnectionInput) ([]ServerResponse, error)
GetAllServers will fetch information of all the servers from a particular region.
func (*DescribeInstanceInput) GetServersDetails ¶
func (d *DescribeInstanceInput) GetServersDetails(con aws.EstablishConnectionInput) ([]ServerResponse, error)
GetServersDetails will fetch the details of the random servers selected.
func (*DescribeInstanceInput) GetServersFromNetwork ¶
func (d *DescribeInstanceInput) GetServersFromNetwork(con aws.EstablishConnectionInput) ([]ServerResponse, error)
GetServersFromNetwork is tailored to fectch the servers from network, to fetch the data one has to pass either subnet-id else vpc-id to filters to make the life easy.
func (*DescribeInstanceInput) GetServersFromSubnet ¶
func (d *DescribeInstanceInput) GetServersFromSubnet(con aws.EstablishConnectionInput) ([]ServerResponse, error)
GetServersFromSubnet will help in fetching the details of the server from the particular subnetwork paseed/selected.
type ServerResponse ¶
type ServerResponse struct { InstanceName string `json:"InstanceName,omitempty"` InstanceId string `json:"InstanceId,omitempty"` SubnetId string `json:"SubnetId,omitempty"` PrivateIpAddress string `json:"IpAddress,omitempty"` PublicIpAddress string `json:"PublicIpAddress,omitempty"` PrivateDnsName string `json:"PrivateDnsName,omitempty"` CreatedOn string `json:"CreatedOn,omitempty"` State string `json:"State,omitempty"` InstanceDeleteState string `json:"InstanceDeleteState,omitempty"` InstanceType string `json:"InstanceType,omitempty"` Cloud string `json:"Cloud,omitempty"` Region string `json:"Region,omitempty"` PreviousState string `json:"PreviousState,omitempty"` CurrentState string `json:"CurrentState,omitempty"` DefaultResponse interface{} `json:"DefaultResponse,omitempty"` Error error `json:"Error,omitempty"` CreateInstRaw *ec2.DescribeInstancesOutput `json:"CreateInstRaw,omitempty"` GetInstRaw *ec2.DescribeInstancesOutput `json:"DescribeInstRaw,omitempty"` DeleteInstRaw *ec2.TerminateInstancesOutput `json:"DeleteInstRaw,omitempty"` StartInstRaw *ec2.StartInstancesOutput `json:"StartInstRaw,omitempty"` StopInstRaw *ec2.StopInstancesOutput `json:"StopInstRaw,omitempty"` CreateImgRaw *ec2.CreateImageOutput `json:"CreateImgRaw,omitempty"` DescribeImg *ec2.DescribeImagesOutput `json:"DescribeImg,omitempty"` }
ServerResponse holds the filtered/unfiltered output of CreateServer from aws.
type UpdateServerInput ¶
type UpdateServerInput struct { InstanceIds []string `json:"InstanceIds,omitempty"` Action string GetRaw bool }
UpdateServerInput implements UpdateServer and other related activities, it holds all necessary details to update server.
func (*UpdateServerInput) UpdateServer ¶
func (u *UpdateServerInput) UpdateServer(con aws.EstablishConnectionInput) ([]ServerResponse, error)
UpdateServer updates the server (start/stop and other operations).