juju: github.com/juju/juju/apiserver/common/credentialcommon Index | Files

package credentialcommon

import "github.com/juju/juju/apiserver/common/credentialcommon"

Index

Package Files

backend.go cloudcredential.go modelcredential.go

func ValidateExistingModelCredential Uses

func ValidateExistingModelCredential(backend PersistentBackend, callCtx context.ProviderCallContext) (params.ErrorResults, error)

ValidateExistingModelCredential checks if the cloud credential that a given model uses is valid for it.

func ValidateNewModelCredential Uses

func ValidateNewModelCredential(backend PersistentBackend, callCtx context.ProviderCallContext, credentialTag names.CloudCredentialTag, credential *cloud.Credential) (params.ErrorResults, error)

ValidateNewModelCredential checks if a new cloud credential could be valid for a given model.

type CloudProvider Uses

type CloudProvider interface {
    // AllInstances returns all instances currently known to the cloud provider.
    AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error)
}

CloudProvider defines methods needed from the cloud provider to perform the check.

type ControllerConfig Uses

type ControllerConfig interface {
    ControllerUUID() string
}

ControllerConfig defines methods needed from the cloud provider to perform the check.

type CredentialManagerAPI Uses

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

func NewCredentialManagerAPI Uses

func NewCredentialManagerAPI(backend StateBackend) *CredentialManagerAPI

NewCredentialManagerAPI creates new model credential manager api endpoint.

func (*CredentialManagerAPI) InvalidateModelCredential Uses

func (api *CredentialManagerAPI) InvalidateModelCredential(args params.InvalidateCredentialArg) (params.ErrorResult, error)

InvalidateModelCredential marks the cloud credential for this model as invalid.

type Machine Uses

type Machine interface {
    // IsManual returns true if the machine was manually provisioned.
    IsManual() (bool, error)

    // IsContainer returns true if the machine is a container.
    IsContainer() bool

    // InstanceId returns the provider specific instance id for this
    // machine, or a NotProvisionedError, if not set.
    InstanceId() (instance.Id, error)

    // Id returns the machine id.
    Id() string
}

Machine defines machine methods needed for the check.

type Model Uses

type Model interface {
    // Cloud returns the name of the cloud to which the model is deployed.
    Cloud() string

    // CloudRegion returns the name of the cloud region to which the model is deployed.
    CloudRegion() string

    // Config returns the config for the model.
    Config() (*config.Config, error)

    // ValidateCloudCredential validates new cloud credential for this model.
    ValidateCloudCredential(tag names.CloudCredentialTag, credential cloud.Credential) error

    // Type returns the type of the model.
    Type() state.ModelType

    // CloudCredential returns the tag of the cloud credential used for managing the
    // model's cloud resources, and a boolean indicating whether a credential is set.
    CloudCredential() (names.CloudCredentialTag, bool)
}

Model defines model methods needed for the check.

type PersistentBackend Uses

type PersistentBackend interface {
    // Model returns the model entity.
    Model() (Model, error)

    // Cloud returns the controller's cloud definition.
    Cloud(name string) (cloud.Cloud, error)

    // CloudCredential returns the cloud credential for the given tag.
    CloudCredential(tag names.CloudCredentialTag) (state.Credential, error)

    // AllMachines returns all machines in the model.
    AllMachines() ([]Machine, error)

    // ControllerConfig returns controller config.
    ControllerConfig() (ControllerConfig, error)
}

PersistentBackend defines persisted entities that are accessed during credential validity check.

func NewPersistentBackend Uses

func NewPersistentBackend(p *state.State) PersistentBackend

NewPersistentBackend creates a credential validity backend to use, based on state.State.

type StateBackend Uses

type StateBackend interface {
    InvalidateModelCredential(reason string) error
}

StateBackend exposes State methods needed by credential manager.

Package credentialcommon imports 13 packages (graph) and is imported by 4 packages. Updated 2019-08-23. Refresh now. Tools for package owners.