connection

package
v0.0.0-...-71e82b1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Azure

type Azure interface {
	IsCloudAvailable() error
	GetResourceGroupByName(name string) (resources.Group, error)
	CreateStorageAccount(accountName, accountGroupName string, tags map[string]*string, httpsOnly bool, networkRuleSet *storage.NetworkRuleSet) (storage.Account, error)
	DeleteStorageAccount(resourceGroupName, accountName string) error
}

Azure interface defining all azure methods

type AzureConnection

type AzureConnection struct {
	ResourceGroup  *AzureResourceGroup  // Client obj to interact with Azure Resource Groups
	StorageAccount *AzureStorageAccount // Client obj to interact with Azure Storage Accounts
	// contains filtered or unexported fields
}

AzureConnection simplifies the connection with cloud provider

func NewAzureConnection

func NewAzureConnection(c context.Context, subscriptionID, tenantID, clientID, clientSecret string) (azConn *AzureConnection)

NewAzureConnection provides a singleton instance of AzureConnection. Initializes all internal clients to interact with Azure.

func (*AzureConnection) CreateStorageAccount

func (az *AzureConnection) CreateStorageAccount(accountName, accountGroupName string, tags map[string]*string, httpsOnly bool, networkRuleSet *storage.NetworkRuleSet) (storage.Account, error)

CreateStorageAccount creates a storage account

func (*AzureConnection) DeleteStorageAccount

func (az *AzureConnection) DeleteStorageAccount(resourceGroupName, accountName string) error

DeleteStorageAccount deletes a storage account

func (*AzureConnection) GetResourceGroupByName

func (az *AzureConnection) GetResourceGroupByName(name string) (resources.Group, error)

GetResourceGroupByName returns an existing Resource Group by name

func (*AzureConnection) IsCloudAvailable

func (az *AzureConnection) IsCloudAvailable() error

IsCloudAvailable verifies that the connection instantiation did not report a failure

type AzureCredentials

type AzureCredentials struct {
	SubscriptionID, ClientID, TenantID, ClientSecret string
	Authorizer                                       autorest.Authorizer
}

AzureCredentials ...

type AzureResourceGroup

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

AzureResourceGroup ...

func NewResourceGroup

func NewResourceGroup(c context.Context, creds AzureCredentials) (rg *AzureResourceGroup, err error)

NewResourceGroup provides a new instance of AzureResourceGroup

func (*AzureResourceGroup) Get

func (rg *AzureResourceGroup) Get(name string) (resources.Group, error)

Get an existing Resource Group by name

type AzureStorageAccount

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

AzureStorageAccount ...

func NewStorageAccount

func NewStorageAccount(c context.Context, creds AzureCredentials) (sa *AzureStorageAccount, err error)

NewStorageAccount provides a new instance of AzureStorageAccount

func (*AzureStorageAccount) Create

func (sa *AzureStorageAccount) Create(accountName, accountGroupName string, tags map[string]*string, httpsOnly bool, networkRuleSet *storage.NetworkRuleSet) (storage.Account, error)

Create starts creation of a new Storage Account and waits for the account to be created.

func (*AzureStorageAccount) Delete

func (sa *AzureStorageAccount) Delete(resourceGroupName, accountName string) error

Delete deletes a storage account given the resource group and account name

Jump to

Keyboard shortcuts

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