arm

package
v0.0.0-...-492d7f2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package arm provides methods for creating and manipulating VMs on Azure using arm API.

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
)
View Source
const Linux = `` /* 5267-byte string literal not displayed */

Linux is the d efault arm template to provision a libretto (Linux) vm on Azure

Variables

View Source
var (
	// ErrActionTimeout is returned when the Azure instance takes too long to enter waited state.
	ErrActionTimeout = errors.New("Azure action timeout")
)
View Source
var SSHTimeout = 180 * time.Second

SSHTimeout is the maximum time to wait before failing to GetSSH. This is not thread-safe.

Functions

This section is empty.

Types

type OAuthCredentials

type OAuthCredentials struct {
	ClientID       string
	ClientSecret   string
	TenantID       string
	SubscriptionID string
}

OAuthCredentials is the struct that stors OAUTH credentials

type VM

type VM struct {
	// Credentials to connect Azure
	Creds OAuthCredentials

	// Image Properties
	ImagePublisher string
	ImageOffer     string
	ImageSku       string

	// VM Properties
	Size string
	Name string

	// SSH Properties
	SSHCreds     ssh.Credentials // required
	SSHPublicKey string

	// Deployment Properties
	ResourceGroup    string
	StorageAccount   string
	StorageContainer string

	// VM OS Properties
	OsFile string

	// VM Disk Properties
	DiskFile string
	DiskSize int //GB

	// VM Network Properties
	NetworkSecurityGroup string
	Nic                  string
	PublicIP             string
	Subnet               string
	VirtualNetwork       string

	// deployment
	DeploymentName string
}

VM represents an Azure virtual machine.

func (*VM) AddDisk

func (vm *VM) AddDisk() error

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"
"stopped"

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) RemoveDisk

func (vm *VM) RemoveDisk(diskName string) error

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