juju: github.com/wallyworld/juju/cmd/juju/cloud Index | Files

package cloud

import "github.com/wallyworld/juju/cmd/juju/cloud"

Index

Package Files

add.go addcredential.go defaultcredential.go defaultregion.go detectcredentials.go list.go listcredentials.go regions.go remove.go removecredential.go show.go showcredential.go updatecloud.go updatecredential.go updatepublicclouds.go

Variables

var FetchAndMaybeUpdatePublicClouds = func(access PublicCloudsAccessDetails, updateClient bool) (map[string]jujucloud.Cloud, string, error) {
    var msg string
    publishedClouds, err := PublishedPublicClouds(access.publicCloudURL, access.publicSigningKey)
    if err != nil {
        return nil, msg, errors.Trace(err)
    }
    if updateClient {
        if msg, err = updateClientCopy(publishedClouds); err != nil {
            return publishedClouds, msg, err
        }
    }
    return publishedClouds, msg, nil
}

FetchAndMaybeUpdatePublicClouds gets published public clouds information and updates client copy of public clouds if desired. This call returns discovered public clouds and a user-facing message whether they are different with what was known prior to the call. Since this call can also update a client copy of clouds, it is possible that the public clouds have been retrieved but the client update fail. In this case, we still return public clouds as well as the client error.

var NewUpdateCloudCommand = func(cloudMetadataStore CloudMetadataStore) cmd.Command {
    return newUpdateCloudCommand(cloudMetadataStore)
}

NewUpdateCloudCommand returns a command to update cloud information.

var NewUpdatePublicCloudsCommand = func() cmd.Command {
    return newUpdatePublicCloudsCommand()
}

NewUpdatePublicCloudsCommand returns a command to update cloud information.

func GetAllCloudDetails Uses

func GetAllCloudDetails(store jujuclient.CredentialGetter) (map[string]*CloudDetails, error)

GetAllCloudDetails returns a list of all cloud details.

func NewAddCloudCommand Uses

func NewAddCloudCommand(cloudMetadataStore CloudMetadataStore) cmd.Command

NewAddCloudCommand returns a command to add cloud information.

func NewAddCredentialCommand Uses

func NewAddCredentialCommand() cmd.Command

NewAddCredentialCommand returns a command to add credential information.

func NewDetectCredentialsCommand Uses

func NewDetectCredentialsCommand() cmd.Command

NewDetectCredentialsCommand returns a command to add credential information to credentials.yaml.

func NewListCloudsCommand Uses

func NewListCloudsCommand() cmd.Command

NewListCloudsCommand returns a command to list cloud information.

func NewListCredentialsCommand Uses

func NewListCredentialsCommand() cmd.Command

NewListCredentialsCommand returns a command to list cloud credentials.

func NewListRegionsCommand Uses

func NewListRegionsCommand() cmd.Command

NewListRegionsCommand returns a command to list cloud region information.

func NewRemoveCloudCommand Uses

func NewRemoveCloudCommand() cmd.Command

NewRemoveCloudCommand returns a command to remove cloud information.

func NewRemoveCredentialCommand Uses

func NewRemoveCredentialCommand() cmd.Command

NewRemoveCredentialCommand returns a command to remove a named credential for a cloud.

func NewSetDefaultCredentialCommand Uses

func NewSetDefaultCredentialCommand() cmd.Command

NewSetDefaultCredentialCommand returns a command to set the default credential for a cloud.

func NewSetDefaultRegionCommand Uses

func NewSetDefaultRegionCommand() cmd.Command

NewSetDefaultRegionCommand returns a command to set the default region for a cloud.

func NewShowCloudCommand Uses

func NewShowCloudCommand() cmd.Command

NewShowCloudCommand returns a command to list cloud information.

func NewShowCredentialCommand Uses

func NewShowCredentialCommand() cmd.Command

NewShowCredentialCommand returns a command to show information about credentials stored on the controller.

func NewUpdateCredentialCommand Uses

func NewUpdateCredentialCommand() cmd.Command

NewUpdateCredentialCommand returns a command to update credential details.

func PublishedPublicClouds Uses

func PublishedPublicClouds(url, key string) (map[string]jujucloud.Cloud, error)

type AddCloudAPI Uses

type AddCloudAPI interface {
    AddCloud(jujucloud.Cloud, bool) error
    AddCredential(tag string, credential jujucloud.Credential) error
    Close() error
}

AddCloudAPI - Implemented by cloudapi.Client.

type AddCloudCommand Uses

