neuronaws

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsCommonInput

type AwsCommonInput struct {
	AvailabilityZone string `json:"AvailabilityZone,omitempty"`
}

AwsCommonInput holds the common input values to perform the operations.

type CreateNetworkInput

type CreateNetworkInput struct {
	Cidr            string
	Tenancy         string
	VpcId           string
	SubId           string
	IgwId           string
	Zone            string
	Name            string
	DestinationCidr string
	RouteTableId    string
}

CreateNetworkInput implements the methods for creating the network. This also holds the values for the same.

type CreateServerInput

type CreateServerInput struct {
	ImageId        string
	InstanceType   string
	KeyName        string
	MaxCount       int64
	MinCount       int64
	SubnetId       string
	SecurityGroups []string
	UserData       string
	AssignPubIp    bool
}

CreateServerInput holds all required values to create a server/instance in aws.

type CreateTagsInput

type CreateTagsInput struct {
	Resource string
	Name     string
	Value    string
}

CreateTagsInput holds the input values which helps in creating tags for the resource created in aws.

type DeleteComputeInput

type DeleteComputeInput struct {
	ImageId     string
	SnapshotId  string
	InstanceIds []string
}

DeleteComputeInput holds the required details for deleting compute resource.

type DeleteLoadbalancerInput

type DeleteLoadbalancerInput struct {
	LbName      string
	LbArn       string
	TargetArn   string
	ListenerArn string
}

DeleteLoadbalancerInput implements various methods to delete various types of load balancers.

type DescribeComputeInput

type DescribeComputeInput struct {
	InstanceIds []string
	ImageIds    []string
	Filters     Filters
}

DescribeComputeInput holds all the required values to describe the instance/vm or any compute resources in aws.

type DescribeLoadbalancersInput

type DescribeLoadbalancersInput struct {
	LbNames     []string
	LbArns      []string
	TargetArns  []string
	ListnerArns []string
}

DescribeLoadbalancersInput implements various methods to fetch details of various types of load balancers.

type DescribeNetworkInput

type DescribeNetworkInput struct {
	SecIds         []string
	IgwIds         []string
	VpcIds         []string
	SubnetIds      []string
	RouteTableIds  []string
	Filters        Filters
	AssociationsId string
}

DescribeNetworkInput holds all the required values for fetching the information about the selected network and its components. This is achieved by describing the same.

type EstablishConnectionInput

type EstablishConnectionInput struct {
	// The default region required to establish the session.
	Region string

	// The name of the resource of who's the connection has to be established.
	Resource string

	// This holds the actualsession from aws, which means actual session has tpo be created even before we call this method.
	// And the same can be done with the help of "github.com/nikhilsbhat/neuron-cloudy/cloud/aws/sessions"
	Session *session.Session
}

EstablishConnectionInput implements EstablishConnection which establishes the session for specific resource in aws.

func (*EstablishConnectionInput) EstablishConnection

func (con *EstablishConnectionInput) EstablishConnection() (EstablishedSession, error)

EstablishConnection helps in establishing connection to specific resource in aws.

type EstablishedSession

type EstablishedSession struct {
	//This will hold the session for all ec2 resource
	Ec2 *ec2.EC2 `json:"Ec2,omitempty"`
	//This will hold the session for all elb(loadbalancer) resource
	Elb *elb.ELB `json:"Elb,omitempty"`
	//This will hold the session for all elb2(loadbalancer version2) resource
	Elb2 *elbv2.ELBV2 `json:"Elb2,omitempty"`
}

EstablishedSession holds the session establihed to create appropriate resource in cloud aws

func (*EstablishedSession) AttachIgw

func (sess *EstablishedSession) AttachIgw(a *DescribeNetworkInput) error

AttachIgw will attach the internetgateway to the specified network. never pass arrays to attach the intergateways, it never works

func (*EstablishedSession) AttachRouteTable

func (sess *EstablishedSession) AttachRouteTable(r *CreateNetworkInput) error

AttachRouteTable attaches the route table to the specified subnetwork.

func (*EstablishedSession) CreateApplicationLb

