aws

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	ClockSpeed                  string `json:"clockSpeed,omitempty"`
	CurrentGeneration           string `json:"currentGeneration,omitempty"`
	DedicatedEbsThroughput      string `json:"dedicatedEbsThroughput,omitempty"`
	Ecu                         string `json:"ecu,omitempty"`
	EnhancedNetworkingSupported string `json:"enhancedNetworkingSupported,omitempty"`
	InstanceFamily              string `json:"instanceFamily,omitempty"`
	InstanceType                string `json:"instanceType,omitempty"`
	LicenseModel                string `json:"licenseModel,omitempty"`
	Location                    string `json:"location,omitempty"`
	LocationType                string `json:"locationType,omitempty"`
	Memory                      string `json:"memory,omitempty"`
	MetworkPerformance          string `json:"metworkPerformance,omitempty"`
	NormalizationSizeFactor     string `json:"normalizationSizeFactor,omitempty"`
	OperatingSystem             string `json:"operatingSystem,omitempty"`
	Operation                   string `json:"operation,omitempty"`
	PhysicalProcessor           string `json:"physicalProcessor,omitempty"`
	PreInstalledSw              string `json:"preInstalled_sw,omitempty"`
	ProcessorArchitecture       string `json:"processorArchitecture,omitempty"`
	ProcessorFeatures           string `json:"processorFeatures,omitempty"`
	Servicecode                 string `json:"servicecode,omitempty"`
	Servicename                 string `json:"servicename,omitempty"`
	Storage                     string `json:"storage,omitempty"`
	Tenancy                     string `json:"tenancy,omitempty"`
	Usagetype                   string `json:"usagetype,omitempty"`
	Vcpu                        string `json:"vcpu,omitempty"`
}

Attributes attributes of a compute instance

type AuthOpts

type AuthOpts struct {
	// AWS Access key ID
	AccessKeyID string

	// AWS Secret Access Key
	SecretAccessKey string
	// The region to send requests to. This parameter is required and must
	// be configured globally or on a per-client basis unless otherwise
	// noted. A full list of regions is found in the "Regions and Endpoints"
	// document.
	//
	// @see http://docs.aws.amazon.com/general/latest/gr/rande.html
	//   AWS Regions and Endpoints
	Region string
}

AuthOpts AWS credentials

func (AuthOpts) IsExpired

func (o AuthOpts) IsExpired() bool

IsExpired returns if the credentials are no longer valid, and need to be retrieved.

func (AuthOpts) Retrieve

func (o AuthOpts) Retrieve() (credentials.Value, error)

Retrieve returns nil if it successfully retrieved the value. Error is returned if the value were not obtainable, or empty.

type Card

type Card struct {
	EffectiveDate   string          `json:"effectiveDate,omitempty"`
	OfferTermCode   string          `json:"offerTermCode,omitempty"`
	PriceDimensions PriceDimensions `json:"priceDimensions,omitempty"`
	Sku             string          `json:"sku,omitempty"`
	TermAttributes  TermAttributes  `json:"termAttributes,omitempty"`
}

Card compute instance price card

type Client

type Client struct {
	Session     *session.Session
	EC2         *ec2.EC2
	Pricing     *pricing.Pricing
	AuthOpts    AuthOpts
	UserDataTpl *template.Template
}

Client a AWS provider client

func AuthenticatedClient

func AuthenticatedClient(opts AuthOpts) (*Client, error)

AuthenticatedClient returns an authenticated client

func (*Client) Build

func (c *Client) Build(params map[string]interface{}) (api.ClientAPI, error)

Build build a new Client from configuration parameter

func (*Client) CopyObject

func (c *Client) CopyObject(containerSrc, objectSrc, objectDst string) error

CopyObject copies an object

func (*Client) CreateContainer

func (c *Client) CreateContainer(name string) error

CreateContainer creates an object container

func (*Client) CreateGateway

func (c *Client) CreateGateway(req model.GWRequest) (*model.Host, error)