type AddCloudCommand struct {
    modelcmd.OptionalControllerCommand

    // Replace, if true, existing cloud information is overwritten.
    // TODO (anastasiamac 2019-6-4) Remove as redundant and unsupported for Juju 3.
    Replace bool

    // Cloud is the name of 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

    // Force holds whether user wants to force addition of the cloud.
    Force bool
    // 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 Uses

func (c *AddCloudCommand) Info() *cmd.Info

Info returns help information about the command.

func (*AddCloudCommand) Init Uses

func (c *AddCloudCommand) Init(args []string) (err error)

Init populates the command with the args from the command line.

func (*AddCloudCommand) Run Uses

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 Uses

func (c *AddCloudCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags initializes the flags supported by the command.

type CloudCredential Uses

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 Uses

type CloudCredentials map[string]NamedCredentials

type CloudDetails Uses

type CloudDetails struct {
    Source           string   `yaml:"defined,omitempty" json:"defined,omitempty"`
    CloudType        string   `yaml:"type" json:"type"`
    CloudDescription string   `yaml:"description,omitempty" json:"description,omitempty"`
    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"`
    // DefaultRegion is a default region as known to this client.
    DefaultRegion string `yaml:"default-region,omitempty" json:"default-region,omitempty"`
    // CredentialCount contains the number of credentials that exist for this cloud on this client.
    CredentialCount int `yaml:"credential-count,omitempty" json:"credential-count,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 CloudFileReader Uses

type CloudFileReader struct {
    CloudMetadataStore CloudMetadataStore
    CloudName          string
    // contains filtered or unexported fields
}

CloudFileReader defines a struct used to read a cloud definition from a file.

func (*CloudFileReader) ReadCloudFromFile Uses

func (p *CloudFileReader) ReadCloudFromFile(cloudFile string, ctxt *cmd.Context) (*jujucloud.Cloud, error)

ReadCloudFromFile reads the cloud definition from the specified file.

type CloudMetadataStore Uses

type CloudMetadataStore interface {
    ReadCloudData(path string) ([]byte, error)
    ParseOneCloud(data []byte) (jujucloud.Cloud, error)
    PublicCloudMetadata(searchPaths ...string) (result map[string]jujucloud.Cloud, fallbackUsed bool, _ error)
    PersonalCloudMetadataStore
}

type CloudRegionsAPI Uses

type CloudRegionsAPI interface {
    Cloud(tag names.CloudTag) (jujucloud.Cloud, error)
    Close() error
}

type ControllerCredentials Uses

type ControllerCredentials struct {
    Controller CloudCredentials `yaml:"controller-credentials,omitempty"`
    Client     CloudCredentials `yaml:"client-credentials,omitempty"`
}

type Credential Uses

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 CredentialAPI Uses

type CredentialAPI interface {
    Clouds() (map[names.CloudTag]jujucloud.Cloud, error)
    AddCloudsCredentials(cloudCredentials map[string]jujucloud.Credential) ([]params.UpdateCredentialResult, error)
    UpdateCloudsCredentials(cloudCredentials map[string]jujucloud.Credential, force bool) ([]params.UpdateCredentialResult, error)
    BestAPIVersion() int
    Close() error
}

type CredentialContent Uses

type CredentialContent struct {
    AuthType   string            `yaml:"auth-type"`
    Validity   string            `yaml:"validity-check,omitempty"`
    Attributes map[string]string `yaml:",inline"`
}

type CredentialContentAPI Uses

type CredentialContentAPI interface {
    CredentialContents(cloud, credential string, withSecrets bool) ([]params.CredentialContentResult, error)
    BestAPIVersion() int
    Close() error
}

type CredentialDetails Uses

type CredentialDetails struct {
    Content CredentialContent `yaml:"content"`
    Models  map[string]string `yaml:"models,omitempty"`
}

type FoundRegions Uses

type FoundRegions struct {
    Local  interface{} `yaml:"client-cloud-regions,omitempty" json:"client-cloud-regions,omitempty"`
    Remote interface{} `yaml:"controller-cloud-regions,omitempty" json:"controller-cloud-regions,omitempty"`
}

func (*FoundRegions) IsEmpty Uses

func (f *FoundRegions) IsEmpty() bool

type ListCloudsAPI Uses

type ListCloudsAPI interface {
    Clouds() (map[names.CloudTag]jujucloud.Cloud, error)
    Close() error
}

type ListCredentialsAPI Uses

type ListCredentialsAPI interface {
    CredentialContents(cloud, credential string, withSecrets bool) ([]params.CredentialContentResult, error)
    Close() error
}

type NamedCredentials Uses

type NamedCredentials map[string]CredentialDetails

type PersonalCloudMetadataStore Uses

type PersonalCloudMetadataStore interface {
    PersonalCloudMetadata() (map[string]jujucloud.Cloud, error)
    WritePersonalCloudMetadata(cloudsMap map[string]jujucloud.Cloud) error
}

type PublicCloudsAccessDetails Uses

type PublicCloudsAccessDetails struct {
    // contains filtered or unexported fields
}

func PublicCloudsAccess Uses

func PublicCloudsAccess() PublicCloudsAccessDetails

PublicCloudsAccess contains information about where to find published public clouds details.

type RegionDetails Uses

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.

type RemoveCredentialAPI Uses

type RemoveCredentialAPI interface {
    // Clouds returns all remote clouds that the currently logged-in user can access.
    Clouds() (map[names.CloudTag]jujucloud.Cloud, error)
    // RevokeCredential removes remote credential.
    RevokeCredential(tag names.CloudCredentialTag, force bool) error
    // BestAPIVersion returns current best api version.
    BestAPIVersion() int
    // Close closes api client.
    Close() error
}

RemoveCredentialAPI defines api Cloud facade that can remove a remote credential.

Package cloud imports 34 packages (graph). Updated 2020-07-07. Refresh now. Tools for package owners.