Documentation ¶
Index ¶
- Constants
- type Azure
- func (a *Azure) AttachVolume(ctx *lepton.Context, image, name string, attachID int) error
- func (a *Azure) BuildImage(ctx *lepton.Context) (string, error)
- func (a *Azure) BuildImageWithPackage(ctx *lepton.Context, pkgpath string) (string, error)
- func (a *Azure) CreateImage(ctx *lepton.Context, imagePath string) error
- func (a *Azure) CreateInstance(ctx *lepton.Context) error
- func (a *Azure) CreateNIC(ctx context.Context, location string, ...) (nic network.Interface, err error)
- func (a *Azure) CreateNetworkSecurityGroup(ctx context.Context, location string, nsgName string, c *types.Config) (nsg *network.SecurityGroup, err error)
- func (a *Azure) CreatePublicIP(ctx context.Context, location string, ipName string, ipv6 bool) (ip network.PublicIPAddress, err error)
- func (a *Azure) CreateSimpleNetworkSecurityGroup(ctx context.Context, location string, nsgName string) (nsg network.SecurityGroup, err error)
- func (a *Azure) CreateSubnetWithNetworkSecurityGroup(ctx context.Context, vnetName, subnetName, addressPrefix, nsgName string, ...) (subnet *network.Subnet, err error)
- func (a *Azure) CreateVirtualNetwork(ctx context.Context, location string, vnetName string, c *types.Config) (vnet *network.VirtualNetwork, err error)
- func (a *Azure) CreateVirtualNetworkAndSubnets(ctx context.Context, location string, ...) (vnet *network.VirtualNetwork, err error)
- func (a *Azure) CreateVirtualNetworkSubnet(ctx context.Context, vnetName, subnetName string) (subnet *network.Subnet, err error)
- func (a *Azure) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
- func (a *Azure) CreateZoneRecord(config *types.Config, zoneID string, record *lepton.DNSRecord) error
- func (a *Azure) CustomizeImage(ctx *lepton.Context) (string, error)
- func (a *Azure) DeleteIP(ctx *lepton.Context, ipConfiguration *network.InterfaceIPConfiguration) error
- func (a *Azure) DeleteImage(ctx *lepton.Context, imagename string) error
- func (a *Azure) DeleteInstance(ctx *lepton.Context, instancename string) error
- func (a *Azure) DeleteNIC(ctx *lepton.Context, nic *network.Interface) error
- func (a *Azure) DeleteNetworkSecurityGroup(ctx *lepton.Context, securityGroupID string) error
- func (a *Azure) DeleteSubnetwork(ctx *lepton.Context, subnetID string) error
- func (a *Azure) DeleteVolume(ctx *lepton.Context, name string) error
- func (a *Azure) DeleteZoneRecordIfExists(config *types.Config, zoneID string, recordName string) error
- func (a *Azure) DetachVolume(ctx *lepton.Context, image, name string) error
- func (a *Azure) Environment() *azure.Environment
- func (a *Azure) FindOrCreateZoneIDByName(config *types.Config, dnsName string) (string, error)
- func (a *Azure) GetAllVolumes(ctx *lepton.Context) (*[]lepton.NanosVolume, error)
- func (a *Azure) GetImages(ctx *lepton.Context, filter string) ([]lepton.CloudImage, error)
- func (a *Azure) GetInstanceByName(ctx *lepton.Context, name string) (vm *lepton.CloudInstance, err error)
- func (a *Azure) GetInstanceLogs(ctx *lepton.Context, instancename string) (string, error)
- func (a *Azure) GetInstances(ctx *lepton.Context) (cinstances []lepton.CloudInstance, err error)
- func (a *Azure) GetNetworkSecurityGroup(ctx context.Context, nsgName string) (sg *network.SecurityGroup, err error)
- func (a *Azure) GetPublicIP(ctx context.Context, ipName string) (ip network.PublicIPAddress, err error)
- func (a *Azure) GetResourceManagementAuthorizer() (autorest.Authorizer, error)
- func (a *Azure) GetStorage() lepton.Storage
- func (a *Azure) GetVM(ctx context.Context, vmName string) (vm compute.VirtualMachine, err error)
- func (a *Azure) GetVPC(vnetName string) (vnet *network.VirtualNetwork, err error)
- func (a *Azure) GetVirtualNetworkSubnet(ctx context.Context, vnetName string, subnetName string) (subnet *network.Subnet, err error)
- func (a *Azure) Initialize(config *types.ProviderConfig) error
- func (a *Azure) InstanceStats(ctx *lepton.Context, instancename string, watch bool) error
- func (a *Azure) ListImages(ctx *lepton.Context, filter string) error
- func (a *Azure) ListInstances(ctx *lepton.Context) error
- func (a *Azure) PrintInstanceLogs(ctx *lepton.Context, instancename string, watch bool) error
- func (a *Azure) RebootInstance(ctx *lepton.Context, instanceName string) error
- func (a *Azure) ResizeImage(ctx *lepton.Context, imagename string, hbytes string) error
- func (a *Azure) RestartVM(ctx context.Context, vmName string) (osr autorest.Response, err error)
- func (a *Azure) StartInstance(ctx *lepton.Context, instancename string) error
- func (a *Azure) StopInstance(ctx *lepton.Context, instancename string) error
- func (a *Azure) SyncImage(config *types.Config, target lepton.Provider, image string) error
- type Storage
Constants ¶
const ProviderName = "azure"
ProviderName of the cloud platform provider
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Azure ¶
type Azure struct { Storage *Storage // contains filtered or unexported fields }
Azure Provider to interact with Azure cloud infrastructure
func (*Azure) AttachVolume ¶
AttachVolume attaches a volume to an instance
func (*Azure) BuildImage ¶
BuildImage to be upload on Azure
func (*Azure) BuildImageWithPackage ¶
BuildImageWithPackage to upload on Azure
func (*Azure) CreateImage ¶
CreateImage - Creates image on Azure using nanos images
func (*Azure) CreateInstance ¶
CreateInstance - Creates instance on azure Platform
func (*Azure) CreateNIC ¶
func (a *Azure) CreateNIC(ctx context.Context, location string, vnetName, subnetName, nsgName, ipName, ipv6Name, nicName string, enableIPForwarding bool, c *types.Config) (nic network.Interface, err error)
CreateNIC creates a new network interface. The Network Security Group is not a required parameter
func (*Azure) CreateNetworkSecurityGroup ¶
func (a *Azure) CreateNetworkSecurityGroup(ctx context.Context, location string, nsgName string, c *types.Config) (nsg *network.SecurityGroup, err error)
CreateNetworkSecurityGroup creates a new network security group with rules set for allowing SSH and HTTPS use
func (*Azure) CreatePublicIP ¶
func (a *Azure) CreatePublicIP(ctx context.Context, location string, ipName string, ipv6 bool) (ip network.PublicIPAddress, err error)
CreatePublicIP creates a new public IP
func (*Azure) CreateSimpleNetworkSecurityGroup ¶
func (a *Azure) CreateSimpleNetworkSecurityGroup(ctx context.Context, location string, nsgName string) (nsg network.SecurityGroup, err error)
CreateSimpleNetworkSecurityGroup creates a new network security group, without rules (rules can be set later)
func (*Azure) CreateSubnetWithNetworkSecurityGroup ¶
func (a *Azure) CreateSubnetWithNetworkSecurityGroup(ctx context.Context, vnetName, subnetName, addressPrefix, nsgName string, c *types.Config) (subnet *network.Subnet, err error)
CreateSubnetWithNetworkSecurityGroup create a subnet referencing a network security group
func (*Azure) CreateVirtualNetwork ¶
func (a *Azure) CreateVirtualNetwork(ctx context.Context, location string, vnetName string, c *types.Config) (vnet *network.VirtualNetwork, err error)
CreateVirtualNetwork creates a virtual network
func (*Azure) CreateVirtualNetworkAndSubnets ¶
func (a *Azure) CreateVirtualNetworkAndSubnets(ctx context.Context, location string, vnetName, subnet1Name, subnet2Name string) (vnet *network.VirtualNetwork, err error)
CreateVirtualNetworkAndSubnets creates a virtual network with two subnets
func (*Azure) CreateVirtualNetworkSubnet ¶
func (a *Azure) CreateVirtualNetworkSubnet(ctx context.Context, vnetName, subnetName string) (subnet *network.Subnet, err error)
CreateVirtualNetworkSubnet creates a subnet in an existing vnet
func (*Azure) CreateVolume ¶
func (a *Azure) CreateVolume(ctx *lepton.Context, cv types.CloudVolume, data string, provider string) (lepton.NanosVolume, error)
CreateVolume uploads the volume raw file and creates a disk from it
func (*Azure) CreateZoneRecord ¶
func (a *Azure) CreateZoneRecord(config *types.Config, zoneID string, record *lepton.DNSRecord) error
CreateZoneRecord creates a record in a DNS zone
func (*Azure) CustomizeImage ¶
CustomizeImage returns image path with adaptations needed by cloud provider
func (*Azure) DeleteIP ¶
func (a *Azure) DeleteIP(ctx *lepton.Context, ipConfiguration *network.InterfaceIPConfiguration) error
DeleteIP deletes a ip configuration and tries deleting subnetwork associated
func (*Azure) DeleteImage ¶
DeleteImage deletes image from Azure
func (*Azure) DeleteInstance ¶
DeleteInstance deletes instance from Azure
func (*Azure) DeleteNetworkSecurityGroup ¶
DeleteNetworkSecurityGroup deletes the security group
func (*Azure) DeleteSubnetwork ¶
DeleteSubnetwork deletes subnetwork if there is no other device using it Also deletes virtual network if the deleted subnetwork was the only one associated under it
func (*Azure) DeleteVolume ¶
DeleteVolume deletes an existing volume
func (*Azure) DeleteZoneRecordIfExists ¶
func (a *Azure) DeleteZoneRecordIfExists(config *types.Config, zoneID string, recordName string) error
DeleteZoneRecordIfExists deletes a record from a DNS zone if it exists
func (*Azure) DetachVolume ¶
DetachVolume detachs a volume from an instance
func (*Azure) Environment ¶
func (a *Azure) Environment() *azure.Environment
Environment returns an `azure.Environment{...}` for the current cloud.
func (*Azure) FindOrCreateZoneIDByName ¶
FindOrCreateZoneIDByName searches for a DNS zone with the name passed by argument and if it doesn't exist it creates one
func (*Azure) GetAllVolumes ¶
GetAllVolumes returns all volumes in NanosVolume format
func (*Azure) GetInstanceByName ¶
func (a *Azure) GetInstanceByName(ctx *lepton.Context, name string) (vm *lepton.CloudInstance, err error)
GetInstanceByName returns instance with given name
func (*Azure) GetInstanceLogs ¶
GetInstanceLogs gets instance related logs
func (*Azure) GetInstances ¶
GetInstances return all instances on Azure
func (*Azure) GetNetworkSecurityGroup ¶
func (a *Azure) GetNetworkSecurityGroup(ctx context.Context, nsgName string) (sg *network.SecurityGroup, err error)
GetNetworkSecurityGroup returns an existing network security group
func (*Azure) GetPublicIP ¶
func (a *Azure) GetPublicIP(ctx context.Context, ipName string) (ip network.PublicIPAddress, err error)
GetPublicIP returns an existing public IP
func (*Azure) GetResourceManagementAuthorizer ¶
func (a *Azure) GetResourceManagementAuthorizer() (autorest.Authorizer, error)
GetResourceManagementAuthorizer returns an autorest authorizer.
func (*Azure) GetStorage ¶
GetStorage returns storage interface for cloud provider
func (*Azure) GetVPC ¶
func (a *Azure) GetVPC(vnetName string) (vnet *network.VirtualNetwork, err error)
GetVPC finds the virtual network by id
func (*Azure) GetVirtualNetworkSubnet ¶
func (a *Azure) GetVirtualNetworkSubnet(ctx context.Context, vnetName string, subnetName string) (subnet *network.Subnet, err error)
GetVirtualNetworkSubnet returns an existing subnet from a virtual network
func (*Azure) Initialize ¶
func (a *Azure) Initialize(config *types.ProviderConfig) error
Initialize Azure related things
func (*Azure) InstanceStats ¶
InstanceStats show metrics for instances on azure.
func (*Azure) ListImages ¶
ListImages lists images on azure
func (*Azure) ListInstances ¶
ListInstances lists instances on Azure
func (*Azure) PrintInstanceLogs ¶
PrintInstanceLogs writes instance logs to console
func (*Azure) RebootInstance ¶
RebootInstance reboots the instance. prob use the below?
func (*Azure) ResizeImage ¶
ResizeImage is not supported on azure.
func (*Azure) StartInstance ¶
StartInstance starts an instance in Azure
func (*Azure) StopInstance ¶
StopInstance deletes instance from Azure
type Storage ¶
type Storage struct{}
Storage provides Azure storage related operations
func (*Storage) CopyToBucket ¶
CopyToBucket copies archive to bucket