CreateGateway exists only to comply with api.ClientAPI interface

func (*Client) CreateHost

func (c *Client) CreateHost(request model.HostRequest) (*model.Host, error)

CreateHost creates an host that fulfils the request

func (*Client) CreateKeyPair

func (c *Client) CreateKeyPair(name string) (*model.KeyPair, error)

CreateKeyPair creates and import a key pair

func (*Client) CreateNetwork

func (c *Client) CreateNetwork(req model.NetworkRequest) (*model.Network, error)

CreateNetwork creates a network

func (*Client) CreateVolume

func (c *Client) CreateVolume(request model.VolumeRequest) (*model.Volume, error)

CreateVolume creates a block volume - name is the name of the volume - size is the size of the volume in GB - volumeType is the type of volume to create, if volumeType is empty the driver use a default type

func (*Client) CreateVolumeAttachment

func (c *Client) CreateVolumeAttachment(request model.VolumeAttachmentRequest) (*model.VolumeAttachment, error)

CreateVolumeAttachment attaches a volume to an host - name the name of the volume attachment - volume the volume to attach - host on which the volume is attached

func (*Client) DeleteContainer

func (c *Client) DeleteContainer(name string) error

DeleteContainer deletes an object container

func (*Client) DeleteGateway

func (c *Client) DeleteGateway(networkID string) error

DeleteGateway exists only to comply with api.ClientAPI interface

func (*Client) DeleteHost

func (c *Client) DeleteHost(id string) error

DeleteHost deletes the host identified by id

func (*Client) DeleteKeyPair

func (c *Client) DeleteKeyPair(id string) error

DeleteKeyPair deletes the key pair identified by id

func (*Client) DeleteNetwork

func (c *Client) DeleteNetwork(id string) error

DeleteNetwork deletes the network identified by id

func (*Client) DeleteObject

func (c *Client) DeleteObject(container, object string) error

DeleteObject deleta an object from a container

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(id string) error

DeleteVolume deletes the volume identified by id

func (*Client) DeleteVolumeAttachment

func (c *Client) DeleteVolumeAttachment(serverID, id string) error

DeleteVolumeAttachment deletes the volume attachment identifed by id

func (*Client) GetAuthOpts

func (c *Client) GetAuthOpts() (model.Config, error)

GetAuthOpts

func (*Client) GetCfgOpts

func (c *Client) GetCfgOpts() (model.Config, error)

GetCfgOpts return configuration parameters

func (*Client) GetContainer

func (c *Client) GetContainer(name string) (*api.ContainerInfo, error)

func (*Client) GetHost

func (c *Client) GetHost(hostParam interface{}) (*model.Host, error)

GetHost returns the host identified by id

func (*Client) GetImage

func (c *Client) GetImage(id string) (*model.Image, error)

GetImage returns the Image referenced by id

func (*Client) GetKeyPair

func (c *Client) GetKeyPair(id string) (*model.KeyPair, error)

GetKeyPair returns the key pair identified by id

func (*Client) GetNetwork

func (c *Client) GetNetwork(id string) (*model.Network, error)

GetNetwork returns the network identified by id

func (*Client) GetObject

func (c *Client) GetObject(container string, name string, ranges []model.Range) (*model.Object, error)

GetObject get object content from an object container

func (*Client) GetObjectMetadata

func (c *Client) GetObjectMetadata(container string, name string) (*model.Object, error)

GetObjectMetadata get object metadata from an object container

func (*Client) GetTemplate

func (c *Client) GetTemplate(id string) (*model.HostTemplate, error)

GetTemplate returns the Template referenced by id

func (*Client) GetVolume

func (c *Client) GetVolume(id string) (*model.Volume, error)

GetVolume returns the volume identified by id

func (*Client) GetVolumeAttachment

func (c *Client) GetVolumeAttachment(serverID, id string) (*model.VolumeAttachment, error)

GetVolumeAttachment returns the volume attachment identified by id

func (*Client) ListContainers

func (c *Client) ListContainers() ([]string, error)

ListContainers list object containers

func (*Client) ListHosts

func (c *Client) ListHosts() ([]model.Host, error)

ListHosts lists available hosts

func (*Client) ListImages

func (c *Client) ListImages(all bool) ([]model.Image, error)

ListImages lists available OS images

func (*Client) ListKeyPairs

func (c *Client) ListKeyPairs() ([]model.KeyPair, error)

ListKeyPairs lists available key pairs

func (*Client) ListNetworks

func (c *Client) ListNetworks() ([]model.Network, error)

ListNetworks lists available networks

func (*Client) ListObjects

func (c *Client) ListObjects(container string, filter model.ObjectFilter) ([]string, error)

ListObjects list objects of a container

func (*Client) ListTemplates

func (c *Client) ListTemplates(all bool) ([]model.HostTemplate, error)

ListTemplates lists available host templates Host templates are sorted using Dominant Resource Fairness Algorithm

func (*Client) ListVolumeAttachments

func (c *Client) ListVolumeAttachments(serverID string) ([]model.VolumeAttachment, error)

ListVolumeAttachments lists available volume attachment

func (*Client) ListVolumes

func (c *Client) ListVolumes() ([]model.Volume, error)

ListVolumes list available volumes

func (*Client) PutObject

func (c *Client) PutObject(container string, obj model.Object) error

PutObject put an object into an object container

func (*Client) RebootHost

func (c *Client) RebootHost(id string) error

func (*Client) StartHost

func (c *Client) StartHost(id string) error

StartHost starts the host identified by id

func (*Client) StopHost

func (c *Client) StopHost(id string) error

StopHost stops the host identified by id

func (*Client) UpdateObjectMetadata

func (c *Client) UpdateObjectMetadata(container string, obj model.Object) error

UpdateObjectMetadata update an object into object container

type OnDemand

type OnDemand struct {
	Cards map[string]Card
}

OnDemand on demand compute instance cards

type Price

type Price struct {
	Product         Product `json:"product,omitempty"`
	PublicationDate string  `json:"publicationDate,omitempty"`
	ServiceCode     string  `json:"serviceCode,omitempty"`
	Terms           Terms   `json:"terms,omitempty"`
}

Price Compute instance price information

type PriceDimension

type PriceDimension struct {
	AppliesTo    []string           `json:"appliesTo,omitempty"`
	BeginRange   string             `json:"beginRange,omitempty"`
	Description  string             `json:"description,omitempty"`
	EndRange     string             `json:"endRange,omitempty"`
	PricePerUnit map[string]float32 `json:"pricePerUnit,omitempty"`
	RateCode     string             `json:"RateCode,omitempty"`
	Unit         string             `json:"Unit,omitempty"`
}

PriceDimension compute instance price related to term condition

type PriceDimensions

type PriceDimensions struct {
	PriceDimensionMap map[string]PriceDimension `json:"price_dimension_map,omitempty"`
}

PriceDimensions compute instance price dimensions

type Product

type Product struct {
	Attributes    Attributes `json:"attributes,omitempty"`
	ProductFamily string     `json:"productFamily,omitempty"`
	Sku           string     `json:"sku,omitempty"`
}

Product compute instance product

type Reserved

type Reserved struct {
	Cards map[string]Card `json:"cards,omitempty"`
}

Reserved reserved compute instance cards

type TermAttributes

type TermAttributes struct {
	LeaseContractLength string `json:"leaseContractLength,omitempty"`
	OfferingClass       string `json:"offeringClass,omitempty"`
	PurchaseOption      string `json:"purchaseOption,omitempty"`
}

TermAttributes compute instance terms

type Terms

type Terms struct {
	OnDemand OnDemand `json:"onDemand,omitempty"`
	Reserved Reserved `json:"reserved,omitempty"`
}

Terms compute instance prices terms

Jump to

Keyboard shortcuts

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