CreateApplicationLb helps in creating loadbalancer of type application

func (*EstablishedSession) CreateApplicationListners

func (sess *EstablishedSession) CreateApplicationListners(lb *LoadBalanceCreateInput) (*elbv2.CreateListenerOutput, error)

CreateApplicationListners helps in creating listeners for the loadbalancers.

func (*EstablishedSession) CreateClassicLb

CreateClassicLb helps in creating load balancer of type classic

func (*EstablishedSession) CreateEgressRule

func (sess *EstablishedSession) CreateEgressRule(i *IngressEgressInput) error

CreateEgressRule creats the egress rule with the specified configuration.

func (*EstablishedSession) CreateIgw

CreateIgw will create the internetgateway so that the compute components can talk to outside world and vise versa when attached to the network where the components is present.

func (*EstablishedSession) CreateImage

func (sess *EstablishedSession) CreateImage(img *ImageCreateInput) (*ec2.CreateImageOutput, error)

CreateImage is responsible for capturing the image of the server who's Id is passed to it.

func (*EstablishedSession) CreateIngressRule

func (sess *EstablishedSession) CreateIngressRule(i *IngressEgressInput) error

CreateIngressRule creates the ingress rule with the specified configurations.

func (*EstablishedSession) CreateInstance

func (sess *EstablishedSession) CreateInstance(ins *CreateServerInput) (*ec2.Reservation, error)

CreateInstance will create instance/vm as per the configuration specified.

func (*EstablishedSession) CreateRouteTable

func (sess *EstablishedSession) CreateRouteTable(r *CreateNetworkInput) (*ec2.CreateRouteTableOutput, error)

CreateRouteTable creats the routetable, which is one of the network component.

func (*EstablishedSession) CreateSecurityGroup

func (sess *EstablishedSession) CreateSecurityGroup(s *CreateNetworkInput) (*ec2.CreateSecurityGroupOutput, error)

CreateSecurityGroup creates and configure the security group with all the parameter passed to it.

func (*EstablishedSession) CreateSubnet

CreateSubnet will create the subnetwork in aws based on the values and session passed to it.

func (*EstablishedSession) CreateTags

func (sess *EstablishedSession) CreateTags(t *CreateTagsInput) error

CreateTags creates tag for the resources created. It works only with the help of resource Id, make sure you pass right reource Id.

func (*EstablishedSession) CreateTargetGroups

CreateTargetGroups helps in creating target group, the group which will be attached to the loadbalancer that will be created. These target groups consists of VM's which actually take the load.

func (*EstablishedSession) CreateVpc

CreateVpc will create the network/VPC in aws based on the values and session passed to it.

func (*EstablishedSession) DeleteAppListeners

func (sess *EstablishedSession) DeleteAppListeners(lb *DeleteLoadbalancerInput) error

DeleteAppListeners helps in deleting the selected application listeners of the loadbalancers.

func (*EstablishedSession) DeleteAppLoadbalancer

func (sess *EstablishedSession) DeleteAppLoadbalancer(lb *DeleteLoadbalancerInput) error

DeleteAppLoadbalancer will delete the selected loadbalancer of type application in cloud aws.

func (*EstablishedSession) DeleteClassicLoadbalancer

func (sess *EstablishedSession) DeleteClassicLoadbalancer(lb *DeleteLoadbalancerInput) error

DeleteClassicLoadbalancer will delete the selected loadbalancer of type classic in cloud aws.

func (*EstablishedSession) DeleteIgw

func (sess *EstablishedSession) DeleteIgw(i *DescribeNetworkInput) error

DeleteIgw deletes the specified internetgateway selected.

func (*EstablishedSession) DeleteInstance

DeleteInstance will delete the instance who's Id is specified.

func (*EstablishedSession) DeleteRouteTable

func (sess *EstablishedSession) DeleteRouteTable(r *DescribeNetworkInput) error

DeleteRouteTable deletes the specified route table.

func (*EstablishedSession) DeleteSecurityGroup

