Documentation ¶
Index ¶
- Variables
- func GetAllCloudDetails() (map[string]*CloudDetails, error)
- func NewAddCloudCommand(cloudMetadataStore CloudMetadataStore) cmd.Command
- func NewAddCredentialCommand() cmd.Command
- func NewDetectCredentialsCommand() cmd.Command
- func NewListCloudsCommand() cmd.Command
- func NewListCredentialsCommand() cmd.Command
- func NewListRegionsCommand() cmd.Command
- func NewRemoveCloudCommand() cmd.Command
- func NewRemoveCredentialCommand() cmd.Command
- func NewSetDefaultCredentialCommand() cmd.Command
- func NewSetDefaultRegionCommand() cmd.Command
- func NewShowCloudCommand() cmd.Command
- func NewShowCredentialCommand() cmd.Command
- func NewUpdateCredentialCommand() cmd.Command
- type AddCloudAPI
- type AddCloudCommand
- type CloudCredential
- type CloudCredentials
- type CloudDetails
- type CloudMetadataStore
- type ControllerCredentials
- type Credential
- type CredentialContent
- type CredentialContentAPI
- type CredentialDetails
- type NamedCredentials
- type RegionDetails
Constants ¶
This section is empty.
Variables ¶
var NewUpdateCloudsCommand = func() cmd.Command {
return newUpdateCloudsCommand()
}
NewUpdateCloudsCommand returns a command to update cloud information.
Functions ¶
func GetAllCloudDetails ¶
func GetAllCloudDetails() (map[string]*CloudDetails, error)
GetAllCloudDetails returns a list of all cloud details.
func NewAddCloudCommand ¶
func NewAddCloudCommand(cloudMetadataStore CloudMetadataStore) cmd.Command
NewAddCloudCommand returns a command to add cloud information.
func NewAddCredentialCommand ¶
NewAddCredentialCommand returns a command to add credential information.
func NewDetectCredentialsCommand ¶
NewDetectCredentialsCommand returns a command to add credential information to credentials.yaml.
func NewListCloudsCommand ¶
NewListCloudsCommand returns a command to list cloud information.
func NewListCredentialsCommand ¶
NewListCredentialsCommand returns a command to list cloud credentials.
func NewListRegionsCommand ¶
NewListRegionsCommand returns a command to list cloud region information.
func NewRemoveCloudCommand ¶
NewRemoveCloudCommand returns a command to remove cloud information.
func NewRemoveCredentialCommand ¶
NewremoveCredentialCommand returns a command to remove a named credential for a cloud.
func NewSetDefaultCredentialCommand ¶
NewSetDefaultCredentialCommand returns a command to set the default credential for a cloud.
func NewSetDefaultRegionCommand ¶
NewSetDefaultRegionCommand returns a command to set the default region for a cloud.
func NewShowCloudCommand ¶
NewShowCloudCommand returns a command to list cloud information.
func NewShowCredentialCommand ¶
NewShowCredentialCommand returns a command to show information about credentials stored on the controller.
func NewUpdateCredentialCommand ¶
NewUpdateCredentialCommand returns a command to update credential details.
Types ¶
type AddCloudAPI ¶
type AddCloudAPI interface { AddCloud(jujucloud.Cloud) error AddCredential(tag string, credential jujucloud.Credential) error Close() error }
AddCloudAPI - Implemented by cloudapi.Client.
type AddCloudCommand ¶
type AddCloudCommand struct { modelcmd.CommandBase // Replace, if true, existing cloud information is overwritten. Replace bool // Cloud is the name fo the cloud to add. Cloud string // CloudFile is the name of the cloud YAML file. CloudFile string // Ping contains the logic for pinging a cloud endpoint to know whether or // not it really has a valid cloud of the same type as the provider. By // default it just calls the correct provider's Ping method. Ping func(p environs.EnvironProvider, endpoint string) error // CloudCallCtx contains context to be used for any cloud calls. CloudCallCtx *context.CloudCallContext // contains filtered or unexported fields }
AddCloudCommand is the command that allows you to add a cloud configuration for use with juju bootstrap.
func (*AddCloudCommand) Info ¶
func (c *AddCloudCommand) Info() *cmd.Info
Info returns help information about the command.
func (*AddCloudCommand) Init ¶
func (c *AddCloudCommand) Init(args []string) (err error)
Init populates the command with the args from the command line.
func (*AddCloudCommand) Run ¶
func (c *AddCloudCommand) Run(ctxt *cmd.Context) error
Run executes the add cloud command, adding a cloud based on a passed-in yaml file or interactive queries.
func (*AddCloudCommand) SetFlags ¶
func (c *AddCloudCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags initializes the flags supported by the command.
type CloudCredential ¶
type CloudCredential struct { // DefaultCredential is the named credential to use by default. DefaultCredential string `json:"default-credential,omitempty" yaml:"default-credential,omitempty"` // DefaultRegion is the cloud region to use by default. DefaultRegion string `json:"default-region,omitempty" yaml:"default-region,omitempty"` // Credentials is the collection of all credentials registered by the user for a cloud, keyed on a cloud name. Credentials map[string]Credential `json:"cloud-credentials,omitempty" yaml:",omitempty,inline"` }
CloudCredential contains attributes used to define credentials for a cloud.
type CloudCredentials ¶
type CloudCredentials map[string]NamedCredentials
type CloudDetails ¶
type CloudDetails struct { Source string `yaml:"defined,omitempty" json:"defined,omitempty"` CloudType string `yaml:"type" json:"type"` CloudDescription string `yaml:"description" json:"description"` AuthTypes []string `yaml:"auth-types,omitempty,flow" json:"auth-types,omitempty"` Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty"` IdentityEndpoint string `yaml:"identity-endpoint,omitempty" json:"identity-endpoint,omitempty"` StorageEndpoint string `yaml:"storage-endpoint,omitempty" json:"storage-endpoint,omitempty"` // Regions is for when we want to print regions in order for yaml output. Regions yaml.MapSlice `yaml:"regions,omitempty" json:"-"` // Regions map is for json marshalling where format is important but not order. RegionsMap map[string]RegionDetails `yaml:"-" json:"regions,omitempty"` Config map[string]interface{} `yaml:"config,omitempty" json:"config,omitempty"` RegionConfig jujucloud.RegionConfig `yaml:"region-config,omitempty" json:"region-config,omitempty"` CACredentials []string `yaml:"ca-credentials,omitempty" json:"ca-credentials,omitempty"` }
CloudDetails holds cloud details.
type CloudMetadataStore ¶
type CloudMetadataStore interface { ParseCloudMetadataFile(path string) (map[string]jujucloud.Cloud, error) ParseOneCloud(data []byte) (jujucloud.Cloud, error) PublicCloudMetadata(searchPaths ...string) (result map[string]jujucloud.Cloud, fallbackUsed bool, _ error) PersonalCloudMetadata() (map[string]jujucloud.Cloud, error) WritePersonalCloudMetadata(cloudsMap map[string]jujucloud.Cloud) error }
type ControllerCredentials ¶
type ControllerCredentials struct {
All CloudCredentials `yaml:"controller-credentials"`
}
type Credential ¶
type Credential struct { // AuthType determines authentication type for the credential. AuthType string `json:"auth-type" yaml:"auth-type"` // Attributes define details for individual credential. // This collection is provider-specific: each provider is interested in different credential details. Attributes map[string]string `json:"details,omitempty" yaml:",omitempty,inline"` // Revoked is true if the credential has been revoked. Revoked bool `json:"revoked,omitempty" yaml:"revoked,omitempty"` // Label is optionally set to describe the credentials to a user. Label string `json:"label,omitempty" yaml:"label,omitempty"` }
Credential instances represent cloud credentials.
type CredentialContent ¶
type CredentialContentAPI ¶
type CredentialDetails ¶
type CredentialDetails struct { Content CredentialContent `yaml:"content"` Models map[string]string `yaml:"models"` }
type NamedCredentials ¶
type NamedCredentials map[string]CredentialDetails
type RegionDetails ¶
type RegionDetails struct { Name string `yaml:"-" json:"-"` Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty"` IdentityEndpoint string `yaml:"identity-endpoint,omitempty" json:"identity-endpoint,omitempty"` StorageEndpoint string `yaml:"storage-endpoint,omitempty" json:"storage-endpoint,omitempty"` }
RegionDetails holds region details.