azure_client

package
v0.0.0-...-f131573 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RESOURCE_GROUP_NAME_PREFIX  = "cloud-foundry-"
	STORAGE_ACCOUNT_NAME_PREFIX = "cf"
	CONTAINER_NAME_PREFIX       = "cloud-foundry-"
	LOCATION                    = "westus"
)

Variables

View Source
var (
	ErrNotFoundSubscriptionID = errors.New("No subscriptionID provided in environment variables")
	ErrNotFoundTenantID       = errors.New("No tenantID provided in environment variables")
	ErrNotFoundClientID       = errors.New("No clientID provided in environment variables")
	ErrNotFoundClientSecret   = errors.New("No clientSecret provided in environment variables")
)

Functions

func LoadAzureCredentials

func LoadAzureCredentials() (map[string]string, error)

LoadAzureCredentials reads credentials from environment variables

func NewServicePrincipalTokenFromCredentials

func NewServicePrincipalTokenFromCredentials(c map[string]string, scope string) (*azure.ServicePrincipalToken, error)

NewServicePrincipalTokenFromCredentials creates a new ServicePrincipalToken using values of the passed credentials map.

Types

type AzureClient

type AzureClient struct {
	ResourceManagementClient *resources.ResourceGroupsClient
	StorageAccountsClient    *storage.StorageAccountsClient
}

func NewClient

func NewClient() *AzureClient

func (*AzureClient) CreateInstance

func (c *AzureClient) CreateInstance(instanceId string, parameters interface{}) (string, string, error)

func (*AzureClient) DeleteInstance

func (c *AzureClient) DeleteInstance(resourceGroupName, storageAccountName string) error

func (*AzureClient) GetAccessKeys

func (c *AzureClient) GetAccessKeys(instanceId, resourceGroupName, storageAccountName string, containerAccessType storageclient.ContainerAccessType) (string, string, string, error)

func (*AzureClient) GetInstanceState

func (c *AzureClient) GetInstanceState(resourceGroupName, storageAccountName string) (storage.ProvisioningState, error)

func (*AzureClient) RegenerateAccessKeys

func (c *AzureClient) RegenerateAccessKeys(resourceGroupName, storageAccountName string) error

type Client

type Client interface {
	CreateInstance(instanceId string, parameters interface{}) (string, string, error)
	GetInstanceState(resourceGroupName, storageAccountName string) (storage.ProvisioningState, error)
	GetAccessKeys(resourceGroupName, storageAccountName, containerName string, containerAccessType storageclient.ContainerAccessType) (string, string, string, error)
	DeleteInstance(resourceGroupName, storageAccountName string) error
	RegenerateAccessKeys(resourceGroupName, storageAccountName string) error
}

Jump to

Keyboard shortcuts

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