Documentation ¶
Index ¶
- type Client
- func (c *Client) AllModels() ([]base.UserModel, error)
- func (c *Client) CloudSpec(modelTag names.ModelTag) (environscloudspec.CloudSpec, error)
- func (c *Client) ConfigSet(values map[string]interface{}) error
- func (c *Client) ControllerVersion() (ControllerVersion, error)
- func (c *Client) DashboardAddresses() ([]string, bool, error)
- func (c *Client) DestroyController(args DestroyControllerParams) error
- func (c *Client) GetControllerAccess(user string) (permission.Access, error)
- func (c *Client) GrantController(user, access string) error
- func (c *Client) HostedModelConfigs() ([]HostedConfig, error)
- func (c *Client) IdentityProviderURL() (string, error)
- func (c *Client) InitiateMigration(spec MigrationSpec) (string, error)
- func (c *Client) ListBlockedModels() ([]params.ModelBlockInfo, error)
- func (c *Client) ModelConfig() (map[string]interface{}, error)
- func (c *Client) MongoVersion() (string, error)
- func (c *Client) RemoveBlocks() error
- func (c *Client) RevokeController(user, access string) error
- func (c *Client) WatchAllModelSummaries() (*SummaryWatcher, error)
- func (c *Client) WatchAllModels() (*api.AllWatcher, error)
- func (c *Client) WatchModelSummaries() (*SummaryWatcher, error)
- type ControllerVersion
- type DestroyControllerParams
- type HostedConfig
- type MigrationSpec
- type SummaryWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { base.ClientFacade *common.ControllerConfigAPI *common.ModelStatusAPI *cloudspec.CloudSpecAPI // contains filtered or unexported fields }
Client provides methods that the Juju client command uses to interact with the Juju controller.
func NewClient ¶
func NewClient(st base.APICallCloser) *Client
NewClient creates a new `Client` based on an existing authenticated API connection.
func (*Client) AllModels ¶
AllModels allows controller administrators to get the list of all the models in the controller.
func (*Client) CloudSpec ¶
func (c *Client) CloudSpec(modelTag names.ModelTag) (environscloudspec.CloudSpec, error)
CloudSpec returns a CloudSpec for the specified model.
func (*Client) ConfigSet ¶
ConfigSet updates the passed controller configuration values. Any settings that aren't passed will be left with their previous values.
func (*Client) ControllerVersion ¶
func (c *Client) ControllerVersion() (ControllerVersion, error)
ControllerVersion fetches the controller version information.
func (*Client) DashboardAddresses ¶
DashboardAddresses returns the address info needed to connect to the dashboard.
func (*Client) DestroyController ¶
func (c *Client) DestroyController(args DestroyControllerParams) error
DestroyController puts the controller model into a "dying" state, and removes all non-manager machine instances.
func (*Client) GetControllerAccess ¶
func (c *Client) GetControllerAccess(user string) (permission.Access, error)
GetControllerAccess returns the access level the user has on the controller.
func (*Client) GrantController ¶
GrantController grants a user access to the controller.
func (*Client) HostedModelConfigs ¶
func (c *Client) HostedModelConfigs() ([]HostedConfig, error)
HostedModelConfigs returns all model settings for the controller model.
func (*Client) IdentityProviderURL ¶
IdentityProviderURL returns the URL of the configured external identity provider for this controller or an empty string if no external identity provider has been configured when the controller was bootstrapped.
func (*Client) InitiateMigration ¶
func (c *Client) InitiateMigration(spec MigrationSpec) (string, error)
InitiateMigration attempts to start a migration for the specified model, returning the migration's ID.
The API server supports starting multiple migrations in one request but we don't need that at the client side yet (and may never) so this call just supports starting one migration at a time.
func (*Client) ListBlockedModels ¶
func (c *Client) ListBlockedModels() ([]params.ModelBlockInfo, error)
ListBlockedModels returns a list of all models within the controller which have at least one block in place.
func (*Client) ModelConfig ¶
ModelConfig returns all model settings for the controller model.
func (*Client) MongoVersion ¶
MongoVersion returns the mongo version associated with the state session.
func (*Client) RemoveBlocks ¶
RemoveBlocks removes all the blocks in the controller.
func (*Client) RevokeController ¶
RevokeController revokes a user's access to the controller.
func (*Client) WatchAllModelSummaries ¶
func (c *Client) WatchAllModelSummaries() (*SummaryWatcher, error)
WatchAllModelSummaries returns a SummaryWatcher, from which you can request the Next set of ModelAbstracts. This method is only valid for controller superusers and returns abstracts for all models in the controller.
func (*Client) WatchAllModels ¶
func (c *Client) WatchAllModels() (*api.AllWatcher, error)
WatchAllModels returns an AllWatcher, from which you can request the Next collection of Deltas (for all models).
func (*Client) WatchModelSummaries ¶
func (c *Client) WatchModelSummaries() (*SummaryWatcher, error)
WatchModelSummaries returns a SummaryWatcher, from which you can request the Next set of ModelAbstracts for all models the user can see.
type ControllerVersion ¶
type DestroyControllerParams ¶
type DestroyControllerParams struct { // DestroyModels controls whether or not all hosted models should be // destroyed. If this is false, and there are non-empty hosted models, // an error with the code params.CodeHasHostedModels will be returned. DestroyModels bool // DestroyStorage controls whether or not storage in the model (and // hosted models, if DestroyModels is true) should be destroyed. // // This is ternary: nil, false, or true. If nil and there is persistent // storage in the model (or hosted models), an error with the code // params.CodeHasPersistentStorage will be returned. DestroyStorage *bool // Force specifies whether model destruction will be forced, i.e. // keep going despite operational errors. Force *bool `json:"force,omitempty"` // MaxWait specifies the amount of time that each step in model destroy process // will wait before forcing the next step to kick-off. This parameter // only makes sense in combination with 'force' set to 'true'. MaxWait *time.Duration `json:"max-wait,omitempty"` // ModelTimeout specifies how long to wait for the destroy process for each model. ModelTimeout *time.Duration `json:"model-timeout,omitempty"` }
DestroyControllerParams controls the behaviour of destroying the controller.
type HostedConfig ¶
type HostedConfig struct { Name string Owner names.UserTag Config map[string]interface{} CloudSpec environscloudspec.CloudSpec Error error }
HostedConfig contains the model config and the cloud spec for that model such that direct access to the provider can be used.
type MigrationSpec ¶
type MigrationSpec struct { ModelUUID string TargetControllerUUID string TargetControllerAlias string TargetAddrs []string TargetCACert string TargetUser string TargetPassword string TargetMacaroons []macaroon.Slice }
MigrationSpec holds the details required to start the migration of a single model.
func (*MigrationSpec) Validate ¶
func (s *MigrationSpec) Validate() error
Validate performs sanity checks on the migration configuration it holds.
type SummaryWatcher ¶
type SummaryWatcher struct {
// contains filtered or unexported fields
}
SummaryWatcher holds information allowing us to get ModelAbstract results for the models the user can see.
func NewSummaryWatcher ¶
func NewSummaryWatcher(caller base.APICaller, id *string) *SummaryWatcher
NewSummaryWatcher returns a SummaryWatcher instance which is in response to either a WatchModelSummaries call for all models a user can see, or WatchAllModelSummaries by a controller superuser.
func (*SummaryWatcher) Next ¶
func (watcher *SummaryWatcher) Next() ([]params.ModelAbstract, error)
Next returns a slice of ModelAbstracts. A new abstract is returned for a model if any part of the abstract changes. No indication is given however to which bit has changed. It will block until there is information to return.
func (*SummaryWatcher) Stop ¶
func (watcher *SummaryWatcher) Stop() error
Stop shutdowns down a summary watcher.