azure

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 70 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderType defines the Azure provider.
	ProviderType = "azure"
)

Variables

This section is empty.

Functions

func AuthToken

func AuthToken(cloud environscloudspec.CloudSpec, sender autorest.Sender, resourceID string) (*adal.ServicePrincipalToken, string, error)

AuthToken returns a service principal token, suitable for authorizing Resource Manager API requests, based on the supplied CloudSpec.

func NewEnvironProvider

func NewEnvironProvider(config ProviderConfig) (*azureEnvironProvider, error)

NewEnvironProvider returns a new EnvironProvider for Azure.

func NewProvider

func NewProvider(config ProviderConfig) (environs.CloudEnvironProvider, error)

NewProvider instantiates and returns the Azure EnvironProvider using the given configuration.

Types

type AzureCLI

type AzureCLI interface {
	ListAccounts() ([]azurecli.Account, error)
	FindAccountsWithCloudName(name string) ([]azurecli.Account, error)
	ShowAccount(subscription string) (*azurecli.Account, error)
	GetAccessToken(subscription, resource string) (*azurecli.AccessToken, error)
	FindCloudsWithResourceManagerEndpoint(url string) ([]azurecli.Cloud, error)
	ListClouds() ([]azurecli.Cloud, error)
}

type AzureRenderer

type AzureRenderer struct{}

func (AzureRenderer) Render

func (AzureRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error)

type ProviderConfig

type ProviderConfig struct {
	// Sender is the autorest.Sender that will be used by Azure
	// clients. If sender is nil, the default HTTP client sender
	// will be used.
	Sender autorest.Sender

	// RequestInspector will be used to inspect Azure requests
	// if it is non-nil.
	RequestInspector autorest.PrepareDecorator

	// RetryClock is used for retrying some operations, like
	// waiting for deployments to complete.
	//
	// Retries due to rate-limiting are handled by the go-autorest
	// package, which uses "time" directly. We cannot mock the
	// waiting in that case.
	RetryClock clock.Clock

	// RandomWindowsAdminPassword is a function used to generate
	// a random password for the Windows admin user.
	RandomWindowsAdminPassword func() string

	// GneerateSSHKey is a functio nused to generate a new SSH
	// key pair for provisioning Linux machines.
	GenerateSSHKey func(comment string) (private, public string, _ error)

	// ServicePrincipalCreator is the interface used to create service principals.
	ServicePrincipalCreator ServicePrincipalCreator

	// AzureCLI is the interface the to Azure CLI (az) command.
	AzureCLI AzureCLI

	// LoadBalancerSkuName is the load balancer SKU name.
	// Legal values are determined by the Azure SDK.
	LoadBalancerSkuName string
}

ProviderConfig contains configuration for the Azure providers.

func (ProviderConfig) Validate

func (cfg ProviderConfig) Validate() error

Validate validates the Azure provider configuration.

type ServicePrincipalCreator

type ServicePrincipalCreator interface {
	InteractiveCreate(sdkCtx context.Context, stderr io.Writer, params azureauth.ServicePrincipalParams) (appid, spid, password string, _ error)
	Create(sdkCtx context.Context, params azureauth.ServicePrincipalParams) (appid, spid, password string, _ error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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