azurecli

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	AccessToken  string `json:"accessToken"`
	ExpiresOn    string `json:"expiresOn"`
	Subscription string `json:"subscription"`
	Tenant       string `json:"tenant"`
	TokenType    string `json:"tokenType"`
}

AccessToken contains the result of the GetAccessToken function.

func (AccessToken) Token

func (t AccessToken) Token() *adal.Token

Token creates an adal.Token from the AccessToken. This token can be used with go-autorest to access azure endpoints.

type Account

type Account struct {
	CloudName string `json:"cloudName"`
	ID        string `json:"id"`
	IsDefault bool   `json:"isDefault"`
	Name      string `json:"name"`
	State     string `json:"state"`
	TenantId  string `json:"tenantId"`
}

Account contains details of an azure account (subscription).

type AzureCLI

type AzureCLI struct {
	// Exec is a function that executes system commands and returns
	// the output. If this is nil then a default implementation using
	// os.exec will be used.
	Exec func(cmd string, args []string) (stdout []byte, err error)
}

AzureCLI

func (AzureCLI) FindAccountsWithCloudName

func (a AzureCLI) FindAccountsWithCloudName(name string) ([]Account, error)

FindAccountsWithCloudName returns the details for all accounts with the given cloud name..

func (AzureCLI) FindCloudsWithResourceManagerEndpoint

func (a AzureCLI) FindCloudsWithResourceManagerEndpoint(url string) ([]Cloud, error)

FindCloudsWithResourceManagerEndpoint returns a list of clouds which use the given url for it's resource manager endpoint.

func (AzureCLI) GetAccessToken

func (a AzureCLI) GetAccessToken(subscription, resource string) (*AccessToken, error)

GetAccessToken gets an access token from the Azure CLI to access the given resource using the given subscription. Either subscription or resource may be empty in which case the default from the az application are used.

func (AzureCLI) ListAccounts

func (a AzureCLI) ListAccounts() ([]Account, error)

ListAccounts returns the details for all accounts available in the Azure CLI.

func (AzureCLI) ListClouds

func (a AzureCLI) ListClouds() ([]Cloud, error)

ListClouds returns the details for all clouds available in the Azure CLI.

func (AzureCLI) ShowAccount

func (a AzureCLI) ShowAccount(subscription string) (*Account, error)

ShowAccount returns the account details for the account with the given subscription ID. If the subscription is empty then the default Azure CLI account is returned.

func (AzureCLI) ShowCloud

func (a AzureCLI) ShowCloud(name string) (*Cloud, error)

ShowCloud returns the details of the cloud with the given name. If the name is empty then the details of the default cloud will be returned.

type Cloud

type Cloud struct {
	Endpoints CloudEndpoints `json:"endpoints"`
	IsActive  bool           `json:"isActive"`
	Name      string         `json:"name"`
	Profile   string         `json:"profile"`
	Suffixes  CloudSuffixes  `json:"suffixes"`
}

Cloud contains details of a cloud configured in the Azure CLI.

type CloudEndpoints

type CloudEndpoints struct {
	ActiveDirectory                string `json:"activeDirectory"`
	ActiveDirectoryGraphResourceID string `json:"activeDirectoryGraphResourceId"`
	ActiveDirectoryResourceID      string `json:"activeDirectoryResourceId"`
	BatchResourceID                string `json:"batchResourceId"`
	Management                     string `json:"management"`
	ResourceManager                string `json:"resourceManager"`
	SQLManagement                  string `json:"sqlManagement"`
}

CloudEndpoints contains the endpoints used by a cloud.

type CloudSuffixes

type CloudSuffixes struct {
	AzureDatalakeAnalyticsCatalogAndJobEndpoint string `json:"azureDatalakeAnalyticsCatalogAndJobEndpoint"`
	AzureDatalakeStoreFileSystemEndpoint        string `json:"azureDatalakeStoreFileSystemEndpoint"`
	KeyvaultDNS                                 string `json:"keyvaultDns"`
	SQLServerHostname                           string `json:"sqlServerHostname"`
	StorageEndpoint                             string `json:"storageEndpoint"`
}

CloudSuffixes contains the suffixes used with a cloud.

type Error

type Error struct {
	exec.ExitError
}

Error represents an error returned from the Azure CLI.

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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