modelconfig

package
v0.0.0-...-316c2cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
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
	// 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) BestAPIVersion

func (c *Client) BestAPIVersion() int

BestAPIVersion returns the best API version supported by the client.

func (*Client) GetModelConstraints

func (c *Client) GetModelConstraints(ctx context.Context) (constraints.Value, error)

GetModelConstraints returns the constraints for the model.

func (*Client) GetModelSecretBackend

func (c *Client) GetModelSecretBackend(ctx context.Context) (string, error)

GetModelSecretBackend returns the secret backend name for the specified model, returning an error satisfying [modelerrors.NotFound] if the model provided does not exist.

func (*Client) ModelGet

func (c *Client) ModelGet(ctx context.Context) (map[string]interface{}, error)

ModelGet returns all model settings.

func (*Client) ModelGetWithMetadata

func (c *Client) ModelGetWithMetadata(ctx context.Context) (config.ConfigValues, error)

ModelGetWithMetadata returns all model settings along with extra metadata like the source of the setting value.

func (*Client) ModelSet

func (c *Client) ModelSet(ctx context.Context, config map[string]interface{}) error

ModelSet sets the given key-value pairs in the model.

func (*Client) ModelUnset

func (c *Client) ModelUnset(ctx context.Context, keys ...string) error

ModelUnset sets the given key-value pairs in the model.

func (*Client) Sequences

func (c *Client) Sequences(ctx context.Context) (map[string]int, error)

Sequences returns all sequence names and next values.

func (*Client) SetModelConstraints

func (c *Client) SetModelConstraints(ctx context.Context, constraints constraints.Value) error

SetModelConstraints specifies the constraints for the model.

func (*Client) SetModelSecretBackend

func (c *Client) SetModelSecretBackend(ctx context.Context, secretBackendName string) error

SetModelSecretBackend sets the secret backend config for the specified model, returning an error satisfying [secretbackenderrors.NotFound] if the backend provided does not exist, returning an error satisfying [modelerrors.NotFound] if the model provided does not exist, returning an error satisfying [secretbackenderrors.NotValid] if the backend name provided is not valid.

type Option

type Option = base.Option

Option is a function that can be used to configure a Client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL