juju: github.com/juju/juju/provider/azure/internal/azurecli Index | Files

package azurecli

import "github.com/juju/juju/provider/azure/internal/azurecli"

Index

Package Files

az.go

type AccessToken Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (AzureCLI) FindCloudsWithResourceManagerEndpoint Uses

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 Uses

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 Uses

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

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

func (AzureCLI) ListClouds Uses

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

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

func (AzureCLI) ShowAccount Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

type Error struct {
    exec.ExitError
}

Error represents an error returned from the Azure CLI.

func (*Error) Error Uses

func (e *Error) Error() string

Error implements the error interface.

Package azurecli imports 8 packages (graph) and is imported by 3 packages. Updated 2018-07-01. Refresh now. Tools for package owners.