utils

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractParentResourceNameFromID added in v0.1.20

func ExtractParentResourceNameFromID(resourceID string) string

ExtractParentResourceNameFromID extracts the parent resource name from an Azure resource ID. This is useful for nested resources like subnets, where you need the VNet name. For a subnet ID like: /subscriptions/.../virtualNetworks/{vnetName}/subnets/{subnetName} This returns {vnetName}

func ExtractResourceNameFromID added in v0.1.20

func ExtractResourceNameFromID(resourceID string) string

ExtractResourceNameFromID extracts the resource name from an Azure resource ID. Azure resource IDs have the format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{namespace}/{resourceType}/{resourceName}

func GetPowerState

func GetPowerState(states []*armcompute.InstanceViewStatus) string

GetPowerState returns the power state of a Virtual Machine by looking up the provided states.

func GetResourceGroupsFromDB

func GetResourceGroupsFromDB(ctx context.Context) ([]models.ResourceGroup, error)

GetResourceGroupsFromDB returns the models.ResourceGroup from the database.

func GetStorageAccountsFromDB

func GetStorageAccountsFromDB(ctx context.Context) ([]models.StorageAccount, error)

GetStorageAccountsFromDB returns the models.StorageAccount from the database.

func GetVPCsFromDB

func GetVPCsFromDB(ctx context.Context) ([]models.VPC, error)

GetVPCsFromDB returns the models.VPC from the database.

func MaybeSkipRetry

func MaybeSkipRetry(err error) error

MaybeSkipRetry wraps known "good" Azure errors with asynq.SkipRetry, so that the tasks from which these errors originate from won't be retried.

Types

This section is empty.

Jump to

Keyboard shortcuts

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