Documentation ¶
Index ¶
- type Account
- func (a *Account) CreateDeployment(name string, e *engine.Engine) error
- func (a *Account) CreateGroup(name, location string) error
- func (a *Account) CreateSubnet(vnet, subnetName, subnetPrefix string) error
- func (a *Account) CreateVnet(vnet, addressPrefixes string) error
- func (a *Account) DeleteGroup(name string, wait bool) error
- func (a *Account) FetchActivityLog(rg string) (string, error)
- func (a *Account) GetHosts(name string) ([]VM, error)
- func (a *Account) IsClusterExpired(d time.Duration) bool
- func (a *Account) Login() error
- func (a *Account) SetResourceGroup(name string) error
- func (a *Account) SetSubscription() error
- func (a *Account) UpdateRouteTables(subnet, vnet string) error
- type Deployment
- type ResourceGroup
- type RouteTable
- type Storage
- type StorageAccount
- func (sa *StorageAccount) CreateFileShare(name string) error
- func (sa *StorageAccount) CreateStorageAccount() error
- func (sa *StorageAccount) DeleteFiles(source string) error
- func (sa *StorageAccount) DownloadFiles(source, destination string) error
- func (sa *StorageAccount) SetConnectionString() error
- func (sa *StorageAccount) UploadFiles(source, destination string) error
- type User
- type VM
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 StorageAccount *StorageAccount TimeoutCommands bool }
Account represents an Azure account
func NewAccount ¶
NewAccount will parse env vars and return a new account struct
func (*Account) CreateDeployment ¶
CreateDeployment will deploy a cluster to a given resource group using the template and parameters on disk
func (*Account) CreateGroup ¶
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) CreateSubnet ¶
CreateSubnet will create a subnet in a vnet in a resource group
func (*Account) CreateVnet ¶
CreateVnet will create a vnet in a resource group
func (*Account) DeleteGroup ¶
DeleteGroup deletes a given resource group by name
func (*Account) FetchActivityLog ¶
FetchActivityLog gets all the failures from the activity log for the provided resource group.
func (*Account) IsClusterExpired ¶
IsClusterExpired will return true if a deployment was created more than t nanoseconds ago, or if timestamp is not found
func (*Account) SetResourceGroup ¶
SetResourceGroup will set the account resource group
func (*Account) SetSubscription ¶
SetSubscription will call az account set --subscription for the given Account
func (*Account) UpdateRouteTables ¶
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 `json:"name"` Location string `json:"location"` Tags map[string]string `json:"tags"` }
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 Storage ¶
type Storage interface { CreateStorageAccount() error SetConnectionString() error UploadFiles(source, destination string) error DownloadFiles(source, destination string) error DeleteFiles(source string) error }
Storage provides access to StorageAccount objects
type StorageAccount ¶
type StorageAccount struct { Name string ConnectionString string `json:"connectionString"` ResourceGroup ResourceGroup TimeoutCommands bool }
StorageAccount represents an azure storage account
func (*StorageAccount) CreateFileShare ¶
func (sa *StorageAccount) CreateFileShare(name string) error
CreateFileShare will create a file share in a storage account if it doesn't already exist
func (*StorageAccount) CreateStorageAccount ¶
func (sa *StorageAccount) CreateStorageAccount() error
CreateStorageAccount will create a new Azure Storage Account
func (*StorageAccount) DeleteFiles ¶
func (sa *StorageAccount) DeleteFiles(source string) error
DeleteFiles deletes files from an Azure storage file share
func (*StorageAccount) DownloadFiles ¶
func (sa *StorageAccount) DownloadFiles(source, destination string) error
DownloadFiles will download the output directory from storage
func (*StorageAccount) SetConnectionString ¶
func (sa *StorageAccount) SetConnectionString() error
SetConnectionString will set the storage account connection string
func (*StorageAccount) UploadFiles ¶
func (sa *StorageAccount) UploadFiles(source, destination string) error
UploadFiles will upload the output directory to storage