awsclient

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWS_TAG_KEY string = "lakitu"
)

Variables

View Source
var AWS_REGIONS = map[string]string{
	"us-east-2":      "US East (Ohio)",
	"us-east-1":      "US East (N. Virginia)",
	"us-west-1":      "US West (N. California)",
	"us-west-2":      "US West (Oregon)",
	"af-south-1":     "Africa (Cape Town)",
	"ap-east-1":      "Asia Pacific (Hong Kong)",
	"ap-south-1":     "Asia Pacific (Mumbai)",
	"ap-northeast-3": "Asia Pacific (Osaka)",
	"ap-northeast-2": "Asia Pacific (Seoul)",
	"ap-southeast-1": "Asia Pacific (Singapore)",
	"ap-southeast-2": "Asia Pacific (Sydney)",
	"ap-northeast-1": "Asia Pacific (Tokyo)",
	"ca-central-1":   "Canada (Central)",
	"eu-central-1":   "EU (Frankfurt)",
	"eu-west-1":      "EU (Ireland)",
	"eu-west-2":      "EU (London)",
	"eu-south-1":     "EU (Milan)",
	"eu-west-3":      "EU (Paris)",
	"eu-north-1":     "EU (Stockholm)",
	"me-south-1":     "Middle East (Bahrain)",
	"sa-east-1":      "South America (Sao Paulo)",
}

Functions

This section is empty.

Types

type AWSClient

type AWSClient struct {
	Config aws.Config
}

func NewAWSClient

func NewAWSClient(key, secret, region string) AWSClient

func (*AWSClient) CopyImage

func (c *AWSClient) CopyImage(imageId string, machineUuid string, sourceRegion string, destRegion string) (string, error)

func (*AWSClient) CopySnapshot

func (c *AWSClient) CopySnapshot(snapshotId string, sourceRegion string, destRegion string) (string, error)

func (*AWSClient) CreateImage

func (c *AWSClient) CreateImage(instanceId string, region string) (string, error)

func (*AWSClient) CreateInstance

func (c *AWSClient) CreateInstance(imageId string, instanceType types.InstanceType, securityGroupId string, region string, machinePwd string, IamArn string) (string, error)

func (*AWSClient) CreateNewVolume

func (c *AWSClient) CreateNewVolume(instanceId string, size int32, region string) error

func (*AWSClient) CreateRole

func (c *AWSClient) CreateRole() (AWSRole, error)

func (*AWSClient) CreateSecurityGroup

func (c *AWSClient) CreateSecurityGroup(streamSW StreamSoftware, region string) (AWSSecurityGroup, error)

func (*AWSClient) CreateSnapshot

func (c *AWSClient) CreateSnapshot(volumeId string, region string) (string, error)

func (*AWSClient) CreateVolume

func (c *AWSClient) CreateVolume(snapshotId string, region string) (string, error)

func (*AWSClient) DeleteImage

func (c *AWSClient) DeleteImage(imageId string, region string) error

func (*AWSClient) DeleteSnapshot

func (c *AWSClient) DeleteSnapshot(snapshotId string, region string) error

func (*AWSClient) DeleteVolume

func (c *AWSClient) DeleteVolume(volumeId string, region string) (bool, error)

func (*AWSClient) GetAvailability

func (c *AWSClient) GetAvailability(regionList []string) map[string]map[string]bool

func (*AWSClient) GetGPUInstances

func (c *AWSClient) GetGPUInstances(region string) []AWSGPUInstance

func (*AWSClient) GetImageState

func (c *AWSClient) GetImageState(imageId string, region string) (types.ImageState, error)

func (*AWSClient) GetInstanceState

func (c *AWSClient) GetInstanceState(instanceId string, region string) (types.InstanceStateName, error)

func (*AWSClient) GetMachineData

func (c *AWSClient) GetMachineData(imageId string, region string) (string, string, error)

func (*AWSClient) GetPrices

func (c *AWSClient) GetPrices(region string) AWSPrices

func (*AWSClient) GetRegions

func (c *AWSClient) GetRegions() []AWSRegion

func (*AWSClient) GetRoles

func (c *AWSClient) GetRoles() ([]types.Role, error)

func (*AWSClient) GetSecurityGroups

func (c *AWSClient) GetSecurityGroups(region string) ([]types.SecurityGroup, error)

func (*AWSClient) GetSnapshotState

func (c *AWSClient) GetSnapshotState(snapshotId string, region string) (types.SnapshotState, error)

func (*AWSClient) GetSpotState

func (c *AWSClient) GetSpotState(spotRequestId string, region string) (types.SpotInstanceState, string, *string, error)

func (*AWSClient) GetVolumeModificationState

func (c *AWSClient) GetVolumeModificationState(volumeId string, region string) (types.VolumeModificationState, error)

func (*AWSClient) GetVolumeState

func (c *AWSClient) GetVolumeState(volumeId string, region string) (types.VolumeState, error)

func (*AWSClient) GetWindowsAMIId

func (c *AWSClient) GetWindowsAMIId(region string) (string, error)

func (*AWSClient) IsValidAWSCredentials

func (c *AWSClient) IsValidAWSCredentials() (bool, error)

func (*AWSClient) ModifyVolume

func (c *AWSClient) ModifyVolume(volumeId string, newSize int32, region string) (bool, error)

func (*AWSClient) ResizeSnapshot

func (c *AWSClient) ResizeSnapshot(snapshotId string, newSize int32, region string) (string, error)

Resizes snapshot, doesn't automate expanding partition Expanding partition will occur on next machine boot

func (*AWSClient) StartInstance

func (c *AWSClient) StartInstance(imageId string, snapshotId string, instanceType types.InstanceType, securityGroupId string, region string, machinePwd string, IamArn string, IamName string) (string, error)

func (*AWSClient) TerminateInstance

func (c *AWSClient) TerminateInstance(instanceId string, region string) error

type AWSGPUInstance

type AWSGPUInstance struct {
	InstanceType string  `json:"instance"`
	Price        float64 `json:"price"`
}

type AWSPrices

type AWSPrices struct {
	Bandwidth float64 `json:"bandwidth"`
	Volume    float64 `json:"volume"`
	Snapshots float64 `json:"snapshot"`
}

type AWSRegion

type AWSRegion struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type AWSRole

type AWSRole struct {
	Id       int64
	RoleId   string
	RoleName string
	Arn      string
	Created  time.Time `xorm:"created"`
}

func (*AWSRole) TableName

func (a *AWSRole) TableName() string

type AWSSecurityGroup

type AWSSecurityGroup struct {
	Id             int64
	GroupId        string
	Region         string
	StreamSoftware string
	Created        time.Time `xorm:"created"`
}

func (*AWSSecurityGroup) TableName

func (sg *AWSSecurityGroup) TableName() string

type StreamSoftware

type StreamSoftware string
const (
	PARSEC    StreamSoftware = "parsec"
	MOONLIGHT StreamSoftware = "moonlight"
)

func (StreamSoftware) String

func (s StreamSoftware) String() string

Jump to

Keyboard shortcuts

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