resourceproviders

package
v0.0.0-...-0e4e14f Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderRegistrationsNone     = "none"
	ProviderRegistrationsLegacy   = "legacy"
	ProviderRegistrationsCore     = "core"
	ProviderRegistrationsExtended = "extended"
	ProviderRegistrationsAll      = "all"
)

Variables

View Source
var ErrNoAuthorization = errors.New("authorization failed")

Functions

func CacheSupportedProviders

func CacheSupportedProviders(ctx context.Context, client *providers.ProvidersClient, subscriptionId commonids.SubscriptionId) error

CacheSupportedProviders attempts to retrieve the supported Resource Providers from the Resource Manager API and caches them, for used in enhanced validation

func ClearCache

func ClearCache()

func DetermineWhichRequiredResourceProvidersRequireRegistration

func DetermineWhichRequiredResourceProvidersRequireRegistration(requiredResourceProviders ResourceProviders) (*[]string, error)

DetermineWhichRequiredResourceProvidersRequireRegistration determines which Resource Providers require registration to be able to be used

func EnhancedValidate

func EnhancedValidate(i interface{}, k string) ([]string, []error)

EnhancedValidate returns a validation function which attempts to validate the Resource Provider against the list of Resource Provider supported by this Azure Environment.

NOTE: this is best-effort - if the users offline, or the API doesn't return it we'll fall back to the original approach

func EnsureRegistered

func EnsureRegistered(ctx context.Context, client *providers.ProvidersClient, subscriptionId commonids.SubscriptionId, requiredRPs ResourceProviders) error

EnsureRegistered tries to determine whether all requiredRPs are registered in the subscription, and attempts to register them if it appears they are not. Note that this may fail if a resource provider is not available in the current cloud environment (a warning message will be logged to indicate when a resource provider is not listed).

Types

type ResourceProviders

type ResourceProviders map[string]struct{}

func All

func All() ResourceProviders

All is intended to be a complete set of RPs that might be needed to utilize any functionality in the provider.

func Core

func Core() ResourceProviders

Core is a minimal set of RPs, and will be the default set in a future major version of the provider.

func Extended

func Extended() ResourceProviders

Extended is an expanded set of resource providers, as suggested by the community.

func GetResourceProvidersSet

func GetResourceProvidersSet(input string) (ResourceProviders, error)

func Legacy

func Legacy() ResourceProviders

Legacy is the set of automatically registered RPs from earlier versions of the provider, and is provided for forwards compatibility. This set should not be changed going forward, and will be removed in a future major release.

func (ResourceProviders) Add

func (r ResourceProviders) Add(providers ...string)

func (ResourceProviders) Merge

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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