Documentation ¶
Overview ¶
Package arm provides methods for creating and manipulating VMs on Azure using arm API.
Index ¶
- Constants
- Variables
- type OAuthCredentials
- type VM
- func (vm *VM) AddDisk() error
- func (vm *VM) Destroy() error
- func (vm *VM) GetIPs() ([]net.IP, error)
- func (vm *VM) GetName() string
- func (vm *VM) GetSSH(options ssh.Options) (ssh.Client, error)
- func (vm *VM) GetState() (string, error)
- func (vm *VM) Halt() error
- func (vm *VM) Provision() error
- func (vm *VM) RemoveDisk(diskName string) error
- func (vm *VM) Resume() error
- func (vm *VM) Start() error
- func (vm *VM) Suspend() error
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) GetSSH ¶
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 ¶
GetState returns the status of the Azure VM. The status will be one of the following:
"running" "stopped"
func (*VM) Provision ¶
Provision creates a new VM instance on Azure. It returns an error if there was a problem during creation.
func (*VM) RemoveDisk ¶
Click to show internal directories.
Click to hide internal directories.