func (sess *EstablishedSession) DeleteSecurityGroup(s *DescribeNetworkInput) error

DeleteSecurityGroup deletes the specified security group.

func (*EstablishedSession) DeleteSnapshot

func (sess *EstablishedSession) DeleteSnapshot(img *DeleteComputeInput) error

DeleteSnapshot helps in deleting the snapshot, but this is more effective while deleting image from aws.

func (*EstablishedSession) DeleteSubnet

func (sess *EstablishedSession) DeleteSubnet(d *DescribeNetworkInput) error

DeleteSubnet helps in deletion of the selected subnetwork.

func (*EstablishedSession) DeleteTargetGroup

func (sess *EstablishedSession) DeleteTargetGroup(lb *DeleteLoadbalancerInput) error

DeleteTargetGroup deletes the selected target group in the cloud aws.

func (*EstablishedSession) DeleteVpc

func (sess *EstablishedSession) DeleteVpc(d *DescribeNetworkInput) error

DeleteVpc deletes the specified network in clopud aws.

func (*EstablishedSession) DeregisterImage

func (sess *EstablishedSession) DeregisterImage(img *DeleteComputeInput) error

DeregisterImage along with DeleteSnapshot has to be used to delete an image.

func (*EstablishedSession) DescribeAllApplicationLoadbalancer

func (sess *EstablishedSession) DescribeAllApplicationLoadbalancer(lb *DescribeLoadbalancersInput) (*elbv2.DescribeLoadBalancersOutput, error)

DescribeAllApplicationLoadbalancer describes the details of all the application loadbalancers in the selected region.

func (*EstablishedSession) DescribeAllAvailabilityZones

func (sess *EstablishedSession) DescribeAllAvailabilityZones(a *AwsCommonInput) (*ec2.DescribeAvailabilityZonesOutput, error)

DescribeAllAvailabilityZones describes all the availability zones present in the aws.

func (*EstablishedSession) DescribeAllClassicLoadbalancer

func (sess *EstablishedSession) DescribeAllClassicLoadbalancer(lb *DescribeLoadbalancersInput) (*elb.DescribeLoadBalancersOutput, error)

DescribeAllClassicLoadbalancer describes the details of all the classic loadbalancers in the selected region.

func (*EstablishedSession) DescribeAllIgw

DescribeAllIgw describes all the internetgateway in the specified region of the cloud.

func (*EstablishedSession) DescribeAllImages

func (sess *EstablishedSession) DescribeAllImages(img *DescribeComputeInput) (*ec2.DescribeImagesOutput, error)

DescribeAllImages helps in describing all the images present in region, account or any depending on the filter you apply.

func (*EstablishedSession) DescribeAllInstances

func (sess *EstablishedSession) DescribeAllInstances(des *DescribeComputeInput) (*ec2.DescribeInstancesOutput, error)

DescribeAllInstances will describe all the av available instance in the specified region in aws.

func (*EstablishedSession) DescribeAllListners

DescribeAllListners helps in describing all the listeners in the selscted region in aws.

func (*EstablishedSession) DescribeAllSecurityGroup

func (sess *EstablishedSession) DescribeAllSecurityGroup(d *DescribeNetworkInput) (*ec2.DescribeSecurityGroupsOutput, error)

DescribeAllSecurityGroup fetches the information about all the security group present in the specified region.

func (*EstablishedSession) DescribeAllSubnet

func (sess *EstablishedSession) DescribeAllSubnet(d *DescribeNetworkInput) (*ec2.DescribeSubnetsOutput, error)

DescribeAllSubnet fetches the information about all the subnetnetworks present in the specified region.

func (*EstablishedSession) DescribeAllTargetgroups

DescribeAllTargetgroups describes all the target group present in the selected region.

func (*EstablishedSession) DescribeAllVpc

DescribeAllVpc fetches the required information of all network present in the selected region. This is achieved by describing it.

func (*EstablishedSession) DescribeApplicationLoadbalancer

func (sess *EstablishedSession) DescribeApplicationLoadbalancer(lb *DescribeLoadbalancersInput) (*elbv2.DescribeLoadBalancersOutput, error)

