juju: github.com/juju/juju/apiserver/facades/client/cloud Index | Files

package cloud

import "github.com/juju/juju/apiserver/facades/client/cloud"

Package cloud defines an API end point for functions dealing with the controller's cloud definition, and cloud credentials.

Index

Package Files

backend.go cloud.go instance_information.go

func ChangeCloudAccess Uses

func ChangeCloudAccess(backend Backend, cloud string, targetUserTag names.UserTag, action params.CloudAction, access permission.Access) error

ChangeCloudAccess performs the requested access grant or revoke action for the specified user on the cloud.

type Backend Uses

type Backend interface {
    state.CloudAccessor

    ControllerTag() names.ControllerTag
    Model() (Model, error)
    ModelConfig() (*config.Config, error)
    User(tag names.UserTag) (User, error)

    CloudCredentials(user names.UserTag, cloudName string) (map[string]state.Credential, error)
    UpdateCloudCredential(names.CloudCredentialTag, cloud.Credential) error
    RemoveCloudCredential(names.CloudCredentialTag) error
    AddCloud(cloud.Cloud, string) error
    UpdateCloud(cloud.Cloud) error
    RemoveCloud(string) error
    AllCloudCredentials(user names.UserTag) ([]state.Credential, error)
    CredentialModelsAndOwnerAccess(tag names.CloudCredentialTag) ([]state.CredentialOwnerModelAccess, error)
    CredentialModels(tag names.CloudCredentialTag) (map[string]string, error)
    RemoveModelsCredential(tag names.CloudCredentialTag) error

    ControllerConfig() (controller.Config, error)
    ControllerInfo() (*state.ControllerInfo, error)
    GetCloudAccess(cloud string, user names.UserTag) (permission.Access, error)
    GetCloudUsers(cloud string) (map[string]permission.Access, error)
    CreateCloudAccess(cloud string, user names.UserTag, access permission.Access) error
    UpdateCloudAccess(cloud string, user names.UserTag, access permission.Access) error
    RemoveCloudAccess(cloud string, user names.UserTag) error
    CloudsForUser(user names.UserTag, all bool) ([]state.CloudInfo, error)
}

func NewStateBackend Uses

func NewStateBackend(st *state.State) Backend

type CloudAPI Uses

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

CloudAPI implements the cloud interface and is the concrete implementation of the api end point.

func NewCloudAPI Uses

func NewCloudAPI(backend, ctlrBackend Backend, pool ModelPoolBackend, authorizer facade.Authorizer, callCtx environscontext.ProviderCallContext) (*CloudAPI, error)

NewCloudAPI creates a new API server endpoint for managing the controller's cloud definition and cloud credentials.

func NewFacadeV6 Uses

func NewFacadeV6(context facade.Context) (*CloudAPI, error)

NewFacadeV6 is used for API registration.

func (*CloudAPI) AddCloud Uses

func (api *CloudAPI) AddCloud(cloudArgs params.AddCloudArgs) error

AddCloud adds a new cloud, different from the one managed by the controller.

func (*CloudAPI) AddCredentials Uses

func (api *CloudAPI) AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)

AddCredentials adds new credentials. In contrast to UpdateCredentials() below, the new credentials can be for a cloud that the controller does not manage (this is required for CAAS models)

func (*CloudAPI) CheckCredentialsModels Uses

func (api *CloudAPI) CheckCredentialsModels(args params.TaggedCredentials) (params.UpdateCredentialResults, error)

CheckCredentialsModels validates supplied cloud credentials' content against models that currently use these credentials. If there are any models that are using a credential and these models or their cloud instances are not going to be accessible with corresponding credential, there will be detailed validation errors per model.

func (*CloudAPI) Cloud Uses

func (api *CloudAPI) Cloud(args params.Entities) (params.CloudResults, error)

Cloud returns the cloud definitions for the specified clouds.

func (*CloudAPI) CloudInfo Uses

func (api *CloudAPI) CloudInfo(args params.Entities) (params.CloudInfoResults, error)

CloudInfo returns information about the specified clouds.

func (*CloudAPI) Clouds Uses

func (api *CloudAPI) Clouds() (params.CloudsResult, error)

Clouds returns the definitions of all clouds supported by the controller that the logged in user can see.

func (*CloudAPI) Credential Uses

func (api *CloudAPI) Credential(args params.Entities) (params.CloudCredentialResults, error)

Credential returns the specified cloud credential for each tag, minus secrets.

func (*CloudAPI) CredentialContents Uses

func (api *CloudAPI) CredentialContents(args params.CloudCredentialArgs) (params.CredentialContentResults, error)

CredentialContents returns the specified cloud credentials, including the secrets if requested. If no specific credential name/cloud was passed in, all credentials for this user are returned. Only credential owner can see its contents as well as what models use it. Controller admin has no special superpowers here and is treated the same as all other users.

func (*CloudAPI) DefaultCloud Uses

func (*CloudAPI) DefaultCloud(_, _ struct{})

DefaultCloud is gone in V5.

func (*CloudAPI) InstanceTypes Uses

func (api *CloudAPI) InstanceTypes(cons params.CloudInstanceTypesConstraints) (params.InstanceTypesResults, error)

InstanceTypes returns instance type information for the cloud and region in which the current model is deployed.

func (*CloudAPI) ListCloudInfo Uses

func (api *CloudAPI) ListCloudInfo(req params.ListCloudsRequest) (params.ListCloudInfoResults, error)

ListCloudInfo returns clouds that the specified user has access to. Controller admins (superuser) can list clouds for any user. Other users can only ask about their own clouds.

func (*CloudAPI) ModifyCloudAccess Uses

func (c *CloudAPI) ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)

ModifyCloudAccess changes the model access granted to users.

func (*CloudAPI) RemoveClouds Uses

func (api *CloudAPI) RemoveClouds(args params.Entities) (params.ErrorResults, error)

RemoveClouds removes the specified clouds from the controller. If a cloud is in use (has models deployed to it), the removal will fail.

func (*CloudAPI) RevokeCredentials Uses

func (*CloudAPI) RevokeCredentials(_, _ struct{})

Mask out old methods from the new API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

RevokeCredentials was dropped in V3, replaced with RevokeCredentialsCheckModel.

func (*CloudAPI) RevokeCredentialsCheckModels Uses

func (api *CloudAPI) RevokeCredentialsCheckModels(args params.RevokeCredentialArgs) (params.ErrorResults, error)

RevokeCredentialsCheckModels revokes a set of cloud credentials. If the credentials are used by any of the models, the credential deletion will be aborted. If credential-in-use needs to be revoked nonetheless, this method allows the use of force.

func (*CloudAPI) UpdateCloud Uses

func (api *CloudAPI) UpdateCloud(cloudArgs params.UpdateCloudArgs) (params.ErrorResults, error)

UpdateCloud updates an existing cloud that the controller knows about.

func (*CloudAPI) UpdateCredentials Uses

func (*CloudAPI) UpdateCredentials(_, _ struct{})

Mask out old methods from the new API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned. UpdateCredentials was dropped in V3, replaced with UpdateCredentialsCheckModels.

func (*CloudAPI) UpdateCredentialsCheckModels Uses

func (api *CloudAPI) UpdateCredentialsCheckModels(args params.UpdateCredentialArgs) (params.UpdateCredentialResults, error)

UpdateCredentialsCheckModels updates a set of cloud credentials' content. If there are any models that are using a credential and these models are not going to be visible with updated credential content, there will be detailed validation errors per model. Controller admins can 'force' an update of the credential regardless of whether it is deemed valid or not.

func (*CloudAPI) UserCredentials Uses

func (api *CloudAPI) UserCredentials(args params.UserClouds) (params.StringsResults, error)

UserCredentials returns the cloud credentials for a set of users.

type CloudAPIV1 Uses

type CloudAPIV1 struct {
    *CloudAPIV2
}

CloudAPIV1 provides a way to wrap the different calls between version 1 and version 2 of the cloud API.

func NewFacadeV1 Uses

func NewFacadeV1(context facade.Context) (*CloudAPIV1, error)

NewFacadeV1 is used for API registration.

type CloudAPIV2 Uses

type CloudAPIV2 struct {
    *CloudAPIV3
}

CloudAPIV2 provides a way to wrap the different calls between version 2 and version 3 of the cloud API.

func NewFacadeV2 Uses

func NewFacadeV2(context facade.Context) (*CloudAPIV2, error)

NewFacadeV2 is used for API registration.

func (*CloudAPIV2) CheckCredentialsModels Uses

func (*CloudAPIV2) CheckCredentialsModels(_, _ struct{})

Mask out old methods from the new API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

CheckCredentialsModels did not exist before V3.

func (*CloudAPIV2) RevokeCredentials Uses

func (api *CloudAPIV2) RevokeCredentials(args params.Entities) (params.ErrorResults, error)

UpdateCredentials updates a set of cloud credentials' content.

func (*CloudAPIV2) RevokeCredentialsCheckModels Uses

func (*CloudAPIV2) RevokeCredentialsCheckModels(_, _ struct{})

Mask out old methods from the new API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

RevokeCredentialsCheckModels did not exist before V3.

func (*CloudAPIV2) UpdateCredentials Uses

func (api *CloudAPIV2) UpdateCredentials(args params.TaggedCredentials) (params.ErrorResults, error)

UpdateCredentials updates a set of cloud credentials' content.

type CloudAPIV3 Uses

type CloudAPIV3 struct {
    *CloudAPIV4
}

CloudAPIV3 provides a way to wrap the different calls between version 3 and version 4 of the cloud API.

func NewFacadeV3 Uses

func NewFacadeV3(context facade.Context) (*CloudAPIV3, error)

NewFacadeV3 is used for API registration.

func (*CloudAPIV3) UpdateCloud Uses

func (*CloudAPIV3) UpdateCloud(_, _ struct{})

Mask out new methods from the new older API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

UpdateCloud did not exist before V4.

type CloudAPIV4 Uses

type CloudAPIV4 struct {
    *CloudAPIV5
}

CloudAPIV4 provides a way to wrap the different calls between version 4 and version 5 of the cloud API.

func NewFacadeV4 Uses

func NewFacadeV4(context facade.Context) (*CloudAPIV4, error)

NewFacadeV4 is used for API registration.

func (*CloudAPIV4) DefaultCloud Uses

func (api *CloudAPIV4) DefaultCloud() (params.StringResult, error)

DefaultCloud returns the tag of the cloud that models will be created in by default.

type CloudAPIV5 Uses

type CloudAPIV5 struct {
    *CloudAPI
}

CloudAPIV5 provides a way to wrap the different calls between version 5 and version 6 of the cloud API.

func NewFacadeV5 Uses

func NewFacadeV5(context facade.Context) (*CloudAPIV5, error)

NewFacadeV5 is used for API registration.

func (*CloudAPIV5) CredentialContents Uses

func (api *CloudAPIV5) CredentialContents(args params.CloudCredentialArgs) (params.CredentialContentResults, error)

CredentialContents returns the specified cloud credentials, including the secrets if requested. If no specific credential name/cloud was passed in, all credentials for this user are returned. Only credential owner can see its contents as well as what models use it. Controller admin has no special superpowers here and is treated the same as all other users.

type CloudV1 Uses

type CloudV1 interface {
    Cloud(args params.Entities) (params.CloudResults, error)
    Clouds() (params.CloudsResult, error)
    Credential(args params.Entities) (params.CloudCredentialResults, error)
    DefaultCloud() (params.StringResult, error)
    RevokeCredentials(args params.Entities) (params.ErrorResults, error)
    UpdateCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    UserCredentials(args params.UserClouds) (params.StringsResults, error)
}

CloudV1 defines the methods on the cloud API facade, version 1.

type CloudV2 Uses

type CloudV2 interface {
    AddCloud(cloudArgs params.AddCloudArgs) error
    AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    Cloud(args params.Entities) (params.CloudResults, error)
    Clouds() (params.CloudsResult, error)
    Credential(args params.Entities) (params.CloudCredentialResults, error)
    CredentialContents(credentialArgs params.CloudCredentialArgs) (params.CredentialContentResults, error)
    DefaultCloud() (params.StringResult, error)
    RemoveClouds(args params.Entities) (params.ErrorResults, error)
    RevokeCredentials(args params.Entities) (params.ErrorResults, error)
    UpdateCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    UserCredentials(args params.UserClouds) (params.StringsResults, error)
}

CloudV2 defines the methods on the cloud API facade, version 2.

type CloudV3 Uses

type CloudV3 interface {
    AddCloud(cloudArgs params.AddCloudArgs) error
    AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    CheckCredentialsModels(args params.TaggedCredentials) (params.UpdateCredentialResults, error)
    Cloud(args params.Entities) (params.CloudResults, error)
    Clouds() (params.CloudsResult, error)
    Credential(args params.Entities) (params.CloudCredentialResults, error)
    CredentialContents(credentialArgs params.CloudCredentialArgs) (params.CredentialContentResults, error)
    DefaultCloud() (params.StringResult, error)
    ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)
    RevokeCredentialsCheckModels(args params.RevokeCredentialArgs) (params.ErrorResults, error)
    UpdateCredentialsCheckModels(args params.UpdateCredentialArgs) (params.UpdateCredentialResults, error)
    UserCredentials(args params.UserClouds) (params.StringsResults, error)
}

CloudV3 defines the methods on the cloud API facade, version 3.

type CloudV4 Uses

type CloudV4 interface {
    AddCloud(cloudArgs params.AddCloudArgs) error
    AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    CheckCredentialsModels(args params.TaggedCredentials) (params.UpdateCredentialResults, error)
    Cloud(args params.Entities) (params.CloudResults, error)
    Clouds() (params.CloudsResult, error)
    Credential(args params.Entities) (params.CloudCredentialResults, error)
    CredentialContents(credentialArgs params.CloudCredentialArgs) (params.CredentialContentResults, error)
    DefaultCloud() (params.StringResult, error)
    ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)
    RevokeCredentialsCheckModels(args params.RevokeCredentialArgs) (params.ErrorResults, error)
    UpdateCredentialsCheckModels(args params.UpdateCredentialArgs) (params.UpdateCredentialResults, error)
    UserCredentials(args params.UserClouds) (params.StringsResults, error)
    UpdateCloud(cloudArgs params.UpdateCloudArgs) (params.ErrorResults, error)
}

CloudV4 defines the methods on the cloud API facade, version 4.

type CloudV5 Uses

type CloudV5 interface {
    AddCloud(cloudArgs params.AddCloudArgs) error
    AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    CheckCredentialsModels(args params.TaggedCredentials) (params.UpdateCredentialResults, error)
    Cloud(args params.Entities) (params.CloudResults, error)
    Clouds() (params.CloudsResult, error)
    Credential(args params.Entities) (params.CloudCredentialResults, error)
    CredentialContents(credentialArgs params.CloudCredentialArgs) (params.CredentialContentResults, error)
    ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)
    RevokeCredentialsCheckModels(args params.RevokeCredentialArgs) (params.ErrorResults, error)
    UpdateCredentialsCheckModels(args params.UpdateCredentialArgs) (params.UpdateCredentialResults, error)
    UserCredentials(args params.UserClouds) (params.StringsResults, error)
    UpdateCloud(cloudArgs params.UpdateCloudArgs) (params.ErrorResults, error)
}

CloudV5 defines the methods on the cloud API facade, version 5.

type CloudV6 Uses

type CloudV6 interface {
    AddCloud(cloudArgs params.AddCloudArgs) error
    AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
    CheckCredentialsModels(args params.TaggedCredentials) (params.UpdateCredentialResults, error)
    Cloud(args params.Entities) (params.CloudResults, error)
    Clouds() (params.CloudsResult, error)
    Credential(args params.Entities) (params.CloudCredentialResults, error)
    CredentialContents(credentialArgs params.CloudCredentialArgs) (params.CredentialContentResults, error)
    ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)
    RevokeCredentialsCheckModels(args params.RevokeCredentialArgs) (params.ErrorResults, error)
    UpdateCredentialsCheckModels(args params.UpdateCredentialArgs) (params.UpdateCredentialResults, error)
    UserCredentials(args params.UserClouds) (params.StringsResults, error)
    UpdateCloud(cloudArgs params.UpdateCloudArgs) (params.ErrorResults, error)
}

CloudV6 defines the methods on the cloud API facade, version 6.

type Model Uses

type Model interface {
    Cloud() string
    CloudCredential() (names.CloudCredentialTag, bool)
    CloudRegion() string
}

type ModelPoolBackend Uses

type ModelPoolBackend interface {
    // Get allows to retrieve a particular mode given a model UUID.
    Get(modelUUID string) (PooledModelBackend, error)

    // SystemState allows access to an underlying controller state.
    SystemState() *state.State
}

ModelPoolBackend defines a pool of models.

func NewModelPoolBackend Uses

func NewModelPoolBackend(st *state.StatePool) ModelPoolBackend

NewModelPoolBackend creates a model pool backend based on state.StatePool.

type PooledModelBackend Uses

type PooledModelBackend interface {
    // Model represents the model itself.
    Model() credentialcommon.PersistentBackend
    // Release returns a connection to the model back to the pool.
    Release() bool
}

PooledModelBackend defines a model retrieved from the model pool.

func NewPooledModelBackend Uses

func NewPooledModelBackend(st *state.PooledState) PooledModelBackend

NewPooledModelBackend creates a pooled model backend based on state.PooledState.

type User Uses

type User interface {
    DisplayName() string
}

Package cloud imports 21 packages (graph) and is imported by 3 packages. Updated 2019-10-15. Refresh now. Tools for package owners.