virtualmachines

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClient

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

AzureClient contains the Azure go-sdk Client.

func NewClient

func NewClient(auth azure.Authorizer, apiCallTimeout time.Duration) (*AzureClient, error)

NewClient creates a VMs client from an authorizer.

func (*AzureClient) CreateOrUpdateAsync added in v1.1.0

func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armcompute.VirtualMachinesClientCreateOrUpdateResponse], err error)

CreateOrUpdateAsync creates or updates a virtual machine asynchronously. It sends a PUT request to Azure and if accepted without error, the func will return a Poller which can be used to track the ongoing progress of the operation.

func (*AzureClient) DeleteAsync added in v1.1.0

func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[armcompute.VirtualMachinesClientDeleteResponse], err error)

DeleteAsync deletes a virtual machine asynchronously. DeleteAsync sends a DELETE request to Azure and if accepted without error, the func will return a Poller which can be used to track the ongoing progress of the operation.

func (*AzureClient) Get

func (ac *AzureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) (result interface{}, err error)

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

type Client

type Client interface {
	Get(context.Context, azure.ResourceSpecGetter) (interface{}, error)
	CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armcompute.VirtualMachinesClientCreateOrUpdateResponse], err error)
	DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[armcompute.VirtualMachinesClientDeleteResponse], err error)
}

Client provides operations on Azure virtual machine resources.

type Service

type Service struct {
	Scope VMScope
	async.Reconciler
	// contains filtered or unexported fields
}

Service provides operations on Azure resources.

func New

func New(scope VMScope) (*Service, error)

New creates a new service.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context) error

Delete deletes the virtual machine with the provided name.

func (*Service) IsManaged added in v1.3.0

func (s *Service) IsManaged(ctx context.Context) (bool, error)

IsManaged returns always returns true as CAPZ does not support BYO VM.

func (*Service) Name added in v1.3.0

func (s *Service) Name() string

Name returns the service name.

func (*Service) Reconcile

func (s *Service) Reconcile(ctx context.Context) error

Reconcile idempotently creates or updates a virtual machine.

type VMScope

type VMScope interface {
	azure.Authorizer
	azure.AsyncStatusUpdater
	VMSpec() azure.ResourceSpecGetter
	SetAnnotation(string, string)
	SetProviderID(string)
	SetAddresses([]corev1.NodeAddress)
	SetVMState(infrav1.ProvisioningState)
	SetConditionFalse(clusterv1.ConditionType, string, clusterv1.ConditionSeverity, string)
}

VMScope defines the scope interface for a virtual machines service.

type VMSpec added in v1.1.0

type VMSpec struct {
	Name                       string
	ResourceGroup              string
	Location                   string
	ExtendedLocation           *infrav1.ExtendedLocationSpec
	ClusterName                string
	Role                       string
	NICIDs                     []string
	SSHKeyData                 string
	Size                       string
	AvailabilitySetID          string
	Zone                       string
	Identity                   infrav1.VMIdentity
	OSDisk                     infrav1.OSDisk
	DataDisks                  []infrav1.DataDisk
	UserAssignedIdentities     []infrav1.UserAssignedIdentity
	SpotVMOptions              *infrav1.SpotVMOptions
	SecurityProfile            *infrav1.SecurityProfile
	AdditionalTags             infrav1.Tags
	AdditionalCapabilities     *infrav1.AdditionalCapabilities
	DiagnosticsProfile         *infrav1.Diagnostics
	CapacityReservationGroupID string
	SKU                        resourceskus.SKU
	Image                      *infrav1.Image
	BootstrapData              string
	ProviderID                 string
}

VMSpec defines the specification for a Virtual Machine.

func (*VMSpec) OwnerResourceName added in v1.1.0

func (s *VMSpec) OwnerResourceName() string

OwnerResourceName is a no-op for virtual machines.

func (*VMSpec) Parameters added in v1.1.0

func (s *VMSpec) Parameters(ctx context.Context, existing interface{}) (params interface{}, err error)

Parameters returns the parameters for the virtual machine.

func (*VMSpec) ResourceGroupName added in v1.1.0

func (s *VMSpec) ResourceGroupName() string

ResourceGroupName returns the name of the virtual machine.

func (*VMSpec) ResourceName added in v1.1.0

func (s *VMSpec) ResourceName() string

ResourceName returns the name of the virtual machine.

Directories

Path Synopsis
Package mock_virtualmachines is a generated GoMock package.
Package mock_virtualmachines is a generated GoMock package.

Jump to

Keyboard shortcuts

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