azure

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package azure provides methods for creating and manipulating VMs on Azure.

Index

Constants

View Source
const (
	// PublicIP is the index of the public IP address that GetIPs returns.
	PublicIP = 0

	// PrivateIP is the index of the private IP address that GetIPs returns.
	PrivateIP = 1

	// DefaultTimeout is the maximum seconds to wait before failing to GetSSH.
	DefaultTimeout = 800
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificated

type Certificated struct {
	Data   []byte
	Format string
}

Certificated data for azure hosted services https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-use-ssh-key/

type DeploymentOptions

type DeploymentOptions struct {
	VirtualNetworkName string
	ReservedIPName     string
}

DeploymentOptions contains the names of some Azure networking options.

type VM

type VM struct {
	PublishSettings  string            // publishsettings file path of current account
	ServiceName      string            // Azure hosted service name
	Label            string            // Label for hosted service
	Name             string            // VM name
	Size             string            // virtual machine size
	SourceImage      string            // source vhd file name
	StorageAccount   string            // Storage account name
	StorageContainer string            // the container belongs to storage account
	Location         string            // region on Azure
	SSHCreds         ssh.Credentials   // required
	DeployOptions    DeploymentOptions // optional
	ConfigureHTTP    bool              // Flag to configure HTTP endpoint for the VM
	Cert             Certificated
}

VM represents an Azure virtual machine.

func (*VM) Destroy

func (vm *VM) Destroy() error

Destroy deletes the VM on Azure.

func (*VM) GetIPs

func (vm *VM) GetIPs() ([]net.IP, error)

GetIPs returns the IP addresses of the Azure VM instance.

func (*VM) GetName

func (vm *VM) GetName() string

GetName returns the name of the VM.

func (*VM) GetSSH

func (vm *VM) GetSSH(options ssh.Options) (ssh.Client, error)

GetSSH returns an SSH client that can be used to connect to the VM. An error is returned if the VM has no IPs.

func (*VM) GetState

func (vm *VM) GetState() (string, error)

GetState returns the status of the Azure VM. The status will be one of the following:

"Running"
"Suspended"
"RunningTransitioning"
"SuspendedTransitioning"
"Starting"
"Suspending"
"Deploying"
"Deleting"

func (*VM) Halt

func (vm *VM) Halt() error

Halt shuts down the VM.

func (*VM) Provision

func (vm *VM) Provision() error

Provision creates a new VM instance on Azure. It returns an error if there was a problem during creation.

func (*VM) Resume

func (vm *VM) Resume() error

Resume returns an error because it is not supported on Azure.

func (*VM) Start

func (vm *VM) Start() error

Start boots a stopped VM.

func (*VM) Suspend

func (vm *VM) Suspend() error

Suspend returns an error because it is not supported on Azure.

Jump to

Keyboard shortcuts

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