azure_interface

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClienter

type AzureClienter interface {
	common_interface.Clienter

	// ListResourceGroups lists all resource groups in the subscription.
	ListAllResourceGroups(ctx context.Context) ([]*armresources.ResourceGroup, error)

	// GetResourceGroup retrieves a specific resource group by name and location.
	GetOrCreateResourceGroup(
		ctx context.Context,
		resourceGroupName string,
		location string,
		tags map[string]string,
	) (*armresources.ResourceGroup, error)

	// DestroyResourceGroup deletes the specified resource group.
	DestroyResourceGroup(ctx context.Context, resourceGroupName string) error

	// GetVMExternalIP retrieves the external IP address of a specified VM.
	GetVMExternalIP(
		ctx context.Context,
		vmName string,
		locationData map[string]string,
	) (string, error)

	// DeployTemplate deploys an ARM template to a resource group.
	DeployTemplate(
		ctx context.Context,
		resourceGroupName string,
		deploymentName string,
		template map[string]interface{},
		params map[string]interface{},
		tags map[string]*string,
	) (Pollerer, error)

	// NewSubscriptionListPager returns a new pager for listing subscriptions.
	NewSubscriptionListPager(
		ctx context.Context,
		options *armsubscription.SubscriptionsClientListOptions,
	) *runtime.Pager[armsubscription.SubscriptionsClientListResponse]

	// ListAllResourcesInSubscription lists all resources within a subscription based on provided tags.
	ListAllResourcesInSubscription(
		ctx context.Context,
		subscriptionID string,
		tags map[string]*string,
	) ([]interface{}, error)

	// GetResources retrieves resources based on subscription ID, resource group name, and tags.
	GetResources(
		ctx context.Context,
		subscriptionID string,
		resourceGroupName string,
		tags map[string]*string,
	) ([]interface{}, error)

	// GetVirtualMachine retrieves details of a specific virtual machine.
	GetVirtualMachine(
		ctx context.Context,
		resourceGroupName string,
		vmName string,
	) (*armcompute.VirtualMachine, error)

	// GetNetworkInterface retrieves details of a specific network interface.
	GetNetworkInterface(
		ctx context.Context,
		resourceGroupName string,
		networkInterfaceName string,
	) (*armnetwork.Interface, error)

	// GetPublicIPAddress retrieves the public IP address associated with a network interface.
	GetPublicIPAddress(
		ctx context.Context,
		resourceGroupName string,
		publicIPAddress *armnetwork.PublicIPAddress,
	) (string, error)

	// GetSKUsByLocation retrieves available SKUs in a specific location.
	GetSKUsByLocation(ctx context.Context, location string) ([]armcompute.ResourceSKU, error)

	// ValidateMachineType checks if the specified VM size is available in the given location.
	ValidateMachineType(ctx context.Context, location string, vmSize string) (bool, error)

	// ResourceGroupExists checks if a resource group exists.
	ResourceGroupExists(ctx context.Context, resourceGroupName string) (bool, error)
}

AzureClienter defines the methods that any Azure client must implement. This abstraction allows for easier testing and flexibility in client implementations.

Jump to

Keyboard shortcuts

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