common

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

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

Go to latest
Published: Jun 5, 2019 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClient

AzureClient This is an authorized client for Azure communication.

var Client AzureClient

Client Authorized Azure Client

func NewClient

func NewClient(config Config) (client AzureClient)

NewClient Initialized an authorized Azure client

func (AzureClient) GetAllNics

GetAllNics Returns a ListResultPage of all Interfaces in the ResourceGroup of the Config

func (AzureClient) GetAllVM

func (c AzureClient) GetAllVM() (result compute.VirtualMachineListResultPage)

GetAllVM Returns a ListResultPage of all VMs in the ResourceGroup of the Config

func (AzureClient) GetNicFromNicName

func (c AzureClient) GetNicFromNicName(nicName string) network.Interface

GetNicFromNicName returns nic object based on nic name

func (AzureClient) GetNicFromVMName

func (c AzureClient) GetNicFromVMName(vmName string) network.Interface

GetNicFromVMName returns primary nic object based on vm name

func (AzureClient) GetVM

func (c AzureClient) GetVM(vmname string) (vm compute.VirtualMachine)

GetVM Returns a VirtualMachine object.

func (AzureClient) PutNic

func (c AzureClient) PutNic(vmName string) autorest.Response

PutNic returns the Interface object

func (AzureClient) PutVM

func (c AzureClient) PutVM(vmname string) (res autorest.Response)

PutVM returns the Virtual Machine object

type ComputeInstanceMetadata

type ComputeInstanceMetadata struct {
	Environment          string              `json:"azEnvironment,omitempty"`
	Location             string              `json:"location,omitempty"`
	Name                 string              `json:"name,omitempty"`
	Offer                string              `json:"offer,omitempty"`
	OsType               string              `json:"osType,omitempty"`
	PlacementGroupID     string              `json:"placement_group_id,omitempty"`
	Plan                 map[string]string   `json:"plan,omitempty"`
	PlatformFaultDomain  string              `json:"platformFaultDomain,omitempty"`
	PlatformUpdateDomain string              `json:"platformUpdateDomain,omitempty"`
	Provider             string              `json:"provider,omitempty"`
	PublicKeys           []map[string]string `json:"publicKeys,omitempty"`
	Publisher            string              `json:"publisher,omitempty"`
	ResourceGroupName    string              `json:"resourceGroupName,omitempty"`
	Sku                  string              `json:"sku,omitempty"`
	SubscriptionID       string              `json:"subscriptionId,omitempty"`
	Tags                 string              `json:"tags,omitempty"`
	Version              string              `json:"version,omitempty"`
	VMID                 string              `json:"vmId,omitempty"`
	VMScaleSetName       string              `json:"vmScaleSetName,omitempty"`
	VMSize               string              `json:"vmSize,omitempty"`
	Zone                 string              `json:"zone,omitempty"`
}

ComputeInstanceMetadata denotes the compute specific instance metadata from Azure Instance Metadata Service

type Config

type Config struct {
	VMName              string
	SubscriptionID      string
	Location            string
	ResourceGroup       string
	AzureEnvironment    string
	EnvironmentEndpoint string
}

Config returns a config with the Azure resource group and Azure location to perform requests

var Conf Config

Conf Loaded Configuration from azure.json

func LoadConfig

func LoadConfig() (config Config)

LoadConfig Returns a Config struct created from Environment Variables

Jump to

Keyboard shortcuts

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