Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) ChangeModelCredential(ctx context.Context, model names.ModelTag, credential names.CloudCredentialTag) error
- func (c *Client) CreateModel(ctx context.Context, name, owner, cloud, cloudRegion string, ...) (base.ModelInfo, error)
- func (c *Client) DestroyModel(ctx context.Context, tag names.ModelTag, destroyStorage, force *bool, ...) error
- func (c *Client) DumpModel(ctx context.Context, model names.ModelTag, simplified bool) (map[string]interface{}, error)
- func (c *Client) DumpModelDB(ctx context.Context, model names.ModelTag) (map[string]interface{}, error)
- func (c *Client) GrantModel(ctx context.Context, user, access string, modelUUIDs ...string) error
- func (c *Client) ListModelSummaries(ctx context.Context, user string, all bool) ([]base.UserModelSummary, error)
- func (c *Client) ListModels(ctx context.Context, user string) ([]base.UserModel, error)
- func (c *Client) ModelDefaults(ctx context.Context, cloud string) (config.ModelDefaultAttributes, error)
- func (c *Client) ModelInfo(ctx context.Context, tags []names.ModelTag) ([]params.ModelInfoResult, error)
- func (c *Client) RevokeModel(ctx context.Context, user, access string, modelUUIDs ...string) error
- func (c *Client) SetModelDefaults(ctx context.Context, cloud, region string, config map[string]interface{}) error
- func (c *Client) UnsetModelDefaults(ctx context.Context, cloud, region string, keys ...string) error
- func (c *Client) ValidateModelUpgrade(ctx context.Context, model names.ModelTag, force bool) error
- type Option
Constants ¶
This section is empty.
Variables ¶
var WithTracer = base.WithTracer
WithTracer returns an Option that configures the Client to use the supplied tracer.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { base.ClientFacade *common.ModelStatusAPI // contains filtered or unexported fields }
Client provides methods that the Juju client command uses to interact with models stored in the Juju Server.
func NewClient ¶
func NewClient(st base.APICallCloser, options ...Option) *Client
NewClient creates a new `Client` based on an existing authenticated API connection.
func (*Client) ChangeModelCredential ¶
func (c *Client) ChangeModelCredential(ctx context.Context, model names.ModelTag, credential names.CloudCredentialTag) error
ChangeModelCredential replaces cloud credential for a given model with the provided one.
func (*Client) CreateModel ¶
func (c *Client) CreateModel( ctx context.Context, name, owner, cloud, cloudRegion string, cloudCredential names.CloudCredentialTag, config map[string]interface{}, ) (base.ModelInfo, error)
CreateModel creates a new model using the model config, cloud region and credential specified in the args.
func (*Client) DestroyModel ¶
func (c *Client) DestroyModel(ctx context.Context, tag names.ModelTag, destroyStorage, force *bool, maxWait *time.Duration, timeout *time.Duration) error
DestroyModel puts the specified model into a "dying" state, which will cause the model's resources to be cleaned up, after which the model will be removed.
func (*Client) DumpModel ¶
func (c *Client) DumpModel(ctx context.Context, model names.ModelTag, simplified bool) (map[string]interface{}, error)
DumpModel returns the serialized database agnostic model representation.
func (*Client) DumpModelDB ¶
func (c *Client) DumpModelDB(ctx context.Context, model names.ModelTag) (map[string]interface{}, error)
DumpModelDB returns all relevant mongo documents for the model.
func (*Client) GrantModel ¶
GrantModel grants a user access to the specified models.
func (*Client) ListModelSummaries ¶
func (*Client) ListModels ¶
ListModels returns the models that the specified user has access to in the current server. Only that controller owner can list models for any user (at this stage). Other users can only ask about their own models.
func (*Client) ModelDefaults ¶
func (c *Client) ModelDefaults(ctx context.Context, cloud string) (config.ModelDefaultAttributes, error)
ModelDefaults returns the default values for various sources used when creating a new model on the specified cloud.
func (*Client) RevokeModel ¶
RevokeModel revokes a user's access to the specified models.
func (*Client) SetModelDefaults ¶
func (c *Client) SetModelDefaults(ctx context.Context, cloud, region string, config map[string]interface{}) error
SetModelDefaults updates the specified default model config values.