virtualmachines

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

Types

type AzureClient

type AzureClient struct {
	// contains filtered or unexported fields
}

AzureClient contains the Azure go-sdk Client

func NewClient

func NewClient(subscriptionID string, authorizer autorest.Authorizer) *AzureClient

NewClient creates a new VM client from subscription ID.

func (*AzureClient) CreateOrUpdate

func (ac *AzureClient) CreateOrUpdate(ctx context.Context, resourceGroupName, vmName string, vm compute.VirtualMachine) error

CreateOrUpdate the operation to create or update a virtual machine.

func (*AzureClient) Delete

func (ac *AzureClient) Delete(ctx context.Context, resourceGroupName, vmName string) error

Delete the operation to delete a virtual machine.

func (*AzureClient) Get

func (ac *AzureClient) Get(ctx context.Context, resourceGroupName, vmName string) (compute.VirtualMachine, error)

Get retrieves information about the model view or the instance view of a virtual machine.

type Client

Client wraps go-sdk

type Service

type Service struct {
	Scope        *scope.ClusterScope
	MachineScope *scope.MachineScope
	Client
	InterfacesClient      networkinterfaces.Client
	PublicIPsClient       publicips.Client
	RoleAssignmentsClient roleassignments.Client
}

Service provides operations on azure resources

func NewService

func NewService(scope *scope.ClusterScope, machineScope *scope.MachineScope) *Service

NewService creates a new service.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, spec interface{}) error

Delete deletes the virtual machine with the provided name.

func (*Service) Get

func (s *Service) Get(ctx context.Context, spec interface{}) (interface{}, error)

Get provides information about a virtual machine.

func (*Service) Reconcile

func (s *Service) Reconcile(ctx context.Context, spec interface{}) error

Reconcile gets/creates/updates a virtual machine.

type Spec

type Spec struct {
	Name                   string
	NICName                string
	SSHKeyData             string
	Size                   string
	Zone                   string
	Image                  *infrav1.Image
	Identity               infrav1.VMIdentity
	OSDisk                 infrav1.OSDisk
	CustomData             string
	UserAssignedIdentities []infrav1.UserAssignedIdentity
}

Spec input specification for Get/CreateOrUpdate/Delete calls

Directories

Path Synopsis
Run go generate to regenerate this mock.
Run go generate to regenerate this mock.

Jump to

Keyboard shortcuts

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