azure

package
v0.0.0-...-980806f Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FutureOperationSucceeded string = "Succeeded"
	FutureOperationDeleting  string = "Deleting"
)
View Source
const (
	// Azure tags used to identify the Kyma runtime
	TagSubAccountID = "SubAccountID"
	TagInstanceID   = "InstanceID"
	TagOperationID  = "OperationID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewAzureClient

func NewAzureClient(namespaceClient eventhub.NamespacesClient, resourceGroupClient resources.GroupsClient, logger logrus.FieldLogger) *Client

func (*Client) CreateNamespace

func (nc *Client) CreateNamespace(ctx context.Context, azureCfg *Config, groupName, namespace string, tags Tags) (*eventhub.EHNamespace, error)

func (*Client) CreateResourceGroup

func (nc *Client) CreateResourceGroup(ctx context.Context, config *Config, name string, tags Tags) (resources.Group, error)

func (*Client) DeleteResourceGroup

func (nc *Client) DeleteResourceGroup(ctx context.Context, tags Tags) (resources.GroupsDeleteFuture, error)

func (*Client) GetEventhubAccessKeys

func (nc *Client) GetEventhubAccessKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result eventhub.AccessKeys, err error)

func (*Client) GetResourceGroup

func (nc *Client) GetResourceGroup(ctx context.Context, tags Tags) (resources.Group, error)

GetResourceGroup gets the resource group by tags. If more than one resource group is found, it is treated as an error.

type Config

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

func GetConfig

func GetConfig(clientID, clientSecret, tenantID, subscriptionID, location string) (*Config, error)

func GetConfigFromHAPCredentialsAndProvisioningParams

func GetConfigFromHAPCredentialsAndProvisioningParams(credentials hyperscaler.Credentials, parameters internal.ProvisioningParameters) (*Config, error)

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) Environment

func (c *Config) Environment() (*azure.Environment, error)

func (*Config) GetLocation

func (c *Config) GetLocation() string

type HyperscalerProvider

type HyperscalerProvider interface {
	GetClient(config *Config, logger logrus.FieldLogger) (Interface, error)
}

func NewAzureProvider

func NewAzureProvider() HyperscalerProvider

type Interface

type Interface interface {
	GetEventhubAccessKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result eventhub.AccessKeys, err error)
	CreateResourceGroup(ctx context.Context, config *Config, name string, tags Tags) (resources.Group, error)
	CreateNamespace(ctx context.Context, azureCfg *Config, groupName, namespace string, tags Tags) (*eventhub.EHNamespace, error)
	GetResourceGroup(ctx context.Context, tags Tags) (resources.Group, error)
	DeleteResourceGroup(ctx context.Context, tags Tags) (resources.GroupsDeleteFuture, error)
}

type ResourceGroupDoesNotExistError

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

func NewResourceGroupDoesNotExist

func NewResourceGroupDoesNotExist(errorMessage string) ResourceGroupDoesNotExistError

func (ResourceGroupDoesNotExistError) Error

type Tags

type Tags map[string]*string

Tags type represents Azure tags acceptable by the Azure client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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