azure

package
v0.0.0-...-8a57f99 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	User           *User  `json:"user"`
	TenantID       string `json:"tenantId" envconfig:"TENANT_ID" required:"true"`
	SubscriptionID string `json:"id" envconfig:"SUBSCRIPTION_ID" required:"true"`
	ResourceGroup  ResourceGroup
	Deployment     Deployment
}

Account holds the values needed to talk to the Azure API

func GetCurrentAccount

func GetCurrentAccount() (*Account, error)

GetCurrentAccount will run an az account show and parse that into an account strcut

func NewAccount

func NewAccount() (*Account, error)

NewAccount will parse env vars and return a new struct

func (*Account) CreateDeployment

func (a *Account) CreateDeployment(name string, e *engine.Engine) error

CreateDeployment will deploy a cluster to a given resource group using the template and parameters on disk

func (*Account) CreateGroup

func (a *Account) CreateGroup(name, location string) error

CreateGroup will create a resource group in a given location --tags "type=${RESOURCE_GROUP_TAG_TYPE:-}" "now=$(date +%s)" "job=${JOB_BASE_NAME:-}" "buildno=${BUILD_NUM:-}"

func (*Account) CreateVnet

func (a *Account) CreateVnet(vnet, addressPrefixes, subnetName, subnetPrefix string) error

CreateVnet will create a vnet in a resource group

func (*Account) DeleteGroup

func (a *Account) DeleteGroup(name string, wait bool) error

DeleteGroup deletes a given resource group by name

func (*Account) GetHosts

func (a *Account) GetHosts(name string) ([]VM, error)

GetHosts will get a list of vms in the resource group

func (*Account) Login

func (a *Account) Login() error

Login will login to a given subscription

func (*Account) SetSubscription

func (a *Account) SetSubscription() error

SetSubscription will call az account set --subscription for the given Account

func (*Account) UpdateRouteTables

func (a *Account) UpdateRouteTables(subnet, vnet string) error

UpdateRouteTables is used to updated a vnet with the appropriate route tables

type Deployment

type Deployment struct {
	Name              string // Name of the deployment
	TemplateDirectory string // engine.GeneratedDefinitionPath
}

Deployment represents a deployment of an acs cluster

type ResourceGroup

type ResourceGroup struct {
	Name     string
	Location string
}

ResourceGroup represents a collection of azure resources

type RouteTable

type RouteTable struct {
	ID                string `json:"id"`
	Location          string `json:"location"`
	Name              string `json:"name"`
	ProvisioningState string `json:"provisioningState"`
	ResourceGroup     string `json:"resourceGroup"`
}

RouteTable holds information from running az network route-table list

type User

type User struct {
	ID     string `json:"name" envconfig:"CLIENT_ID" required:"true"`
	Secret string `envconfig:"CLIENT_SECRET" required:"true"`
	Type   string `json:"type"`
}

User represents the user currently logged into an Account

type VM

type VM struct {
	Name string `json:"name"`
}

VM represents an azure vm

Jump to

Keyboard shortcuts

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