DescribeApplicationLoadbalancer describes the details of the selected application loadbalancers.

func (*EstablishedSession) DescribeAvailabilityZones

func (sess *EstablishedSession) DescribeAvailabilityZones(a *AwsCommonInput) (*ec2.DescribeAvailabilityZonesOutput, error)

DescribeAvailabilityZones describes the particular availability zoa=ne selected.

func (*EstablishedSession) DescribeClassicLoadbalancer

func (sess *EstablishedSession) DescribeClassicLoadbalancer(lb *DescribeLoadbalancersInput) (*elb.DescribeLoadBalancersOutput, error)

DescribeClassicLoadbalancer describes the details of the selected classic loadbalancers.

func (*EstablishedSession) DescribeIgw

DescribeIgw fetches the information about the intertnetgateway selected. This is achieved by describing the same.

func (*EstablishedSession) DescribeImages

func (sess *EstablishedSession) DescribeImages(img *DescribeComputeInput) (*ec2.DescribeImagesOutput, error)

DescribeImages helps in fetching information about the images who's Id is passed. This is achieved by describing it.

func (*EstablishedSession) DescribeInstance

func (sess *EstablishedSession) DescribeInstance(des *DescribeComputeInput) (*ec2.DescribeInstancesOutput, error)

DescribeInstance will help in fetching the information about the instance selected, by describing it.

func (*EstablishedSession) DescribeListners

DescribeListners helps in describing the selected listeners.

func (*EstablishedSession) DescribeRouteTable

DescribeRouteTable fetches the information about the selected route table by describing it.

func (*EstablishedSession) DescribeSecurityGroup

DescribeSecurityGroup fetches the information about the selected security group. This is achieved by describing it.

func (*EstablishedSession) DescribeSubnet

DescribeSubnet fetches the information about the selected subnetwork. This is achieved by describing it.

func (*EstablishedSession) DescribeTargetgroups

DescribeTargetgroups describes the target group of the loadbalancers.

func (*EstablishedSession) DescribeVpc

DescribeVpc fetch the information about the specified network.

func (*EstablishedSession) DetachIgw

func (sess *EstablishedSession) DetachIgw(i *DescribeNetworkInput) error

DetachIgw helps in dettaching the internetgateway from the attached network. never pass arrays to dettach the intergateways, it never works

func (*EstablishedSession) DettachRouteTable

func (sess *EstablishedSession) DettachRouteTable(r *DescribeNetworkInput) error

DettachRouteTable dettaches the route table from the subnetwork it is attached to.

func (*EstablishedSession) GetRegions

func (sess *EstablishedSession) GetRegions() (*ec2.DescribeRegionsOutput, error)

GetRegions describes the regions available in the cloud aws.

func (*EstablishedSession) StartInstances

StartInstances helps in stating the stopped instances in aws.

func (*EstablishedSession) StopInstances

StopInstances will help in stopping the currently runnig instance.

func (*EstablishedSession) WaitTillInstanceAvailable

func (sess *EstablishedSession) WaitTillInstanceAvailable(d *DescribeComputeInput) error

WaitTillInstanceAvailable makes the called method to wait till the created instance becomes available.

func (*EstablishedSession) WaitTillInstanceRunning

func (sess *EstablishedSession) WaitTillInstanceRunning(d *DescribeComputeInput) error

WaitTillInstanceRunning makes the called method to wait till the created/started instance enters to runnig state.

func (*EstablishedSession) WaitTillInstanceStopped

func (sess *EstablishedSession) WaitTillInstanceStopped(d *DescribeComputeInput) error

WaitTillInstanceStopped makes the called method to wait till the specified instance enters the stop state.

func (*EstablishedSession) WaitTillInstanceTerminated

func (sess *EstablishedSession) WaitTillInstanceTerminated(d *DescribeComputeInput) error

WaitTillInstanceTerminated makes the called method to wait till the specified instance is terminated successfully.

func (*EstablishedSession) WaitTillLbDeletionSuccessfull

