Documentation ¶
Index ¶
- type AccessToken
- type Account
- type AzureCLI
- func (a AzureCLI) FindAccountsWithCloudName(name string) ([]Account, error)
- func (a AzureCLI) FindCloudsWithResourceManagerEndpoint(url string) ([]Cloud, error)
- func (a AzureCLI) GetAccessToken(subscription, resource string) (*AccessToken, error)
- func (a AzureCLI) ListAccounts() ([]Account, error)
- func (a AzureCLI) ListClouds() ([]Cloud, error)
- func (a AzureCLI) ShowAccount(subscription string) (*Account, error)
- func (a AzureCLI) ShowCloud(name string) (*Cloud, error)
- type Cloud
- type CloudEndpoints
- type CloudSuffixes
- type Error
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 ¶
FindAccountsWithCloudName returns the details for all accounts with the given cloud name..
func (AzureCLI) FindCloudsWithResourceManagerEndpoint ¶
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 ¶
ListAccounts returns the details for all accounts available in the Azure CLI.
func (AzureCLI) ListClouds ¶
ListClouds returns the details for all clouds available in the Azure CLI.
func (AzureCLI) ShowAccount ¶
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.
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.