azurecli

package
v0.0.0-...-6dcaeb9 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 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 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"`
	HomeTenantId string `json:"homeTenantId"`
}

Account contains details of an azure account (subscription).

func (*Account) AuthTenantId

func (a *Account) AuthTenantId() string

AuthTenantId returns the home tenant if set, else the tenant.

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) 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 {
	IsActive bool   `json:"isActive"`
	Name     string `json:"name"`
	Profile  string `json:"profile"`
}

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

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