func (sess *EstablishedSession) WaitTillLbDeletionSuccessfull(lb *DescribeLoadbalancersInput) error

WaitTillLbDeletionSuccessfull will make the method who called this to wait till the deletion of loadbalancer is successful.

func (*EstablishedSession) WaitTillSubnetAvailable

func (sess *EstablishedSession) WaitTillSubnetAvailable(d *DescribeNetworkInput) error

WaitTillSubnetAvailable makes the method called this to wait till the subnet state becomes available.

func (*EstablishedSession) WaitTillVpcAvailable

func (sess *EstablishedSession) WaitTillVpcAvailable(d *DescribeNetworkInput) error

WaitTillVpcAvailable makes the method called this to wait until the network becomes available.

func (*EstablishedSession) WaitUntilIgwDeleted

func (sess *EstablishedSession) WaitUntilIgwDeleted(d *DescribeNetworkInput) (bool, error)

WaitUntilIgwDeleted makes the method called this to wait until internetgateway deletion is successful.

func (*EstablishedSession) WaitUntilRoutTableDeleted

func (sess *EstablishedSession) WaitUntilRoutTableDeleted(d *DescribeNetworkInput) (bool, error)

WaitUntilRoutTableDeleted makes the method called this to wait till the route table is successfully deleted.

func (*EstablishedSession) WaitUntilSubnetDeleted

func (sess *EstablishedSession) WaitUntilSubnetDeleted(d *DescribeNetworkInput) (bool, error)

WaitUntilSubnetDeleted makes the method called this to wait till the subnet is successfully deleted.

func (*EstablishedSession) WriteRoute

func (sess *EstablishedSession) WriteRoute(r *CreateNetworkInput) error

WriteRoute will write routes into the specified route table.

type Filters

type Filters struct {
	Name  string
	Value []string
}

Filters holds the required values for creating filter, so that this can be applied on resource to get the appropriate result.

type ImageCreateInput

type ImageCreateInput struct {
	Description string
	ServerName  string
	InstanceId  string
}

ImageCreateInput holds the details for creation of imagfe in aws.

type IngressEgressInput

type IngressEgressInput struct {
	Port  int64
	SecId string
}

IngressEgressInput holds the required values for creating ingress/egress rule for the specified security group and implements the methods for the same.

type LoadBalanceCreateInput

type LoadBalanceCreateInput struct {
	Name              string
	VpcId             string
	Subnets           []string
	AvailabilityZones []string
	SecurityGroups    []string
	Scheme            string
	Type              string
	SslCert           string
	SslPolicy         string
	LbPort            int64
	InstPort          int64
	Lbproto           string
	Instproto         string
	HttpCode          string
	HealthPath        string
	IpAddressType     string
	TargetArn         string
	LbArn             string
}

LoadBalanceCreateInput implements various methods to create variours types of loadbalancers in aws. It holds all the required values for the same.

type LoadBalanceResponse

type LoadBalanceResponse struct {
	Name            string                `json:"name,omitempty"`
	Type            string                `json:"type,omitempty"`
	LbDns           string                `json:"lbdns,omitempty"`
	LbArn           string                `json:"lbarn,omitempty"`
	TargetArn       string                `json:"targetarn,omitempty"`
	ListnerArn      string                `json:"listnerarn,omitempty"`
	Createdon       string                `json:"createdon,omitempty"`
	VpcId           string                `json:"vpcid,omitempty"`
	Scheme          string                `json:"scheme,omitempty"`
	DefaultResponse interface{}           `json:"defaultresponse,omitempty"`
	LbDeleteStatus  string                `json:"lbdeletestatus,omitempty"`
	ApplicationLb   []LoadBalanceResponse `json:"applicationlb,omitempty"`
	ClassicLb       []LoadBalanceResponse `json:"classiclb,omitempty"`
}

LoadBalanceResponse returns the filtered/unfiltered results obtained from aws.

type UpdateComputeInput

type UpdateComputeInput struct {
	InstanceIds []string
	Force       string
}

UpdateComputeInput holds all the required values to update the compute resources in aws.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL