Documentation
¶
Overview ¶
Package cloud defines an API endpoint for functions dealing with the controller's cloud definition, and cloud credentials.
Index ¶
- func ChangeCloudAccess(backend Backend, cloud string, targetUserTag names.UserTag, ...) error
- func Register(registry facade.FacadeRegistry)
- type Backend
- type CloudAPI
- func (api *CloudAPI) AddCloud(cloudArgs params.AddCloudArgs) error
- func (api *CloudAPI) AddCredentials(args params.TaggedCredentials) (params.ErrorResults, error)
- func (api *CloudAPI) CheckCredentialsModels(args params.TaggedCredentials) (params.UpdateCredentialResults, error)
- func (api *CloudAPI) Cloud(args params.Entities) (params.CloudResults, error)
- func (api *CloudAPI) CloudInfo(args params.Entities) (params.CloudInfoResults, error)
- func (api *CloudAPI) Clouds() (params.CloudsResult, error)
- func (api *CloudAPI) Credential(args params.Entities) (params.CloudCredentialResults, error)
- func (api *CloudAPI) CredentialContents(args params.CloudCredentialArgs) (params.CredentialContentResults, error)
- func (api *CloudAPI) InstanceTypes(cons params.CloudInstanceTypesConstraints) (params.InstanceTypesResults, error)
- func (api *CloudAPI) ListCloudInfo(req params.ListCloudsRequest) (params.ListCloudInfoResults, error)
- func (c *CloudAPI) ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)
- func (api *CloudAPI) RemoveClouds(args params.Entities) (params.ErrorResults, error)
- func (api *CloudAPI) RevokeCredentialsCheckModels(args params.RevokeCredentialArgs) (params.ErrorResults, error)
- func (api *CloudAPI) UpdateCloud(cloudArgs params.UpdateCloudArgs) (params.ErrorResults, error)
- func (api *CloudAPI) UpdateCredentialsCheckModels(args params.UpdateCredentialArgs) (params.UpdateCredentialResults, error)
- func (api *CloudAPI) UserCredentials(args params.UserClouds) (params.StringsResults, error)
- type CloudV7
- type Model
- type ModelPoolBackend
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeCloudAccess ¶
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.
func Register ¶
func Register(registry facade.FacadeRegistry)
Register is called to expose a package of facades onto a given registry.
Types ¶
type Backend ¶
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, isSuperuser bool) ([]state.CloudInfo, error) }
func NewStateBackend ¶
type CloudAPI ¶
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 ¶
func NewCloudAPI(backend, ctlrBackend Backend, pool ModelPoolBackend, authorizer facade.Authorizer) (*CloudAPI, error)
NewCloudAPI creates a new API server endpoint for managing the controller's cloud definition and cloud credentials.
func (*CloudAPI) AddCloud ¶
func (api *CloudAPI) AddCloud(cloudArgs params.AddCloudArgs) error
AddCloud adds a new cloud, different from the one managed by the controller.
func (*CloudAPI) AddCredentials ¶
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 ¶
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. There's no Juju API client which uses this, but JAAS does,
func (*CloudAPI) Clouds ¶
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 ¶
Credential returns the specified cloud credential for each tag, minus secrets.
func (*CloudAPI) CredentialContents ¶
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) InstanceTypes ¶
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 ¶
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 ¶
func (c *CloudAPI) ModifyCloudAccess(args params.ModifyCloudAccessRequest) (params.ErrorResults, error)
ModifyCloudAccess changes the model access granted to users.
func (*CloudAPI) RemoveClouds ¶
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) RevokeCredentialsCheckModels ¶
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 ¶
func (api *CloudAPI) UpdateCloud(cloudArgs params.UpdateCloudArgs) (params.ErrorResults, error)
UpdateCloud updates an existing cloud that the controller knows about.
func (*CloudAPI) UpdateCredentialsCheckModels ¶
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. Such model errors are returned separately and do not contribute to the overall method error status. Controller admins can 'force' an update of the credential regardless of whether it is deemed valid or not.
func (*CloudAPI) UserCredentials ¶
func (api *CloudAPI) UserCredentials(args params.UserClouds) (params.StringsResults, error)
UserCredentials returns the cloud credentials for a set of users.
type CloudV7 ¶
type CloudV7 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) }
CloudV7 defines the methods on the cloud API facade, version 7.
type ModelPoolBackend ¶
type ModelPoolBackend interface { // GetModelCallContext gets everything that is needed to make cloud calls on behalf of the given model. GetModelCallContext(modelUUID string) (credentialcommon.PersistentBackend, context.ProviderCallContext, error) // SystemState allows access to an underlying controller state. SystemState() (*state.State, error) }
ModelPoolBackend defines a pool of models.
func NewModelPoolBackend ¶
func NewModelPoolBackend(st *state.StatePool) ModelPoolBackend
NewModelPoolBackend creates a model pool backend based on state.StatePool.