Back to godoc.org

Package params

v0.0.0-...-2971fcc
Latest Go to latest

The highest tagged major version is .

Published: Sep 25, 2020 | License: AGPL-3.0 | Module: github.com/juju/juju

Index

Constants

const (
	// ActionCancelled is the status for an Action that has been
	// cancelled prior to execution.
	ActionCancelled string = "cancelled"

	// ActionCompleted is the status of an Action that has completed
	// successfully.
	ActionCompleted string = "completed"

	// ActionFailed is the status of an Action that has completed with
	// an error.
	ActionFailed string = "failed"

	// ActionPending is the status of an Action that has been queued up but
	// not executed yet.
	ActionPending string = "pending"

	// ActionRunning is the status of an Action that has been started but
	// not completed yet.
	ActionRunning string = "running"

	// ActionAborting is the status of an Action that is running but is to be
	// terminated. Identical to ActionRunning.
	ActionAborting string = "aborting"

	// ActionAborted is the status of an Action that was aborted.
	// Identical to ActionFailed and can have an error.
	ActionAborted string = "aborted"
)
const (
	CodeNotFound                  = "not found"
	CodeUserNotFound              = "user not found"
	CodeModelNotFound             = "model not found"
	CodeUnauthorized              = "unauthorized access"
	CodeLoginExpired              = "login expired"
	CodeNoCreds                   = "no credentials provided"
	CodeCannotEnterScope          = "cannot enter scope"
	CodeCannotEnterScopeYet       = "cannot enter scope yet"
	CodeExcessiveContention       = "excessive contention"
	CodeUnitHasSubordinates       = "unit has subordinates"
	CodeNotAssigned               = "not assigned"
	CodeStopped                   = "stopped"
	CodeDead                      = "dead"
	CodeHasAssignedUnits          = "machine has assigned units"
	CodeHasHostedModels           = "controller has hosted models"
	CodeHasPersistentStorage      = "controller/model has persistent storage"
	CodeModelNotEmpty             = "model not empty"
	CodeMachineHasAttachedStorage = "machine has attached storage"
	CodeStorageAttached           = "storage is attached"
	CodeNotProvisioned            = "not provisioned"
	CodeNoAddressSet              = "no address set"
	CodeTryAgain                  = "try again"
	CodeNotImplemented            = "not implemented" // asserted to match rpc.codeNotImplemented in rpc/rpc_test.go
	CodeAlreadyExists             = "already exists"
	CodeUpgradeInProgress         = "upgrade in progress"
	CodeMigrationInProgress       = "model migration in progress"
	CodeActionNotAvailable        = "action no longer available"
	CodeOperationBlocked          = "operation is blocked"
	CodeLeadershipClaimDenied     = "leadership claim denied"
	CodeLeaseClaimDenied          = "lease claim denied"
	CodeNotSupported              = "not supported"
	CodeBadRequest                = "bad request"
	CodeMethodNotAllowed          = "method not allowed"
	CodeForbidden                 = "forbidden"
	CodeDischargeRequired         = "macaroon discharge required"
	CodeRedirect                  = "redirection required"
	CodeRetry                     = "retry"
	CodeIncompatibleSeries        = "incompatible series"
	CodeCloudRegionRequired       = "cloud region required"
	CodeIncompatibleClouds        = "incompatible clouds"
	CodeQuotaLimitExceeded        = "quota limit exceeded"
)

The Code constants hold error codes for some kinds of error.

const (
	// DigestSHA is the HTTP digest algorithm value used in juju's HTTP code.
	DigestSHA256 DigestAlgorithm = "SHA-256"

	// ContentTypeJSON is the HTTP content-type value used for JSON content.
	ContentTypeJSON = "application/json"

	// ContentTypeRaw is the HTTP content-type value used for raw, unformattedcontent.
	ContentTypeRaw = "application/octet-stream"

	// ContentTypeJS is the HTTP content-type value used for javascript.
	ContentTypeJS = "application/javascript"

	// ContentTypeXJS is the outdated HTTP content-type value used for javascript.
	ContentTypeXJS = "application/x-javascript"
)
const MachineNonceHeader = "X-Juju-Nonce"
const MigrationModelHTTPHeader = "X-Juju-Migration-Model-UUID"

MigrationModelHTTPHeader is the key for the HTTP header value that is used to specify the model UUID for the model being migrated for the uploading of the binaries for that model.

Variables

var MigrationInProgressError = errors.New(CodeMigrationInProgress)

MigrationInProgressError signifies a migration is in progress.

var UpgradeInProgressError = errors.New(CodeUpgradeInProgress)

UpgradeInProgressError signifies an upgrade is in progress.

func EncodeChecksum

func EncodeChecksum(checksum string) string

EncodeChecksum base64 encodes a sha256 checksum according to RFC 4648 and returns a value that can be added to the "Digest" http header.

func ErrCode

func ErrCode(err error) string

ErrCode returns the error code associated with the given error, or the empty string if there is none.

func FromCharmOptionMap

func FromCharmOptionMap(config map[string]CharmOption) *charm.Config

func FromHostsPorts

func FromHostsPorts(nhpm []network.HostPorts) [][]HostPort

FromHostsPorts is a helper to create a parameter out of the network type, here for a nested slice of HostPort.

func FromProviderHostsPorts

func FromProviderHostsPorts(nhpm []network.ProviderHostPorts) [][]HostPort

FromProviderHostsPorts is a helper to create a parameter out of the network type, here for a nested slice of HostPort.

func InterfaceInfoFromNetworkConfig

func InterfaceInfoFromNetworkConfig(configs []NetworkConfig) network.InterfaceInfos

InterfaceInfoFromNetworkConfig converts a slice of NetworkConfig into the equivalent network.InterfaceInfo slice.

func IsBadRequest

func IsBadRequest(err error) bool

func IsCodeActionNotAvailable

func IsCodeActionNotAvailable(err error) bool

func IsCodeAlreadyExists

func IsCodeAlreadyExists(err error) bool

func IsCodeCannotEnterScope

func IsCodeCannotEnterScope(err error) bool

func IsCodeCannotEnterScopeYet

func IsCodeCannotEnterScopeYet(err error) bool

func IsCodeCloudRegionRequired

func IsCodeCloudRegionRequired(err error) bool

func IsCodeDead

func IsCodeDead(err error) bool

func IsCodeExcessiveContention

func IsCodeExcessiveContention(err error) bool

func IsCodeForbidden

func IsCodeForbidden(err error) bool

func IsCodeHasAssignedUnits

func IsCodeHasAssignedUnits(err error) bool

func IsCodeHasHostedModels

func IsCodeHasHostedModels(err error) bool

func IsCodeHasPersistentStorage

func IsCodeHasPersistentStorage(err error) bool

func IsCodeIncompatibleSeries

func IsCodeIncompatibleSeries(err error) bool

func IsCodeLeadershipClaimDenied

func IsCodeLeadershipClaimDenied(err error) bool

func IsCodeLeaseClaimDenied

func IsCodeLeaseClaimDenied(err error) bool

func IsCodeLoginExpired

func IsCodeLoginExpired(err error) bool

func IsCodeMachineHasAttachedStorage

func IsCodeMachineHasAttachedStorage(err error) bool

func IsCodeModelNotEmpty

func IsCodeModelNotEmpty(err error) bool

func IsCodeModelNotFound

func IsCodeModelNotFound(err error) bool

func IsCodeNoAddressSet

func IsCodeNoAddressSet(err error) bool

func IsCodeNoCreds

func IsCodeNoCreds(err error) bool

func IsCodeNotAssigned

func IsCodeNotAssigned(err error) bool

func IsCodeNotFound

func IsCodeNotFound(err error) bool

func IsCodeNotFoundOrCodeUnauthorized

func IsCodeNotFoundOrCodeUnauthorized(err error) bool

IsCodeNotFoundOrCodeUnauthorized is used in API clients which, pre-API, used errors.IsNotFound; this is because an API client is not necessarily privileged to know about the existence or otherwise of a particular entity, and the server may hence convert NotFound to Unauthorized at its discretion.

func IsCodeNotImplemented

func IsCodeNotImplemented(err error) bool

func IsCodeNotProvisioned

func IsCodeNotProvisioned(err error) bool

func IsCodeNotSupported

func IsCodeNotSupported(err error) bool

func IsCodeOperationBlocked

func IsCodeOperationBlocked(err error) bool

func IsCodeQuotaLimitExceeded

func IsCodeQuotaLimitExceeded(err error) bool

IsCodeQuotaLimitExceeded returns true if err includes a QuotaLimitExceeded error code.

func IsCodeStopped

func IsCodeStopped(err error) bool

func IsCodeStorageAttached

func IsCodeStorageAttached(err error) bool

func IsCodeTryAgain

func IsCodeTryAgain(err error) bool

func IsCodeUnauthorized

func IsCodeUnauthorized(err error) bool

func IsCodeUnitHasSubordinates

func IsCodeUnitHasSubordinates(err error) bool

func IsCodeUpgradeInProgress

func IsCodeUpgradeInProgress(err error) bool

func IsCodeUserNotFound

func IsCodeUserNotFound(err error) bool

func IsMethodNotAllowed

func IsMethodNotAllowed(err error) bool

func IsRedirect

func IsRedirect(err error) bool

func ToCharmOptionMap

func ToCharmOptionMap(config *charm.Config) map[string]CharmOption

func ToMachineHostPorts

func ToMachineHostPorts(hps []HostPort) network.MachineHostPorts

ToMachineHostPorts transforms multiple Addresses into a MachineHostPort collection.

func ToMachineHostsPorts

func ToMachineHostsPorts(hpm [][]HostPort) []network.MachineHostPorts

ToMachineHostsPorts transforms slices of HostPort grouped by server into a slice of MachineHostPorts collections.

func ToNetworkSpaceInfos

func ToNetworkSpaceInfos(allInfos SpaceInfos) network.SpaceInfos

ToNetworkSpaceInfos converts a serializable SpaceInfos payload into a network.SpaceInfos instance.

func ToProviderAddresses

func ToProviderAddresses(addrs ...Address) network.ProviderAddresses

ToProviderAddresses transforms multiple Addresses into a ProviderAddresses collection.

func ToProviderHostPorts

func ToProviderHostPorts(hps []HostPort) network.ProviderHostPorts

ToProviderHostPorts transforms multiple Addresses into a ProviderHostPorts collection.

func ToProviderHostsPorts

func ToProviderHostsPorts(hpm [][]HostPort) []network.ProviderHostPorts

ToProviderHostsPorts transforms slices of HostPort grouped by server into a slice of ProviderHostPort collections.

type APIHostPortsResult

type APIHostPortsResult struct {
	Servers [][]HostPort `json:"servers"`
}

APIHostPortsResult holds the result of an APIHostPorts call. Each element in the top level slice holds the addresses for one API server.

func (APIHostPortsResult) MachineHostsPorts

func (r APIHostPortsResult) MachineHostsPorts() []network.MachineHostPorts

MachineHostPorts transforms the APIHostPortsResult into a slice of MachineHostPorts.

type Action

type Action struct {
	Tag        string                 `json:"tag"`
	Receiver   string                 `json:"receiver"`
	Name       string                 `json:"name"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

Action describes an Action that will be or has been queued up.

type ActionExecutionResult

type ActionExecutionResult struct {
	ActionTag string                 `json:"action-tag"`
	Status    string                 `json:"status"`
	Results   map[string]interface{} `json:"results,omitempty"`
	Message   string                 `json:"message,omitempty"`
}

ActionExecutionResult holds the action tag and output used when recording the result of an action.

type ActionExecutionResults

type ActionExecutionResults struct {
	Results []ActionExecutionResult `json:"results,omitempty"`
}

ActionExecutionResults holds a slice of ActionExecutionResult for a bulk action API call

type ActionInfo

type ActionInfo struct {
	ModelUUID  string                 `json:"model-uuid"`
	Id         string                 `json:"id"`
	Receiver   string                 `json:"receiver"`
	Name       string                 `json:"name"`
	Parameters map[string]interface{} `json:"parameters,omitempty"`
	Status     string                 `json:"status"`
	Message    string                 `json:"message"`
	Results    map[string]interface{} `json:"results,omitempty"`
	Enqueued   time.Time              `json:"enqueued"`
	Started    time.Time              `json:"started"`
	Completed  time.Time              `json:"completed"`
}

ActionInfo holds the information about a action that is tracked by multiwatcherStore.

func (*ActionInfo) EntityId

func (i *ActionInfo) EntityId() EntityId

EntityId returns a unique identifier for an action across models.

type ActionMessage

type ActionMessage struct {
	Timestamp time.Time `json:"timestamp"`
	Message   string    `json:"message"`
}

ActionMessage represents a logged message on an action.

type ActionMessageParams

type ActionMessageParams struct {
	Messages []EntityString `json:"messages"`
}

ActionMessageParams holds the arguments for logging progress messages for some actions.

type ActionPruneArgs

type ActionPruneArgs struct {
	MaxHistoryTime time.Duration `json:"max-history-time"`
	MaxHistoryMB   int           `json:"max-history-mb"`
}

type ActionResult

type ActionResult struct {
	Action    *Action                `json:"action,omitempty"`
	Enqueued  time.Time              `json:"enqueued,omitempty"`
	Started   time.Time              `json:"started,omitempty"`
	Completed time.Time              `json:"completed,omitempty"`
	Status    string                 `json:"status,omitempty"`
	Message   string                 `json:"message,omitempty"`
	Log       []ActionMessage        `json:"log,omitempty"`
	Output    map[string]interface{} `json:"output,omitempty"`
	Error     *Error                 `json:"error,omitempty"`
}

ActionResult describes an Action that will be or has been completed.

type ActionResults

type ActionResults struct {
	Results []ActionResult `json:"results,omitempty"`
}

ActionResults is a slice of ActionResult for bulk requests.

type ActionSpec

type ActionSpec struct {
	Description string                 `json:"description"`
	Params      map[string]interface{} `json:"params"`
}

ActionSpec is a definition of the parameters and traits of an Action. The Params map is expected to conform to JSON-Schema Draft 4 as defined at http://json-schema.org/draft-04/schema# (see http://json-schema.org/latest/json-schema-core.html)

type Actions

type Actions struct {
	Actions []Action `json:"actions,omitempty"`
}

Actions is a slice of Action for bulk requests.

type ActionsByName

type ActionsByName struct {
	Name    string         `json:"name,omitempty"`
	Actions []ActionResult `json:"actions,omitempty"`
	Error   *Error         `json:"error,omitempty"`
}

ActionsByName is a bulk API call wrapper containing actions as results.

type ActionsByNames

type ActionsByNames struct {
	Actions []ActionsByName `json:"actions,omitempty"`
}

ActionsByNames wrap a slice of Actions for API calls.

type ActionsByReceiver

type ActionsByReceiver struct {
	Receiver string         `json:"receiver,omitempty"`
	Actions  []ActionResult `json:"actions,omitempty"`
	Error    *Error         `json:"error,omitempty"`
}

ActionsByReceiver is a bulk API call wrapper containing Actions, either as input parameters or as results.

type ActionsByReceivers

type ActionsByReceivers struct {
	Actions []ActionsByReceiver `json:"actions,omitempty"`
}

ActionsByReceivers wrap a slice of Actions for API calls.

type ActionsQueryResult

type ActionsQueryResult struct {
	Receiver string       `json:"receiver,omitempty"`
	Action   ActionResult `json:"action,omitempty"`
	Error    *Error       `json:"error,omitempty"`
}

ActionsQueryResult holds the name and parameters of an query result.

type ActionsQueryResults

type ActionsQueryResults struct {
	Results []ActionsQueryResult `json:"results,omitempty"`
}

ActionsQueryResults holds a slice of responses from the Actions query.

type AddApplicationOffer

type AddApplicationOffer struct {
	ModelTag               string            `json:"model-tag"`
	OfferName              string            `json:"offer-name"`
	ApplicationName        string            `json:"application-name"`
	ApplicationDescription string            `json:"application-description"`
	Endpoints              map[string]string `json:"endpoints"`
}

AddApplicationOffer values are used to create an application offer.

type AddApplicationOffers

type AddApplicationOffers struct {
	Offers []AddApplicationOffer
}

AddApplicationOffers is used when adding offers to an application directory.

type AddApplicationUnits

type AddApplicationUnits struct {
	ApplicationName string                `json:"application"`
	NumUnits        int                   `json:"num-units"`
	Placement       []*instance.Placement `json:"placement"`
	Policy          string                `json:"policy,omitempty"`
	AttachStorage   []string              `json:"attach-storage,omitempty"`
}

AddApplicationUnits holds parameters for the AddUnits call.

type AddApplicationUnitsResults

type AddApplicationUnitsResults struct {
	Units []string `json:"units"`
}

AddApplicationUnitsResults holds the names of the units added by the AddUnits call.

type AddApplicationUnitsV5

type AddApplicationUnitsV5 struct {
	ApplicationName string                `json:"application"`
	NumUnits        int                   `json:"num-units"`
	Placement       []*instance.Placement `json:"placement"`
	AttachStorage   []string              `json:"attach-storage,omitempty"`
}

AddApplicationUnitsV5 holds parameters for the AddUnits call. V5 is missing the new policy arg.

type AddCharm

type AddCharm struct {
	URL     string `json:"url"`
	Channel string `json:"channel"`
	Force   bool   `json:"force"`
}

AddCharm holds the arguments for making an AddCharm API call.

type AddCharmWithAuth

type AddCharmWithAuth struct {
	URL                string             `json:"url"`
	Origin             CharmOrigin        `json:"charm-origin"`
	CharmStoreMacaroon *macaroon.Macaroon `json:"macaroon"`
	Force              bool               `json:"force"`
	Series             string             `json:"series"`
}

AddCharmWithAuth holds the arguments for making an AddCharmWithAuth API call via the Charms facade.

type AddCharmWithAuthorization

type AddCharmWithAuthorization struct {
	URL                string             `json:"url"`
	Channel            string             `json:"channel"`
	CharmStoreMacaroon *macaroon.Macaroon `json:"macaroon"`
	Force              bool               `json:"force"`
}

AddCharmWithAuthorization holds the arguments for making an AddCharmWithAuthorization API call.

type AddCharmWithOrigin

type AddCharmWithOrigin struct {
	URL    string      `json:"url"`
	Origin CharmOrigin `json:"charm-origin"`
	Force  bool        `json:"force"`
	Series string      `json:"series"`
}

AddCharmWithOrigin holds the arguments for making an AddCharm API call via the Charms facade.

type AddCloudArgs

type AddCloudArgs struct {
	Cloud Cloud  `json:"cloud"`
	Name  string `json:"name"`
	Force *bool  `json:"force,omitempty"`
}

AddCloudArgs holds a cloud to be added with its name

type AddMachineParams

type AddMachineParams struct {
	// The following fields hold attributes that will be given to the
	// new machine when it is created.
	Series      string             `json:"series"`
	Constraints constraints.Value  `json:"constraints"`
	Jobs        []model.MachineJob `json:"jobs"`

	// Disks describes constraints for disks that must be attached to
	// the machine when it is provisioned.
	Disks []storage.Constraints `json:"disks,omitempty"`

	// If Placement is non-nil, it contains a placement directive
	// that will be used to decide how to instantiate the machine.
	Placement *instance.Placement `json:"placement,omitempty"`

	// If ParentId is non-empty, it specifies the id of the
	// parent machine within which the new machine will
	// be created. In that case, ContainerType must also be
	// set.
	ParentId string `json:"parent-id"`

	// ContainerType optionally gives the container type of the
	// new machine. If it is non-empty, the new machine
	// will be implemented by a container. If it is specified
	// but ParentId is empty, a new top level machine will
	// be created to hold the container with given series,
	// constraints and jobs.
	ContainerType instance.ContainerType `json:"container-type"`

	// If InstanceId is non-empty, it will be associated with
	// the new machine along with the given nonce,
	// hardware characteristics and addresses.
	// All the following fields will be ignored if ContainerType
	// is set.
	InstanceId              instance.Id                      `json:"instance-id"`
	Nonce                   string                           `json:"nonce"`
	HardwareCharacteristics instance.HardwareCharacteristics `json:"hardware-characteristics"`
	Addrs                   []Address                        `json:"addresses"`
}

AddMachineParams encapsulates the parameters used to create a new machine.

type AddMachines

type AddMachines struct {
	MachineParams []AddMachineParams `json:"params"`
}

AddMachines holds the parameters for making the AddMachines call.

type AddMachinesResult

type AddMachinesResult struct {
	Machine string `json:"machine"`
	Error   *Error `json:"error,omitempty"`
}

AddMachinesResult holds the name of a machine added by the api.client.AddMachine call for a single machine.

type AddMachinesResults

type AddMachinesResults struct {
	Machines []AddMachinesResult `json:"machines"`
}

AddMachinesResults holds the results of an AddMachines call.

type AddPendingResourcesArgs

type AddPendingResourcesArgs struct {
	Entity
	AddCharmWithAuthorization

	// Resources is the list of resources to add as pending.
	Resources []CharmResource `json:"resources"`
}

AddPendingResourcesArgs holds the arguments to the AddPendingResources API endpoint.

type AddPendingResourcesResult

type AddPendingResourcesResult struct {
	ErrorResult

	// PendingIDs holds the "pending ID" for each of the requested
	// resources.
	PendingIDs []string `json:"pending-ids"`
}

AddPendingResourcesResult holds the result of the AddPendingResources API endpoint.

type AddRelation

type AddRelation struct {
	Endpoints []string `json:"endpoints"`
	ViaCIDRs  []string `json:"via-cidrs,omitempty"`
}

AddRelation holds the parameters for making the AddRelation call. The endpoints specified are unordered.

type AddRelationResults

type AddRelationResults struct {
	Endpoints map[string]CharmRelation `json:"endpoints"`
}

AddRelationResults holds the results of a AddRelation call. The Endpoints field maps application names to the involved endpoints.

type AddStorageDetails

type AddStorageDetails struct {
	// StorageTags contains the string representation of the storage tags
	// of the added storage instances.
	StorageTags []string `json:"storage-tags"`
}

AddStorageDetails contains the details of added storage.

type AddStorageResult

type AddStorageResult struct {
	Result *AddStorageDetails `json:"result,omitempty"`
	Error  *Error             `json:"error,omitempty"`
}

AddStorageResult contains the result of adding storage to a unit.

type AddStorageResults

type AddStorageResults struct {
	Results []AddStorageResult `json:"results"`
}

AddStorageResults contains the results of adding storage to units.

type AddSubnetParams

type AddSubnetParams struct {
	CIDR              string   `json:"cidr,omitempty"`
	SubnetProviderId  string   `json:"subnet-provider-id,omitempty"`
	ProviderNetworkId string   `json:"provider-network-id,omitempty"`
	SpaceTag          string   `json:"space-tag"`
	VLANTag           int      `json:"vlan-tag,omitempty"`
	Zones             []string `json:"zones,omitempty"`
}

AddSubnetParams holds a cidr and space tags, subnet provider ID, and a list of zones to associate the subnet to. Either SubnetTag or SubnetProviderId must be set, but not both. Zones can be empty if they can be discovered

type AddSubnetParamsV2

type AddSubnetParamsV2 struct {
	SubnetTag         string   `json:"subnet-tag,omitempty"`
	SubnetProviderId  string   `json:"subnet-provider-id,omitempty"`
	ProviderNetworkId string   `json:"provider-network-id,omitempty"`
	SpaceTag          string   `json:"space-tag"`
	VLANTag           int      `json:"vlan-tag,omitempty"`
	Zones             []string `json:"zones,omitempty"`
}

AddSubnetParams holds a subnet and space tags, subnet provider ID, and a list of zones to associate the subnet to. Either SubnetTag or SubnetProviderId must be set, but not both. Zones can be empty if they can be discovered

type AddSubnetsParams

type AddSubnetsParams struct {
	Subnets []AddSubnetParams `json:"subnets"`
}

AddSubnetsParams holds the arguments of AddSubnets API call.

type AddSubnetsParamsV2

type AddSubnetsParamsV2 struct {
	Subnets []AddSubnetParamsV2 `json:"subnets"`
}

AddSubnetsParams holds the arguments of AddSubnets APIv2 call.

type AddUser

type AddUser struct {
	Username    string `json:"username"`
	DisplayName string `json:"display-name"`

	// Password is optional. If it is empty, then
	// a secret key will be generated for the user
	// and returned in AddUserResult. It will not
	// be possible to login with a password until
	// registration with the secret key is completed.
	Password string `json:"password,omitempty"`
}

AddUser stores the parameters to add one user.

type AddUserResult

type AddUserResult struct {
	Tag       string `json:"tag,omitempty"`
	SecretKey []byte `json:"secret-key,omitempty"`
	Error     *Error `json:"error,omitempty"`
}

AddUserResult returns the tag of the newly created user and the secret key required to complete registration, or an error.

type AddUserResults

type AddUserResults struct {
	Results []AddUserResult `json:"results"`
}

AddUserResults holds the results of the bulk AddUser API call.

type AddUsers

type AddUsers struct {
	Users []AddUser `json:"users"`
}

AddUsers holds the parameters for adding new users.

type Address

type Address struct {
	Value           string `json:"value"`
	Type            string `json:"type"`
	Scope           string `json:"scope"`
	SpaceName       string `json:"space-name,omitempty"`
	ProviderSpaceID string `json:"space-id,omitempty"`
}

Address represents the location of a machine, including metadata about what kind of location the address describes. See also the address types in core/network which this type can be transformed to/from.

func FromMachineAddress

func FromMachineAddress(addr network.MachineAddress) Address

FromMachineAddress returns an Address for the input MachineAddress.

func FromMachineAddresses

func FromMachineAddresses(mAddrs ...network.MachineAddress) []Address

FromMachineAddresses transforms multiple MachineAddresses into a slice of Address.

func FromProviderAddress

func FromProviderAddress(addr network.ProviderAddress) Address

FromProviderAddress returns an Address for the input ProviderAddress.

func FromProviderAddresses

func FromProviderAddresses(pAddrs ...network.ProviderAddress) []Address

FromProviderAddresses transforms multiple ProviderAddresses into a slice of Address.

func (Address) MachineAddress

func (addr Address) MachineAddress() network.MachineAddress

MachineAddress transforms the Address to a MachineAddress, effectively ignoring the space fields.

func (Address) ProviderAddress

func (addr Address) ProviderAddress() network.ProviderAddress

ProviderAddress transforms the Address to a ProviderAddress.

type AdoptResourcesArgs

type AdoptResourcesArgs struct {
	// ModelTag identifies the model that owns the resources.
	ModelTag string `json:"model-tag"`

	// SourceControllerVersion indicates the version of the calling
	// controller. This is needed in case the way the resources are
	// tagged has changed between versions - the provider should
	// ensure it looks for the original tags in the correct format for
	// that version.
	SourceControllerVersion version.Number `json:"source-controller-version"`
}

AdoptResourcesArgs holds the information required to ask the provider to update the controller tags for a model's resources.

type AgentGetEntitiesResult

type AgentGetEntitiesResult struct {
	Life          life.Value             `json:"life"`
	Jobs          []model.MachineJob     `json:"jobs"`
	ContainerType instance.ContainerType `json:"container-type"`
	Error         *Error                 `json:"error,omitempty"`
}

AgentGetEntitiesResult holds the results of a machineagent.API.GetEntities call for a single entity.

type AgentGetEntitiesResults

type AgentGetEntitiesResults struct {
	Entities []AgentGetEntitiesResult `json:"entities"`
}

AgentGetEntitiesResults holds the results of a agent.API.GetEntities call.

type AgentVersionResult

type AgentVersionResult struct {
	Version version.Number `json:"version"`
}

AgentVersionResult is used to return the current version number of the agent running the API server.

type AllWatcherId

type AllWatcherId struct {
	AllWatcherId string `json:"watcher-id"`
}

AllWatcherId holds the id of an AllWatcher.

type AllWatcherNextResults

type AllWatcherNextResults struct {
	Deltas []Delta `json:"deltas"`
}

AllWatcherNextResults holds deltas returned from calling AllWatcher.Next().

type AnnotationInfo

type AnnotationInfo struct {
	ModelUUID   string            `json:"model-uuid"`
	Tag         string            `json:"tag"`
	Annotations map[string]string `json:"annotations"`
}

AnnotationInfo holds the information about an annotation that is tracked by multiwatcherStore.

func (*AnnotationInfo) EntityId

func (i *AnnotationInfo) EntityId() EntityId

EntityId returns a unique identifier for an annotation across models.

type AnnotationsGetResult

type AnnotationsGetResult struct {
	EntityTag   string            `json:"entity"`
	Annotations map[string]string `json:"annotations"`
	Error       ErrorResult       `json:"error,omitempty"`
}

AnnotationsGetResult holds entity annotations or retrieval error.

type AnnotationsGetResults

type AnnotationsGetResults struct {
	Results []AnnotationsGetResult `json:"results"`
}

AnnotationsGetResults holds annotations associated with entities.

type AnnotationsSet

type AnnotationsSet struct {
	Annotations []EntityAnnotations `json:"annotations"`
}

AnnotationsSet stores parameters for making Set call on Annotations client.

type ApplicationCharm

type ApplicationCharm struct {
	// URL holds the URL of the charm assigned to the
	// application.
	URL string `json:"url"`

	// ForceUpgrade indicates whether or not application
	// units should upgrade to the charm even if they
	// are in an error state.
	ForceUpgrade bool `json:"force-upgrade,omitempty"`

	// SHA256 holds the SHA256 hash of the charm archive.
	SHA256 string `json:"sha256"`

	// CharmModifiedVersion increases when the charm changes in some way.
	CharmModifiedVersion int `json:"charm-modified-version"`

	// DeploymentMode is either "operator" or "workload"
	DeploymentMode string `json:"deployment-mode,omitempty"`
}

ApplicationCharmInfo contains information about an application's charm.

type ApplicationCharmActionsResult

type ApplicationCharmActionsResult struct {
	ApplicationTag string                `json:"application-tag,omitempty"`
	Actions        map[string]ActionSpec `json:"actions,omitempty"`
	Error          *Error                `json:"error,omitempty"`
}

ApplicationCharmActionsResult holds application name and charm.Actions for the application. If an error such as a missing charm or malformed application name occurs, it is encapsulated in this type.

type ApplicationCharmRelations

type ApplicationCharmRelations struct {
	ApplicationName string `json:"application"`
}

ApplicationCharmRelations holds parameters for making the application CharmRelations call.

type ApplicationCharmRelationsResults

type ApplicationCharmRelationsResults struct {
	CharmRelations []string `json:"charm-relations"`
}

ApplicationCharmRelationsResults holds the results of the application CharmRelations call.

type ApplicationCharmResult

type ApplicationCharmResult struct {
	Result *ApplicationCharm `json:"result,omitempty"`
	Error  *Error            `json:"error,omitempty"`
}

ApplicationCharmResult contains an ApplicationCharm or an error.

type ApplicationCharmResults

type ApplicationCharmResults struct {
	Results []ApplicationCharmResult `json:"results"`
}

ApplicationCharmResults contains a set of ApplicationCharmResults.

type ApplicationConfigSet

type ApplicationConfigSet struct {
	ApplicationName string `json:"application"`

	// Generation is the generation version that this request
	// will set application configuration for.
	Generation string `json:"generation"`

	Config map[string]string `json:"config"`
}

ApplicationConfigSet holds the parameters for an application config set command.

type ApplicationConfigSetArgs

type ApplicationConfigSetArgs struct {
	Args []ApplicationConfigSet
}

ApplicationConfigSetArgsV12 holds the parameters for setting application config values for specified applications.

type ApplicationConfigUnsetArgs

type ApplicationConfigUnsetArgs struct {
	Args []ApplicationUnset
}

ApplicationConfigUnsetArgs holds the parameters for resetting application config values for specified applications.

type ApplicationConstraint

type ApplicationConstraint struct {
	Constraints constraints.Value `json:"constraints"`
	Error       *Error            `json:"error,omitempty"`
}

ApplicationConstraint holds the constraints value for a single application, or an error for trying to get it.

type ApplicationDeploy

type ApplicationDeploy struct {
	ApplicationName  string                         `json:"application"`
	Series           string                         `json:"series"`
	CharmURL         string                         `json:"charm-url"`
	CharmOrigin      *CharmOrigin                   `json:"charm-origin,omitempty"`
	Channel          string                         `json:"channel"`
	NumUnits         int                            `json:"num-units"`
	Config           map[string]string              `json:"config,omitempty"` // Takes precedence over yaml entries if both are present.
	ConfigYAML       string                         `json:"config-yaml"`
	Constraints      constraints.Value              `json:"constraints"`
	Placement        []*instance.Placement          `json:"placement,omitempty"`
	Policy           string                         `json:"policy,omitempty"`
	Storage          map[string]storage.Constraints `json:"storage,omitempty"`
	Devices          map[string]devices.Constraints `json:"devices,omitempty"`
	AttachStorage    []string                       `json:"attach-storage,omitempty"`
	EndpointBindings map[string]string              `json:"endpoint-bindings,omitempty"`
	Resources        map[string]string              `json:"resources,omitempty"`
}

ApplicationDeploy holds the parameters for making the application Deploy call.

type ApplicationDeployV12

type ApplicationDeployV12 struct {
	ApplicationName  string                         `json:"application"`
	Series           string                         `json:"series"`
	CharmURL         string                         `json:"charm-url"`
	Channel          string                         `json:"channel"`
	NumUnits         int                            `json:"num-units"`
	Config           map[string]string              `json:"config,omitempty"`
	ConfigYAML       string                         `json:"config-yaml"` // Takes precedence over config if both are present.
	Constraints      constraints.Value              `json:"constraints"`
	Placement        []*instance.Placement          `json:"placement,omitempty"`
	Policy           string                         `json:"policy,omitempty"`
	Storage          map[string]storage.Constraints `json:"storage,omitempty"`
	Devices          map[string]devices.Constraints `json:"devices,omitempty"`
	AttachStorage    []string                       `json:"attach-storage,omitempty"`
	EndpointBindings map[string]string              `json:"endpoint-bindings,omitempty"`
	Resources        map[string]string              `json:"resources,omitempty"`
}

ApplicationDeployV12 holds the parameters for making the application Deploy call for application facades older than v12. Missing the newer CharmOrigin.

type ApplicationDeployV5

type ApplicationDeployV5 struct {
	ApplicationName  string                         `json:"application"`
	Series           string                         `json:"series"`
	CharmURL         string                         `json:"charm-url"`
	Channel          string                         `json:"channel"`
	NumUnits         int                            `json:"num-units"`
	Config           map[string]string              `json:"config,omitempty"`
	ConfigYAML       string                         `json:"config-yaml"`
	Constraints      constraints.Value              `json:"constraints"`
	Placement        []*instance.Placement          `json:"placement,omitempty"`
	Storage          map[string]storage.Constraints `json:"storage,omitempty"`
	AttachStorage    []string                       `json:"attach-storage,omitempty"`
	EndpointBindings map[string]string              `json:"endpoint-bindings,omitempty"`
	Resources        map[string]string              `json:"resources,omitempty"`
}

ApplicationDeployV5 holds the parameters for making the application Deploy call for application facades older than v6. Missing the newer Policy arg.

type ApplicationDeployV6

type ApplicationDeployV6 struct {
	ApplicationName  string                         `json:"application"`
	Series           string                         `json:"series"`
	CharmURL         string                         `json:"charm-url"`
	Channel          string                         `json:"channel"`
	NumUnits         int                            `json:"num-units"`
	Config           map[string]string              `json:"config,omitempty"` // Takes precedence over yaml entries if both are present.
	ConfigYAML       string                         `json:"config-yaml"`
	Constraints      constraints.Value              `json:"constraints"`
	Placement        []*instance.Placement          `json:"placement,omitempty"`
	Policy           string                         `json:"policy,omitempty"`
	Storage          map[string]storage.Constraints `json:"storage,omitempty"`
	AttachStorage    []string                       `json:"attach-storage,omitempty"`
	EndpointBindings map[string]string              `json:"endpoint-bindings,omitempty"`
	Resources        map[string]string              `json:"resources,omitempty"`
}

ApplicationDeployV6 holds the parameters for making the application Deploy call for application facades older than v6. Missing the newer Device arg.

type ApplicationDestroy

type ApplicationDestroy struct {
	ApplicationName string `json:"application"`
}

ApplicationDestroy holds the parameters for making the deprecated Application.Destroy call.

type ApplicationExpose

type ApplicationExpose struct {
	ApplicationName string `json:"application"`

	// Expose parameters grouped by endpoint name. An empty ("") endpoint
	// name key represents all application endpoints. For compatibility
	// with pre 2.9 clients, if this field is empty, all opened ports
	// for the application will be exposed to 0.0.0.0/0.
	ExposedEndpoints map[string]ExposedEndpoint `json:"exposed-endpoints,omitempty"`
}

ApplicationExpose holds the parameters for making the application Expose call.

type ApplicationGet

type ApplicationGet struct {
	ApplicationName string `json:"application"`

	// BranchName identifies the "in-flight" branch that this
	// request will retrieve application data for.
	BranchName string `json:"branch"`
}

ApplicationGet holds parameters for making the singular Get or GetCharmURL calls, and bulk calls to CharmConfig in the V9 API.

type ApplicationGetArgs

type ApplicationGetArgs struct {
	Args []ApplicationGet `json:"args"`
}

ApplicationGetArgs is used to request config for multiple application/generation pairs.

type ApplicationGetConfigResults

type ApplicationGetConfigResults struct {
	Results []ConfigResult
}

ApplicationGetConfigResults holds the return values for application GetConfig.

type ApplicationGetConstraintsResults

type ApplicationGetConstraintsResults struct {
	Results []ApplicationConstraint `json:"results"`
}

ApplicationGetConstraintsResults holds the multiple return values for GetConstraints call.

type ApplicationGetResults

type ApplicationGetResults struct {
	Application       string                 `json:"application"`
	Charm             string                 `json:"charm"`
	CharmConfig       map[string]interface{} `json:"config"`
	ApplicationConfig map[string]interface{} `json:"application-config,omitempty"`
	Constraints       constraints.Value      `json:"constraints"`
	Series            string                 `json:"series"`
	Channel           string                 `json:"channel"`
	EndpointBindings  map[string]string      `json:"endpoint-bindings,omitempty"`
}

ApplicationGetResults holds results of the application Get call.

type ApplicationInfo

type ApplicationInfo struct {
	ModelUUID       string                 `json:"model-uuid"`
	Name            string                 `json:"name"`
	Exposed         bool                   `json:"exposed"`
	CharmURL        string                 `json:"charm-url"`
	OwnerTag        string                 `json:"owner-tag"`
	Life            life.Value             `json:"life"`
	MinUnits        int                    `json:"min-units"`
	Constraints     constraints.Value      `json:"constraints"`
	Config          map[string]interface{} `json:"config,omitempty"`
	Subordinate     bool                   `json:"subordinate"`
	Status          StatusInfo             `json:"status"`
	WorkloadVersion string                 `json:"workload-version"`
}

ApplicationInfo holds the information about an application that is tracked by multiwatcherStore.

func (*ApplicationInfo) EntityId

func (i *ApplicationInfo) EntityId() EntityId

EntityId returns a unique identifier for an application across models.

type ApplicationInfoResult

type ApplicationInfoResult struct {
	Result *ApplicationResult `json:"result,omitempty"`
	Error  *Error             `json:"error,omitempty"`
}

ApplicationInfoResults holds an application info result or a retrieval error.

type ApplicationInfoResults

type ApplicationInfoResults struct {
	Results []ApplicationInfoResult `json:"results"`
}

ApplicationInfoResults holds applications associated with entities.

type ApplicationMergeBindings

type ApplicationMergeBindings struct {
	ApplicationTag string            `json:"application-tag"`
	Bindings       map[string]string `json:"bindings"`
	Force          bool              `json:"force"`
}

ApplicationMergeBindings holds a list of operator-defined bindings to be merged with the current application bindings.

type ApplicationMergeBindingsArgs

type ApplicationMergeBindingsArgs struct {
	Args []ApplicationMergeBindings `json:"args"`
}

ApplicationMergeBindingsArgs holds the parameters for updating application bindings.

type ApplicationMetricCredential

type ApplicationMetricCredential struct {
	ApplicationName   string `json:"application"`
	MetricCredentials []byte `json:"metrics-credentials"`
}

ApplicationMetricCredential holds parameters for the SetApplicationCredentials call.

type ApplicationMetricCredentials

type ApplicationMetricCredentials struct {
	Creds []ApplicationMetricCredential `json:"creds"`
}

ApplicationMetricCredentials holds multiple ApplicationMetricCredential parameters.

type ApplicationOfferAdminDetails

type ApplicationOfferAdminDetails struct {
	ApplicationOfferDetails
	ApplicationName string            `json:"application-name"`
	CharmURL        string            `json:"charm-url"`
	Connections     []OfferConnection `json:"connections,omitempty"`
}

ApplicationOfferAdminDetails represents an application offering, including details about how it has been deployed.

type ApplicationOfferDetails

type ApplicationOfferDetails struct {
	SourceModelTag         string             `json:"source-model-tag"`
	OfferUUID              string             `json:"offer-uuid"`
	OfferURL               string             `json:"offer-url"`
	OfferName              string             `json:"offer-name"`
	ApplicationDescription string             `json:"application-description"`
	Endpoints              []RemoteEndpoint   `json:"endpoints,omitempty"`
	Spaces                 []RemoteSpace      `json:"spaces,omitempty"`
	Bindings               map[string]string  `json:"bindings,omitempty"`
	Users                  []OfferUserDetails `json:"users,omitempty"`
}

ApplicationOfferDetails represents an application offering from an external model.

type ApplicationOfferInfo

type ApplicationOfferInfo struct {
	ModelUUID            string `json:"model-uuid"`
	OfferName            string `json:"offer-name"`
	OfferUUID            string `json:"offer-uuid"`
	ApplicationName      string `json:"application-name"`
	CharmName            string `json:"charm-name"`
	TotalConnectedCount  int    `json:"total-connected-count"`
	ActiveConnectedCount int    `json:"active-connected-count"`
}

ApplicationOfferInfo holds the information about an application offer that is tracked by multiwatcherStore.

func (*ApplicationOfferInfo) EntityId

func (i *ApplicationOfferInfo) EntityId() EntityId

EntityId returns a unique identifier for an application offer across models.

type ApplicationOfferResult

type ApplicationOfferResult struct {
	// Result contains application offer information.
	Result *ApplicationOfferAdminDetails `json:"result,omitempty"`

	// Error contains related error.
	Error *Error `json:"error,omitempty"`
}

ApplicationOfferResult is a result of querying a remote application offer based on its URL.

type ApplicationOfferStatus

type ApplicationOfferStatus struct {
	Err                  *Error                    `json:"err,omitempty"`
	OfferName            string                    `json:"offer-name"`
	ApplicationName      string                    `json:"application-name"`
	CharmURL             string                    `json:"charm"`
	Endpoints            map[string]RemoteEndpoint `json:"endpoints"`
	ActiveConnectedCount int                       `json:"active-connected-count"`
	TotalConnectedCount  int                       `json:"total-connected-count"`
}

ApplicationOfferStatus holds status info about an application offer.

type ApplicationOffersResults

type ApplicationOffersResults struct {
	// Results contains collection of remote application results.
	Results []ApplicationOfferResult `json:"results,omitempty"`
}

ApplicationOffersResults is a result of listing remote application offers.

type ApplicationResult

type ApplicationResult struct {
	Tag              string                     `json:"tag"`
	Charm            string                     `json:"charm,omitempty"`
	Series           string                     `json:"series,omitempty"`
	Channel          string                     `json:"channel,omitempty"`
	Constraints      constraints.Value          `json:"constraints,omitempty"`
	Principal        bool                       `json:"principal"`
	Exposed          bool                       `json:"exposed"`
	Remote           bool                       `json:"remote"`
	EndpointBindings map[string]string          `json:"endpoint-bindings,omitempty"`
	ExposedEndpoints map[string]ExposedEndpoint `json:"exposed-endpoints,omitempty"`
}

ApplicationResult holds an application info. NOTE: we should look to combine ApplicationResult and ApplicationInfo.

type ApplicationSet

type ApplicationSet struct {
	ApplicationName string `json:"application"`

	// BranchName identifies the "in-flight" branch that this
	// request will set configuration for.
	BranchName string `json:"branch"`

	Options map[string]string `json:"options"`
}

ApplicationSet holds the parameters for an application Set command. Options contains the configuration data.

type ApplicationSetCharm

type ApplicationSetCharm struct {
	// ApplicationName is the name of the application to set the charm on.
	ApplicationName string `json:"application"`

	// Generation is the generation version that this
	// request will set the application charm for.
	Generation string `json:"generation"`

	// CharmURL is the new url for the charm.
	CharmURL string `json:"charm-url"`

	// CharmOrigin is the charm origin
	CharmOrigin *CharmOrigin `json:"charm-origin,omitempty"`

	// Channel is the charm store channel from which the charm came.
	Channel string `json:"channel"`

	// ConfigSettings is the charm settings to set during the upgrade.
	// This field is only understood by Application facade version 2
	// and greater.
	ConfigSettings map[string]string `json:"config-settings,omitempty"`

	// ConfigSettingsYAML is the charm settings in YAML format to set
	// during the upgrade. If this is non-empty, it will take precedence
	// over ConfigSettings. This field is only understood by Application
	// facade version 2
	ConfigSettingsYAML string `json:"config-settings-yaml,omitempty"`

	// Force forces the lxd profile validation overriding even if it's fails.
	Force bool `json:"force"`

	// ForceUnits forces the upgrade on units in an error state.
	ForceUnits bool `json:"force-units"`

	// ForceSeries forces the use of the charm even if it doesn't match the
	// series of the unit.
	ForceSeries bool `json:"force-series"`

	// ResourceIDs is a map of resource names to resource IDs to activate during
	// the upgrade.
	ResourceIDs map[string]string `json:"resource-ids,omitempty"`

	// StorageConstraints is a map of storage names to storage constraints to
	// update during the upgrade. This field is only understood by Application
	// facade version 2 and greater.
	StorageConstraints map[string]StorageConstraints `json:"storage-constraints,omitempty"`

	// EndpointBindings is a map of operator-defined endpoint names to
	// space names to be merged with any existing endpoint bindings. This
	// field is only understood by Application facade version 10 and greater.
	EndpointBindings map[string]string `json:"endpoint-bindings,omitempty"`
}

ApplicationSetCharm sets the charm for a given application.

type ApplicationSetCharmV12

type ApplicationSetCharmV12 struct {
	// ApplicationName is the name of the application to set the charm on.
	ApplicationName string `json:"application"`

	// Generation is the generation version that this
	// request will set the application charm for.
	Generation string `json:"generation"`

	// CharmURL is the new url for the charm.
	CharmURL string `json:"charm-url"`

	// Channel is the charm store channel from which the charm came.
	Channel string `json:"channel"`

	// ConfigSettings is the charm settings to set during the upgrade.
	// This field is only understood by Application facade version 2
	// and greater.
	ConfigSettings map[string]string `json:"config-settings,omitempty"`

	// ConfigSettingsYAML is the charm settings in YAML format to set
	// during the upgrade. If this is non-empty, it will take precedence
	// over ConfigSettings. This field is only understood by Application
	// facade version 2
	ConfigSettingsYAML string `json:"config-settings-yaml,omitempty"`

	// Force forces the lxd profile validation overriding even if it's fails.
	Force bool `json:"force"`

	// ForceUnits forces the upgrade on units in an error state.
	ForceUnits bool `json:"force-units"`

	// ForceSeries forces the use of the charm even if it doesn't match the
	// series of the unit.
	ForceSeries bool `json:"force-series"`

	// ResourceIDs is a map of resource names to resource IDs to activate during
	// the upgrade.
	ResourceIDs map[string]string `json:"resource-ids,omitempty"`

	// StorageConstraints is a map of storage names to storage constraints to
	// update during the upgrade. This field is only understood by Application
	// facade version 2 and greater.
	StorageConstraints map[string]StorageConstraints `json:"storage-constraints,omitempty"`

	// EndpointBindings is a map of operator-defined endpoint names to
	// space names to be merged with any existing endpoint bindings. This
	// field is only understood by Application facade version 10 and greater.
	EndpointBindings map[string]string `json:"endpoint-bindings,omitempty"`
}

ApplicationSetCharmV12 sets the charm for a given application for application facades older than v12. Missing the newer CharmOrigin.

type ApplicationStatus

type ApplicationStatus struct {
	Err              *Error                 `json:"err,omitempty"`
	Charm            string                 `json:"charm"`
	Series           string                 `json:"series"`
	Exposed          bool                   `json:"exposed"`
	Life             life.Value             `json:"life"`
	Relations        map[string][]string    `json:"relations"`
	CanUpgradeTo     string                 `json:"can-upgrade-to"`
	SubordinateTo    []string               `json:"subordinate-to"`
	Units            map[string]UnitStatus  `json:"units"`
	MeterStatuses    map[string]MeterStatus `json:"meter-statuses"`
	Status           DetailedStatus         `json:"status"`
	WorkloadVersion  string                 `json:"workload-version"`
	CharmVersion     string                 `json:"charm-version"`
	CharmProfile     string                 `json:"charm-profile"`
	EndpointBindings map[string]string      `json:"endpoint-bindings"`

	// The following are for CAAS models.
	Scale         int    `json:"int,omitempty"`
	ProviderId    string `json:"provider-id,omitempty"`
	PublicAddress string `json:"public-address"`
}

ApplicationStatus holds status info about an application.

func (ApplicationStatus) MarshalJSON

func (as ApplicationStatus) MarshalJSON() ([]byte, error)

TODO(wallyworld) - remove in Juju 3 MarshalJSON marshals a status with a typo left in for compatibility.

type ApplicationStatusResult

type ApplicationStatusResult struct {
	Application StatusResult            `json:"application"`
	Units       map[string]StatusResult `json:"units"`
	Error       *Error                  `json:"error,omitempty"`
}

ApplicationStatusResult holds results for an application Full Status.

type ApplicationStatusResults

type ApplicationStatusResults struct {
	Results []ApplicationStatusResult `json:"results"`
}

ApplicationStatusResults holds multiple StatusResult.

type ApplicationUnexpose

type ApplicationUnexpose struct {
	ApplicationName string `json:"application"`

	// A list of endpoints to unexpose. If empty, the entire application
	// will be unexposed.
	ExposedEndpoints []string `json:"exposed-endpoints"`
}

ApplicationUnexpose holds parameters for the application Unexpose call.

type ApplicationUnitInfo

type ApplicationUnitInfo struct {
	ProviderId string `json:"provider-id"`
	UnitTag    string `json:"unit-tag"`
}

ApplicationUnitInfo holds info about the unit in the application.

type ApplicationUnitParams

type ApplicationUnitParams struct {
	ProviderId     string                     `json:"provider-id"`
	UnitTag        string                     `json:"unit-tag"`
	Address        string                     `json:"address"`
	Ports          []string                   `json:"ports"`
	Stateful       bool                       `json:"stateful,omitempty"`
	FilesystemInfo []KubernetesFilesystemInfo `json:"filesystem-info,omitempty"`
	Status         string                     `json:"status"`
	Info           string                     `json:"info"`
	Data           map[string]interface{}     `json:"data,omitempty"`
}

ApplicationUnitParams holds unit parameters used to update a unit.

type ApplicationUnset

type ApplicationUnset struct {
	ApplicationName string `json:"application"`

	// BranchName identifies the "in-flight" branch that this
	// request will unset configuration for.
	BranchName string `json:"branch"`

	Options []string `json:"options"`
}

ApplicationUnset holds the parameters for an application Unset command. Options contains the option attribute names to unset.

type ApplicationUpdate

type ApplicationUpdate struct {
	ApplicationName string             `json:"application"`
	CharmURL        string             `json:"charm-url"`
	ForceCharmURL   bool               `json:"force-charm-url"`
	ForceSeries     bool               `json:"force-series"`
	Force           bool               `json:"force"`
	MinUnits        *int               `json:"min-units,omitempty"`
	SettingsStrings map[string]string  `json:"settings,omitempty"` // Takes precedence over yaml entries if both are present.
	SettingsYAML    string             `json:"settings-yaml"`
	Constraints     *constraints.Value `json:"constraints,omitempty"`

	// Generation is the generation version in which this
	// request will update the application.
	Generation string `json:"generation"`
}

ApplicationUpdate holds the parameters for making the application Update call.

type ApplicationsCharmActionsResults

type ApplicationsCharmActionsResults struct {
	Results []ApplicationCharmActionsResult `json:"results,omitempty"`
}

ApplicationsCharmActionsResults holds a slice of ApplicationCharmActionsResult for a bulk result of charm Actions for Applications.

type ApplicationsDeploy

type ApplicationsDeploy struct {
	Applications []ApplicationDeploy `json:"applications"`
}

ApplicationsDeploy holds the parameters for deploying one or more applications.

type ApplicationsDeployV12

type ApplicationsDeployV12 struct {
	Applications []ApplicationDeployV12 `json:"applications"`
}

ApplicationsDeployV12 holds the parameters for deploying one or more applications.

type ApplicationsDeployV5

type ApplicationsDeployV5 struct {
	Applications []ApplicationDeployV5 `json:"applications"`
}

ApplicationsDeployV5 holds the parameters for deploying one or more applications.

type ApplicationsDeployV6

type ApplicationsDeployV6 struct {
	Applications []ApplicationDeployV6 `json:"applications"`
}

ApplicationsDeployV6 holds the parameters for deploying one or more applications.

type AuthUserInfo

type AuthUserInfo struct {
	DisplayName    string     `json:"display-name"`
	Identity       string     `json:"identity"`
	LastConnection *time.Time `json:"last-connection,omitempty"`

	// Credentials contains an optional opaque credential value to be held by
	// the client, if any.
	Credentials *string `json:"credentials,omitempty"`

	// ControllerAccess holds the access the user has to the connected controller.
	// It will be empty if the user has no access to the controller.
	ControllerAccess string `json:"controller-access"`

	// ModelAccess holds the access the user has to the connected model.
	ModelAccess string `json:"model-access"`
}

AuthUserInfo describes a logged-in local user or remote identity.

type BackupsCreateArgs

type BackupsCreateArgs struct {
	Notes      string `json:"notes"`
	KeepCopy   bool   `json:"keep-copy"`
	NoDownload bool   `json:"no-download"`
}

BackupsCreateArgs holds the args for the API Create method.

type BackupsDownloadArgs

type BackupsDownloadArgs struct {
	ID string `json:"id"`
}

BackupsDownloadArgs holds the args for the API Download method.

type BackupsInfoArgs

type BackupsInfoArgs struct {
	ID string `json:"id"`
}

BackupsInfoArgs holds the args for the API Info method.

type BackupsListArgs

type BackupsListArgs struct {
}

BackupsListArgs holds the args for the API List method.

type BackupsListResult

type BackupsListResult struct {
	List []BackupsMetadataResult `json:"list"`
}

BackupsListResult holds the list of all stored backups.

type BackupsMetadataResult

type BackupsMetadataResult struct {
	ID string `json:"id"`

	Checksum       string    `json:"checksum"`
	ChecksumFormat string    `json:"checksum-format"`
	Size           int64     `json:"size"`
	Stored         time.Time `json:"stored"` // May be zero...

	Started  time.Time      `json:"started"`
	Finished time.Time      `json:"finished"` // May be zero...
	Notes    string         `json:"notes"`
	Model    string         `json:"model"`
	Machine  string         `json:"machine"`
	Hostname string         `json:"hostname"`
	Version  version.Number `json:"version"`
	Series   string         `json:"series"`

	CACert       string `json:"ca-cert"`
	CAPrivateKey string `json:"ca-private-key"`
	Filename     string `json:"filename"`

	// FormatVersion stores the version of the backup format.
	// All unversioned backup files are considered 0,
	// so the versioned formats start at 1.
	FormatVersion int64 `json:"format-version"`

	// ControllerUUID is the controller UUID that is backed up.
	ControllerUUID string `json:"controller-uuid"`

	// ControllerMachineID is the controller machine ID that the backup was created on.
	ControllerMachineID string `json:"controller-machine-id"`

	// ControllerMachineInstanceID is the controller machine cloud instance ID that the backup was created on.
	ControllerMachineInstanceID string `json:"controller-machine-inst-id"`

	// HANodes reflects HA configuration: number of controller nodes in HA.
	HANodes int64 `json:"ha-nodes"`
}

BackupsMetadataResult holds the metadata for a backup as returned by an API backups method (such as Create).

type BackupsRemoveArgs

type BackupsRemoveArgs struct {
	IDs []string `json:"ids"`
}

BackupsRemoveArgs holds the args for the API Remove method.

type BackupsUploadArgs

type BackupsUploadArgs struct {
	Data     []byte                `json:"data"`
	Metadata BackupsMetadataResult `json:"metadata"`
}

BackupsUploadArgs holds the args for the API Upload method.

type BackupsUploadResult

type BackupsUploadResult struct {
	ID string `json:"id"`
}

BackupsListResult holds the list of all stored backups.

type Block

type Block struct {
	// Id is this blocks id.
	Id string `json:"id"`

	// Tag holds the tag of the entity that is blocked.
	Tag string `json:"tag"`

	// Type is block type as per model.BlockType.
	// Valid types are "BlockDestroy", "BlockRemove" and "BlockChange".
	Type string `json:"type"`

	// Message is a descriptive or an explanatory message
	// that the block was created with.
	Message string `json:"message,omitempty"`
}

Block describes a Juju block that protects model from corruption.

type BlockDeviceResult

type BlockDeviceResult struct {
	Result storage.BlockDevice `json:"result"`
	Error  *Error              `json:"error,omitempty"`
}

BlockDeviceResult holds the result of an API call to retrieve details of a block device.

type BlockDeviceResults

type BlockDeviceResults struct {
	Results []BlockDeviceResult `json:"results,omitempty"`
}

BlockDeviceResults holds the result of an API call to retrieve details of multiple block devices.

type BlockDevicesResult

type BlockDevicesResult struct {
	Result []storage.BlockDevice `json:"result"`
	Error  *Error                `json:"error,omitempty"`
}

BlockDevicesResult holds the result of an API call to retrieve details of all block devices relating to some entity.

type BlockDevicesResults

type BlockDevicesResults struct {
	Results []BlockDevicesResult `json:"results,omitempty"`
}

BlockDevicseResults holds the result of an API call to retrieve details of all block devices relating to some entities.

type BlockInfo

type BlockInfo struct {
	ModelUUID string          `json:"model-uuid"`
	Id        string          `json:"id"`
	Type      model.BlockType `json:"type"`
	Message   string          `json:"message"`
	Tag       string          `json:"tag"`
}

BlockInfo holds the information about a block that is tracked by multiwatcherStore.

func (*BlockInfo) EntityId

func (i *BlockInfo) EntityId() EntityId

EntityId returns a unique identifier for a block across models.

type BlockResult

type BlockResult struct {
	Result Block  `json:"result"`
	Error  *Error `json:"error,omitempty"`
}

BlockResult holds the result of an API call to retrieve details for a block.

type BlockResults

type BlockResults struct {
	Results []BlockResult `json:"results,omitempty"`
}

BlockResults holds the result of an API call to list blocks.

type BlockSwitchParams

type BlockSwitchParams struct {
	// Type is block type as per model.BlockType.
	// Valid types are "BlockDestroy", "BlockRemove" and "BlockChange".
	Type string `json:"type"`

	// Message is a descriptive or an explanatory message
	// that accompanies the switch.
	Message string `json:"message,omitempty"`
}

BlockSwitchParams holds the parameters for switching a block on/off.

type BoolResult

type BoolResult struct {
	Error  *Error `json:"error,omitempty"`
	Result bool   `json:"result"`
}

BoolResult holds the result of an API call that returns a a boolean or an error.

type BoolResults

type BoolResults struct {
	Results []BoolResult `json:"results"`
}

BoolResults holds multiple results with BoolResult each.

type BranchArg

type BranchArg struct {
	BranchName string `json:"branch"`
}

BranchArg represents an in-flight branch via its model and branch name.

type BranchInfo

type BranchInfo struct {
	ModelUUID     string                  `json:"model-uuid"`
	Id            string                  `json:"id"`
	Name          string                  `json:"name"`
	AssignedUnits map[string][]string     `json:"assigned-units"`
	Config        map[string][]ItemChange `json:"charm-config"`
	Created       int64                   `json:"created"`
	CreatedBy     string                  `json:"created-by"`
	Completed     int64                   `json:"completed"`
	CompletedBy   string                  `json:"completed-by"`
	GenerationId  int                     `json:"generation-id"`
}

BranchInfo holds data about a model generation (branch) that is tracked by multiwatcherStore.

func (*BranchInfo) EntityId

func (i *BranchInfo) EntityId() EntityId

EntityId returns a unique identifier for a generation.

type BranchInfoArgs

type BranchInfoArgs struct {
	// BranchNames is the names of branches for which info is being requested.
	BranchNames []string `json:"branches"`

	// Detailed indicates whether full unit tracking detail should returned,
	// or a summary.
	Detailed bool `json:"detailed"`
}

BranchInfoArgs transports arguments to the BranchInfo method

type BranchResults

type BranchResults struct {
	// Generations holds the details of the requested generations.
	Generations []Generation `json:"generations"`

	// Error holds the value of any error that occurred processing the request.
	Error *Error `json:"error,omitempty"`
}

BranchResults transports a collection of generation details.

type BranchStatus

type BranchStatus struct {
	AssignedUnits map[string][]string `json:"assigned-units"`
	Created       int64               `json:"created"`
	CreatedBy     string              `json:"created-by"`
}

BranchStatus holds the results for an branch Full Status.

type BranchTrackArg

type BranchTrackArg struct {
	BranchName string   `json:"branch"`
	Entities   []Entity `json:"entities"`
	NumUnits   int      `json:"num-units,omitempty"`
}

BranchTrackArg identifies an in-flight branch and a collection of entities that should be set to track changes made under the branch.

type BulkImportStorageParams

type BulkImportStorageParams struct {
	Storage []ImportStorageParams `json:"storage"`
}

BulkImportStorageParams contains the parameters for importing a collection of storage entities.

type BundleChange

type BundleChange struct {
	// Id is the unique identifier for this change.
	Id string `json:"id"`
	// Method is the action to be performed to apply this change.
	Method string `json:"method"`
	// Args holds a list of arguments to pass to the method.
	Args []interface{} `json:"args"`
	// Requires holds a list of dependencies for this change. Each dependency
	// is represented by the corresponding change id, and must be applied
	// before this change is applied.
	Requires []string `json:"requires"`
}

BundleChange holds a single change required to deploy a bundle.

type BundleChangesMapArgs

type BundleChangesMapArgs struct {
	// Id is the unique identifier for this change.
	Id string `json:"id"`
	// Method is the action to be performed to apply this change.
	Method string `json:"method"`
	// Args holds a list of arguments to pass to the method.
	Args map[string]interface{} `json:"args"`
	// Requires holds a list of dependencies for this change. Each dependency
	// is represented by the corresponding change id, and must be applied
	// before this change is applied.
	Requires []string `json:"requires"`
}

BundleChangesMapArgs holds a single change required to deploy a bundle. BundleChangesMapArgs has Args represented as a map of arguments rather than a series.

type BundleChangesMapArgsResults

type BundleChangesMapArgsResults struct {
	// Changes holds the list of changes required to deploy the bundle.
	// It is omitted if the provided bundle YAML has verification errors.
	Changes []*BundleChangesMapArgs `json:"changes,omitempty"`
	// Errors holds possible bundle verification errors.
	Errors []string `json:"errors,omitempty"`
}

BundleChangesMapArgsResults holds results of the Bundle.GetChanges call.

type BundleChangesParams

type BundleChangesParams struct {
	// BundleDataYAML is the YAML-encoded charm bundle data
	// (see "github.com/juju/charm.BundleData").
	BundleDataYAML string `json:"yaml"`
	BundleURL      string `json:"bundleURL"`
}

BundleChangesParams holds parameters for making Bundle.GetChanges calls.

type BundleChangesResults

type BundleChangesResults struct {
	// Changes holds the list of changes required to deploy the bundle.
	// It is omitted if the provided bundle YAML has verification errors.
	Changes []*BundleChange `json:"changes,omitempty"`
	// Errors holds possible bundle verification errors.
	Errors []string `json:"errors,omitempty"`
}

BundleChangesResults holds results of the Bundle.GetChanges call.

type BundleCharm

type BundleCharm struct {
	Name     string `json:"name"`
	Revision int    `json:"revision"`
}

type BytesResult

type BytesResult struct {
	Result []byte `json:"result"`
}

BytesResult holds the result of an API call that returns a slice of bytes.

type CIDRParams

type CIDRParams struct {
	CIDRS []string `json:"cidrs"`
}

CIDRParams contains a slice of subnet CIDRs used for querying subnets.

type CLICommandStatus

type CLICommandStatus struct {
	Output []string `json:"output,omitempty"`
	Done   bool     `json:"done,omitempty"`
	Error  *Error   `json:"error,omitempty"`
}

CLICommandStatus represents a status update for a CLI command.

type CLICommands

type CLICommands struct {
	User        string           `json:"user"`
	Credentials string           `json:"credentials,omitempty"`
	Macaroons   []macaroon.Slice `json:"macaroons,omitempty"`

	ActiveBranch string   `json:"active-branch,omitempty"`
	Commands     []string `json:"commands"`
}

CLICommands holds credentials, model and a list of CLI commands to run.

type ChangeModelCredentialParams

type ChangeModelCredentialParams struct {
	// ModelTag is a tag for the model where cloud credential change takes place.
	ModelTag string `json:"model-tag"`

	// CloudCredentialTag is the tag for the new cloud credential.
	CloudCredentialTag string `json:"credential-tag"`
}

ChangeModelCredentialParams holds the argument to replace cloud credential used by a model.

type ChangeModelCredentialsParams

type ChangeModelCredentialsParams struct {
	Models []ChangeModelCredentialParams `json:"model-credentials"`
}

ChangeModelCredentialsParams holds the arguments for changing cloud credentials on models.

type Channel

type Channel struct {
	ReleasedAt string     `json:"released-at"`
	Track      string     `json:"track"`
	Risk       string     `json:"risk"`
	Revision   int        `json:"revision"`
	Size       int        `json:"size"`
	Version    string     `json:"version"`
	Platforms  []Platform `json:"platforms"`
}

type Charm

type Charm struct {
	Revision   int                    `json:"revision"`
	URL        string                 `json:"url"`
	Config     map[string]CharmOption `json:"config"`
	Meta       *CharmMeta             `json:"meta,omitempty"`
	Actions    *CharmActions          `json:"actions,omitempty"`
	Metrics    *CharmMetrics          `json:"metrics,omitempty"`
	LXDProfile *CharmLXDProfile       `json:"lxd-profile,omitempty"`
}

Charm holds all the charm data that the client needs. To be honest, it probably returns way more than what is actually needed.

type CharmActionSpec

type CharmActionSpec struct {
	Description string                 `json:"description"`
	Params      map[string]interface{} `json:"params"`
}

CharmActionSpec mirrors charm.ActionSpec.

type CharmActions

type CharmActions struct {
	ActionSpecs map[string]CharmActionSpec `json:"specs,omitempty"`
}

CharmActions mirrors charm.Actions.

type CharmDevice

type CharmDevice struct {
	Name        string `bson:"name"`
	Description string `bson:"description"`
	Type        string `bson:"type"`
	CountMin    int64  `bson:"count-min"`
	CountMax    int64  `bson:"count-max"`
}

CharmDevice mirrors charm.Device.

type CharmHubBundle

type CharmHubBundle struct {
	Charms []BundleCharm `json:"charms,"`
}

type CharmHubCharm

type CharmHubCharm struct {
	Config      map[string]CharmOption       `json:"config"`
	Relations   map[string]map[string]string `json:"relations"`
	Subordinate bool                         `json:"subordinate"`
	UsedBy      []string                     `json:"used-by"` // bundles which use the charm
}

type CharmHubEntityFindResult

type CharmHubEntityFindResult struct {
	Results []FindResponse `json:"result"`
	Errors  ErrorResponse  `json:"errors"`
}

type CharmHubEntityInfoResult

type CharmHubEntityInfoResult struct {
	Result InfoResponse  `json:"result"`
	Errors ErrorResponse `json:"errors"`
}

type CharmHubError

type CharmHubError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type CharmInfo

type CharmInfo struct {
	ModelUUID    string     `json:"model-uuid"`
	CharmURL     string     `json:"charm-url"`
	CharmVersion string     `json:"charm-version"`
	Life         life.Value `json:"life"`
	LXDProfile   *Profile   `json:"profile"`
	// DefaultConfig is derived from state-stored *charm.Config.
	DefaultConfig map[string]interface{} `json:"config,omitempty"`
}

CharmInfo holds the information about a charm that is tracked by the multiwatcher.

func (*CharmInfo) EntityId

func (i *CharmInfo) EntityId() EntityId

EntityId returns a unique identifier for an charm across models.

type CharmLXDProfile

type CharmLXDProfile struct {
	Config      map[string]string            `json:"config"`
	Description string                       `json:"description"`
	Devices     map[string]map[string]string `json:"devices"`
}

CharmLXDProfile mirrors charm.LXDProfile

type CharmLXDProfileResult

type CharmLXDProfileResult struct {
	LXDProfile *CharmLXDProfile `json:"lxd-profile"`
}

CharmLXDProfileResult returns the result of finding the CharmLXDProfile

type CharmMeta

type CharmMeta struct {
	Name           string                       `json:"name"`
	Summary        string                       `json:"summary"`
	Description    string                       `json:"description"`
	Subordinate    bool                         `json:"subordinate"`
	Provides       map[string]CharmRelation     `json:"provides,omitempty"`
	Requires       map[string]CharmRelation     `json:"requires,omitempty"`
	Peers          map[string]CharmRelation     `json:"peers,omitempty"`
	ExtraBindings  map[string]string            `json:"extra-bindings,omitempty"`
	Categories     []string                     `json:"categories,omitempty"`
	Tags           []string                     `json:"tags,omitempty"`
	Series         []string                     `json:"series,omitempty"`
	Storage        map[string]CharmStorage      `json:"storage,omitempty"`
	Devices        map[string]CharmDevice       `json:"devices,omitempty"`
	PayloadClasses map[string]CharmPayloadClass `json:"payload-classes,omitempty"`
	Resources      map[string]CharmResourceMeta `json:"resources,omitempty"`
	Terms          []string                     `json:"terms,omitempty"`
	MinJujuVersion string                       `json:"min-juju-version,omitempty"`
}

CharmMeta mirrors charm.Meta.

type CharmMetric

type CharmMetric struct {
	Type        string `json:"type"`
	Description string `json:"description"`
}

CharmMetric mirrors charm.Metric.

type CharmMetrics

type CharmMetrics struct {
	Metrics map[string]CharmMetric `json:"metrics"`
	Plan    CharmPlan              `json:"plan"`
}

CharmMetrics mirrors charm.Metrics.

type CharmOption

type CharmOption struct {
	Type        string      `json:"type"`
	Description string      `json:"description,omitempty"`
	Default     interface{} `json:"default,omitempty"`
}

CharmOption mirrors charm.Option

type CharmOrigin

type CharmOrigin struct {
	// Source is where the charm came from, Local, CharmStore or CharmHub.
	Source string `json:"source"`

	// ID is the CharmHub ID for this charm
	ID   string `json:"id"`
	Hash string `json:"hash,omitempty"`

	// Risk is the CharmHub channel risk, or the CharmStore channel value.
	Risk string `json:"risk,omitempty"`

	// Revision is the charm revision number.
	Revision *int    `json:"revision,omitempty"`
	Track    *string `json:"track,omitempty"`
}

CharmOrigin holds the parameters for the optional location of the source of the charm.

type CharmOriginResult

type CharmOriginResult struct {
	Origin CharmOrigin `json:"charm-origin"`
	Error  *Error      `json:"error,omitempty"`
}

CharmOriginResult holds the results of AddCharms calls where a CharmOrigin was used.

type CharmPayloadClass

type CharmPayloadClass struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

CharmPayloadClass mirrors charm.PayloadClass.

type CharmPlan

type CharmPlan struct {
	Required bool `json:"required"`
}

CharmPlan mirrors charm.Plan

type CharmProfilingInfoResult

type CharmProfilingInfoResult struct {
	InstanceId      instance.Id         `json:"instance-id"`
	ModelName       string              `json:"model-name"`
	ProfileChanges  []ProfileInfoResult `json:"profile-changes"`
	CurrentProfiles []string            `json:"current-profiles"`
	Error           *Error              `json:"error"`
}

CharmProfilingInfoResult contains the result based on ProfileInfoArg values to update profiles on a machine.

type CharmRelation

type CharmRelation struct {
	Name      string `json:"name"`
	Role      string `json:"role"`
	Interface string `json:"interface"`
	Optional  bool   `json:"optional"`
	Limit     int    `json:"limit"`
	Scope     string `json:"scope"`
}

CharmRelation mirrors charm.Relation.

func NewCharmRelation

func NewCharmRelation(cr charm.Relation) CharmRelation

NewCharmRelation creates a new local CharmRelation structure from the charm.Relation structure. NOTE: when we update the database to not store a charm.Relation directly in the database, this method should take the state structure type.

type CharmResource

type CharmResource struct {
	// Name identifies the resource.
	Name string `json:"name"`

	// Type is the name of the resource type.
	Type string `json:"type"`

	// Path is where the resource will be stored.
	Path string `json:"path"`

	// Description contains user-facing info about the resource.
	Description string `json:"description,omitempty"`

	// Origin is where the resource will come from.
	Origin string `json:"origin"`

	// Revision is the revision, if applicable.
	Revision int `json:"revision"`

	// Fingerprint is the SHA-384 checksum for the resource blob.
	Fingerprint []byte `json:"fingerprint"`

	// Size is the size of the resource, in bytes.
	Size int64 `json:"size"`
}

CharmResource contains the definition for a resource.

type CharmResourceMeta

type CharmResourceMeta struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Path        string `json:"path"`
	Description string `json:"description"`
}

CharmResourceMeta mirrors charm.ResourceMeta.

type CharmStorage

type CharmStorage struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Type        string   `json:"type"`
	Shared      bool     `json:"shared"`
	ReadOnly    bool     `json:"read-only"`
	CountMin    int      `json:"count-min"`
	CountMax    int      `json:"count-max"`
	MinimumSize uint64   `json:"minimum-size"`
	Location    string   `json:"location,omitempty"`
	Properties  []string `json:"properties,omitempty"`
}

CharmStorage mirrors charm.Storage.

type CharmURL

type CharmURL struct {
	URL string `json:"url"`
}

CharmURL identifies a single charm URL.

type CharmURLOriginResult

type CharmURLOriginResult struct {
	URL    string      `json:"url"`
	Origin CharmOrigin `json:"charm-origin"`
	Error  *Error      `json:"error,omitempty"`
}

CharmURLOriginResult holds the results of the charm's url and origin.

type CharmURLs

type CharmURLs struct {
	URLs []CharmURL `json:"urls"`
}

CharmURLs identifies multiple charm URLs.

type CharmsList

type CharmsList struct {
	Names []string `json:"names"`
}

CharmsList stores parameters for a charms.List call

type CharmsListResult

type CharmsListResult struct {
	CharmURLs []string `json:"charm-urls"`
}

CharmsListResult stores result from a charms.List call

type CharmsResponse

type CharmsResponse struct {
	Error string `json:"error,omitempty"`

	// ErrorCode holds the code associated with the error.
	// Ideally, Error would hold an Error object and the
	// code would be in that, but for backward compatibility,
	// we cannot do that.
	ErrorCode string `json:"error-code,omitempty"`

	// ErrorInfo holds extra information associated with the error.
	ErrorInfo map[string]interface{} `json:"error-info,omitempty"`

	CharmURL string   `json:"charm-url,omitempty"`
	Files    []string `json:"files,omitempty"`
}

CharmsResponse is the server response to charm upload or GET requests.

type ClaimLeadershipBulkParams

type ClaimLeadershipBulkParams struct {

	// Params are the parameters for making a bulk leadership claim.
	Params []ClaimLeadershipParams `json:"params"`
}

ClaimLeadershipBulkParams is a collection of parameters for making a bulk leadership claim.

type ClaimLeadershipBulkResults

type ClaimLeadershipBulkResults ErrorResults

ClaimLeadershipBulkResults is the collection of results from a bulk leadership claim.

type ClaimLeadershipParams

type ClaimLeadershipParams struct {

	// ApplicationTag is the application for which you want to make a
	// leadership claim.
	ApplicationTag string `json:"application-tag"`

	// UnitTag is the unit which is making the leadership claim.
	UnitTag string `json:"unit-tag"`

	// DurationSeconds is the number of seconds for which the lease is required.
	DurationSeconds float64 `json:"duration"`
}

ClaimLeadershipParams are the parameters needed for making a leadership claim.

type Cloud

type Cloud struct {
	Type             string                            `json:"type"`
	HostCloudRegion  string                            `json:"host-cloud-region,omitempty"`
	AuthTypes        []string                          `json:"auth-types,omitempty"`
	Endpoint         string                            `json:"endpoint,omitempty"`
	IdentityEndpoint string                            `json:"identity-endpoint,omitempty"`
	StorageEndpoint  string                            `json:"storage-endpoint,omitempty"`
	Regions          []CloudRegion                     `json:"regions,omitempty"`
	CACertificates   []string                          `json:"ca-certificates,omitempty"`
	Config           map[string]interface{}            `json:"config,omitempty"`
	RegionConfig     map[string]map[string]interface{} `json:"region-config,omitempty"`
}

Cloud holds information about a cloud.

type CloudAction

type CloudAction string

CloudAction is an action that can be performed on a cloud.

const (
	GrantCloudAccess  CloudAction = "grant"
	RevokeCloudAccess CloudAction = "revoke"
)

Actions that can be preformed on a cloud.

type CloudCredential

type CloudCredential struct {
	// AuthType is the authentication type.
	AuthType string `json:"auth-type"`

	// Attributes contains non-secret credential values.
	Attributes map[string]string `json:"attrs,omitempty"`

	// Redacted is a list of redacted attributes
	Redacted []string `json:"redacted,omitempty"`
}

CloudCredential contains a cloud credential possibly with secrets redacted.

type CloudCredentialArg

type CloudCredentialArg struct {
	CloudName      string `json:"cloud-name"`
	CredentialName string `json:"credential-name"`
}

CloudCredentialArg defines a credential in terms of its cloud and name. It is used to request detailed content for the credential stored on the controller.

func (CloudCredentialArg) IsEmpty

func (p CloudCredentialArg) IsEmpty() bool

IsEmpty returns whether a cloud credential argument is empty.

type CloudCredentialArgs

type CloudCredentialArgs struct {
	Credentials    []CloudCredentialArg `json:"credentials,omitempty"`
	IncludeSecrets bool                 `json:"include-secrets"`
}

CloudCredentialArgs defines an input required to make a valid call to get credentials content stored on the controller.

type CloudCredentialResult

type CloudCredentialResult struct {
	Result *CloudCredential `json:"result,omitempty"`
	Error  *Error           `json:"error,omitempty"`
}

CloudCredentialResult contains a CloudCredential or an error.

type CloudCredentialResults

type CloudCredentialResults struct {
	Results []CloudCredentialResult `json:"results,omitempty"`
}

CloudCredentialResults contains a set of CloudCredentialResults.

type CloudDetails

type CloudDetails struct {
	Type             string        `json:"type"`
	AuthTypes        []string      `json:"auth-types,omitempty"`
	Endpoint         string        `json:"endpoint,omitempty"`
	IdentityEndpoint string        `json:"identity-endpoint,omitempty"`
	StorageEndpoint  string        `json:"storage-endpoint,omitempty"`
	Regions          []CloudRegion `json:"regions,omitempty"`
}

CloudDetails holds information about a cloud.

type CloudImageMetadata

type CloudImageMetadata struct {
	// ImageId is an image identifier.
	ImageId string `json:"image-id"`

	// Stream contains reference to a particular stream,
	// for e.g. "daily" or "released"
	Stream string `json:"stream,omitempty"`

	// Region is the name of cloud region associated with the image.
	Region string `json:"region"`

	// Version is OS version, for e.g. "12.04".
	Version string `json:"version"`

	// Series is OS series, for e.g. "trusty".
	Series string `json:"series"`

	// Arch is the architecture for this cloud image, for e.g. "amd64"
	Arch string `json:"arch"`

	// VirtType contains the virtualisation type of the cloud image, for e.g. "pv", "hvm". "kvm".
	VirtType string `json:"virt-type,omitempty"`

	// RootStorageType contains type of root storage, for e.g. "ebs", "instance".
	RootStorageType string `json:"root-storage-type,omitempty"`

	// RootStorageSize contains size of root storage in gigabytes (GB).
	RootStorageSize *uint64 `json:"root-storage-size,omitempty"`

	// Source describes where this image is coming from: is it public? custom?
	Source string `json:"source"`

	// Priority is an importance factor for image metadata.
	// Higher number means higher priority.
	// This will allow to sort metadata by importance.
	Priority int `json:"priority"`
}

CloudImageMetadata holds cloud image metadata properties.

type CloudImageMetadataList

type CloudImageMetadataList struct {
	Metadata []CloudImageMetadata `json:"metadata,omitempty"`
}

CloudImageMetadataList holds a list of cloud image metadata.

type CloudInfo

type CloudInfo struct {
	CloudDetails `json:",inline"`

	// Users contains information about the users that have access
	// to the cloud. Administrators can see all users that have access;
	// other users can only see their own details.
	Users []CloudUserInfo `json:"users"`
}

CloudInfo holds information about a cloud and user who can access it.

type CloudInfoResult

type CloudInfoResult struct {
	Result *CloudInfo `json:"result,omitempty"`
	Error  *Error     `json:"error,omitempty"`
}

CloudInfoResult holds the result of a CloudInfo call.

type CloudInfoResults

type CloudInfoResults struct {
	Results []CloudInfoResult `json:"results"`
}

CloudInfoResults holds the result of a bulk CloudInfo call.

type CloudInstanceTypesConstraint

type CloudInstanceTypesConstraint struct {
	// CloudTag is the tag of the cloud for which instances types
	// should be returned.
	CloudTag string `json:"cloud-tag"`

	// CloudRegion is the name of the region for which instance
	// types should be returned.
	CloudRegion string `json:"region"`

	// Constraints, if specified, contains the constraints to filter
	// the instance types by. If Constraints is not specified, then
	// no filtering by constraints will take place: all instance
	// types supported by the region will be returned.
	Constraints *constraints.Value `json:"constraints,omitempty"`
}

CloudInstanceTypesConstraint contains the cloud information and constraints necessary to query for instance types on a given cloud.

type CloudInstanceTypesConstraints

type CloudInstanceTypesConstraints struct {
	Constraints []CloudInstanceTypesConstraint `json:"constraints"`
}

CloudInstanceTypesConstraints contains a slice of CloudInstanceTypesConstraint.

type CloudRegion

type CloudRegion struct {
	Name             string `json:"name"`
	Endpoint         string `json:"endpoint,omitempty"`
	IdentityEndpoint string `json:"identity-endpoint,omitempty"`
	StorageEndpoint  string `json:"storage-endpoint,omitempty"`
}

CloudRegion holds information about a cloud region.

type CloudResult

type CloudResult struct {
	Cloud *Cloud `json:"cloud,omitempty"`
	Error *Error `json:"error,omitempty"`
}

CloudResult contains a cloud definition or an error.

type CloudResults

type CloudResults struct {
	Results []CloudResult `json:"results,omitempty"`
}

CloudResults contains a set of CloudResults.

type CloudSpec

type CloudSpec struct {
	Type             string           `json:"type"`
	Name             string           `json:"name"`
	Region           string           `json:"region,omitempty"`
	Endpoint         string           `json:"endpoint,omitempty"`
	IdentityEndpoint string           `json:"identity-endpoint,omitempty"`
	StorageEndpoint  string           `json:"storage-endpoint,omitempty"`
	Credential       *CloudCredential `json:"credential,omitempty"`
	CACertificates   []string         `json:"cacertificates,omitempty"`
}

CloudSpec holds a cloud specification.

type CloudSpecResult

type CloudSpecResult struct {
	Result *CloudSpec `json:"result,omitempty"`
	Error  *Error     `json:"error,omitempty"`
}

CloudSpecResult contains a CloudSpec or an error.

type CloudSpecResults

type CloudSpecResults struct {
	Results []CloudSpecResult `json:"results,omitempty"`
}

CloudSpecResults contains a set of CloudSpecResults.

type CloudUserInfo

type CloudUserInfo struct {
	UserName    string `json:"user"`
	DisplayName string `json:"display-name"`
	Access      string `json:"access"`
}

CloudUserInfo holds information on a user who has access to a cloud. Cloud admins can see this information for all users who have access, so it should not include sensitive information.

type CloudsResult

type CloudsResult struct {
	// Clouds is a map of clouds, keyed by cloud tag.
	Clouds map[string]Cloud `json:"clouds,omitempty"`
}

CloudsResult contains a set of Clouds.

type CommitHookChangesArg

type CommitHookChangesArg struct {
	Tag string `json:"tag"`

	UpdateNetworkInfo    bool                   `json:"update-network-info"`
	RelationUnitSettings []RelationUnitSettings `json:"relation-unit-settings,omitempty"`
	OpenPorts            []EntityPortRange      `json:"open-ports,omitempty"`
	ClosePorts           []EntityPortRange      `json:"close-ports,omitempty"`
	SetUnitState         *SetUnitStateArg       `json:"unit-state,omitempty"`
	AddStorage           []StorageAddParams     `json:"add-storage,omitempty"`
	SetPodSpec           *PodSpec               `json:"pod-spec,omitempty"`
	SetRawK8sSpec        *PodSpec               `json:"set-raw-k8s-spec,omitempty"`
}

CommitHookChangesArg holds a unit tag and a list of optional uniter API call payloads that are to be executed transactionally.

type CommitHookChangesArgs

type CommitHookChangesArgs struct {
	Args []CommitHookChangesArg `json:"args"`
}

CommitHookChangesArgs serves as a container for CommitHookChangesArg objects to be processed by the controller.

type ConfigResult

type ConfigResult struct {
	Config map[string]interface{} `json:"config"`
	Error  *Error                 `json:"error,omitempty"`
}

ConfigResults holds configuration values for an entity.

type ConfigSet

type ConfigSet struct {
	ApplicationName string `json:"application"`

	// Generation is the generation version that this request
	// will set application configuration for.
	Generation string `json:"generation"`

	Config     map[string]string `json:"config"`
	ConfigYAML string            `json:"config-yaml"`
}

ConfigSet holds the parameters for an application and charm config set command.

type ConfigSetArgs

type ConfigSetArgs struct {
	Args []ConfigSet
}

ConfigSetArgs holds the parameters for setting application and charm config values for specified applications.

type ConfigSettings

type ConfigSettings map[string]interface{}

ConfigSettings holds unit, application or cham configuration settings with string keys and arbitrary values.

type ConfigSettingsResult

type ConfigSettingsResult struct {
	Error    *Error         `json:"error,omitempty"`
	Settings ConfigSettings `json:"settings"`
}

ConfigSettingsResult holds a configuration map or an error.

type ConfigSettingsResults

type ConfigSettingsResults struct {
	Results []ConfigSettingsResult `json:"results"`
}

ConfigSettingsResults holds multiple configuration maps or errors.

type ConfigValue

type ConfigValue struct {
	Value  interface{} `json:"value"`
	Source string      `json:"source"`
}

ConfigValue encapsulates a configuration value and its source.

type ConstraintsResult

type ConstraintsResult struct {
	Error       *Error            `json:"error,omitempty"`
	Constraints constraints.Value `json:"constraints"`
}

ConstraintsResult holds machine constraints or an error.

type ConstraintsResults

type ConstraintsResults struct {
	Results []ConstraintsResult `json:"results"`
}

ConstraintsResults holds multiple constraints results.

type ConsumeApplicationArg

type ConsumeApplicationArg struct {
	// The offer to be consumed.
	ApplicationOfferDetails

	// Macaroon is used for authentication.
	Macaroon *macaroon.Macaroon `json:"macaroon,omitempty"`

	// ControllerInfo contains connection details to the controller
	// hosting the offer.
	ControllerInfo *ExternalControllerInfo `json:"external-controller,omitempty"`

	// ApplicationAlias is the name of the alias to use for the application name.
	ApplicationAlias string `json:"application-alias,omitempty"`
}

ConsumeApplicationArg holds the arguments for consuming a remote application.

type ConsumeApplicationArgs

type ConsumeApplicationArgs struct {
	Args []ConsumeApplicationArg `json:"args,omitempty"`
}

ConsumeApplicationArgs is a collection of arg for consuming applications.

type ConsumeOfferDetails

type ConsumeOfferDetails struct {
	Offer          *ApplicationOfferDetails `json:"offer,omitempty"`
	Macaroon       *macaroon.Macaroon       `json:"macaroon,omitempty"`
	ControllerInfo *ExternalControllerInfo  `json:"external-controller,omitempty"`
}

ConsumeOfferDetails contains the details necessary to consume an application offer.

type ConsumeOfferDetailsArg

type ConsumeOfferDetailsArg struct {
	OfferURLs OfferURLs `json:"offer-urls"`
	UserTag   string    `json:"user-tag,omitempty"`
}

ConsumeOfferDetailsArg holds arguments for querying the details used for consuming offers.

type ConsumeOfferDetailsResult

type ConsumeOfferDetailsResult struct {
	ConsumeOfferDetails
	Error *Error `json:"error,omitempty"`
}

ConsumeOfferDetailsResult contains the details necessary to consume an application offer or an error.

type ConsumeOfferDetailsResults

type ConsumeOfferDetailsResults struct {
	Results []ConsumeOfferDetailsResult `json:"results,omitempty"`
}

ConsumeOfferDetailsResults represents the result of a ConsumeOfferDetails call.

type ContainerConfig

type ContainerConfig struct {
	ProviderType               string                 `json:"provider-type"`
	AuthorizedKeys             string                 `json:"authorized-keys"`
	SSLHostnameVerification    bool                   `json:"ssl-hostname-verification"`
	LegacyProxy                proxy.Settings         `json:"legacy-proxy"`
	JujuProxy                  proxy.Settings         `json:"juju-proxy"`
	AptProxy                   proxy.Settings         `json:"apt-proxy"`
	SnapProxy                  proxy.Settings         `json:"snap-proxy"`
	SnapStoreAssertions        string                 `json:"snap-store-assertions"`
	SnapStoreProxyID           string                 `json:"snap-store-proxy-id"`
	SnapStoreProxyURL          string                 `json:"snap-store-proxy-url"`
	AptMirror                  string                 `json:"apt-mirror"`
	CloudInitUserData          map[string]interface{} `json:"cloudinit-userdata,omitempty"`
	ContainerInheritProperties string                 `json:"container-inherit-properties,omitempty"`
	*UpdateBehavior
}

ContainerConfig contains information from the model config that is needed for container cloud-init.

type ContainerConfigV5

type ContainerConfigV5 struct {
	ProviderType               string                 `json:"provider-type"`
	AuthorizedKeys             string                 `json:"authorized-keys"`
	SSLHostnameVerification    bool                   `json:"ssl-hostname-verification"`
	Proxy                      proxy.Settings         `json:"proxy"`
	AptProxy                   proxy.Settings         `json:"apt-proxy"`
	AptMirror                  string                 `json:"apt-mirror"`
	CloudInitUserData          map[string]interface{} `json:"cloudinit-userdata,omitempty"`
	ContainerInheritProperties string                 `json:"container-inherit-properties,omitempty"`
	*UpdateBehavior
}

ContainerConfigV5 contains information from the model config that is needed for container cloud-init for version 5 provisioner api calls.

type ContainerLXDProfile

type ContainerLXDProfile struct {
	Profile CharmLXDProfile `json:"profile" yaml:"profile"`
	Name    string          `json:"name" yaml:"name"`
}

ContainerLXDProfile contains the charm.LXDProfile information in addition to the name of the profile.

type ContainerManagerConfig

type ContainerManagerConfig struct {
	ManagerConfig map[string]string `json:"config"`
}

ContainerManagerConfig contains information from the model config that is needed for configuring the container manager.

type ContainerManagerConfigParams

type ContainerManagerConfigParams struct {
	Type instance.ContainerType `json:"type"`
}

ContainerManagerConfigParams contains the parameters for the ContainerManagerConfig provisioner API call.

type ContainerProfileResult

type ContainerProfileResult struct {
	Error       *Error                 `json:"error,omitempty"`
	LXDProfiles []*ContainerLXDProfile `json:"lxd-profiles,omitempty"`
}

ContainerProfileResult returns the result of finding the CharmLXDProfile and name of the lxd profile to be used for 1 unit on the container

type ContainerProfileResults

type ContainerProfileResults struct {
	Results []ContainerProfileResult `json:"results"`
}

ContainerProfileResults returns the ContainerProfileResult for each unit to be placed on the container.

type ContainerTypeResult

type ContainerTypeResult struct {
	Type  instance.ContainerType `json:"container-type"`
	Error *Error                 `json:"error"`
}

ContainerTypeResult holds the result of a machine's ContainerType.

type ControllerAPIInfoResult

type ControllerAPIInfoResult struct {
	Addresses []string `json:"addresses"`
	CACert    string   `json:"cacert"`
	Error     *Error   `json:"error,omitempty"`
}

ControllerAPIInfoResult holds controller api address details.

type ControllerAPIInfoResults

type ControllerAPIInfoResults struct {
	Results []ControllerAPIInfoResult `json:"results"`
}

ControllerAPIInfoResults holds controller api address details results.

type ControllerAction

type ControllerAction string

ControllerAction is an action that can be performed on a model.

const (
	GrantControllerAccess  ControllerAction = "grant"
	RevokeControllerAccess ControllerAction = "revoke"
)

Actions that can be preformed on a model.

type ControllerConfig

type ControllerConfig map[string]interface{}

ControllerConfig holds a controller configuration.

type ControllerConfigResult

type ControllerConfigResult struct {
	Config ControllerConfig `json:"config"`
}

ControllerConfigResult holds controller configuration.

type ControllerConfigSet

type ControllerConfigSet struct {
	Config map[string]interface{} `json:"config"`
}

ControllerConfigSet holds new config values for Controller.ConfigSet.

type ControllerCredentialInfo

type ControllerCredentialInfo struct {
	// Content has comprehensive credential content.
	Content CredentialContent `json:"content,omitempty"`

	// Models contains models that are using ths credential.
	Models []ModelAccess `json:"models,omitempty"`
}

ControllerCredentialInfo contains everything Juju stores on the controller about the credential - its contents as well as what models use it and what access currently logged in user, a credential owner, has to these models.

type ControllerVersionResults

type ControllerVersionResults struct {
	Version   string `json:"version"`
	GitCommit string `json:"git-commit"`
}

ControllerVersionResults holds the results from an api call to get the controller's version information.

type ControllersChangeResult

type ControllersChangeResult struct {
	Result ControllersChanges `json:"result"`
	Error  *Error             `json:"error,omitempty"`
}

ControllersChangeResult contains the results of a single EnableHA API call or an error.

type ControllersChangeResults

type ControllersChangeResults struct {
	Results []ControllersChangeResult `json:"results"`
}

ControllersChangeResults contains the results of the EnableHA API call.

type ControllersChanges

type ControllersChanges struct {
	Added      []string `json:"added,omitempty"`
	Maintained []string `json:"maintained,omitempty"`
	Removed    []string `json:"removed,omitempty"`
	Converted  []string `json:"converted,omitempty"`
}

ControllersChanges lists the servers that have been added, removed or maintained in the pool as a result of an enable-ha operation.

type ControllersSpec

type ControllersSpec struct {
	NumControllers int               `json:"num-controllers"`
	Constraints    constraints.Value `json:"constraints,omitempty"`
	// Series is the series to associate with new controller machines.
	// If this is empty, then the model's default series is used.
	Series string `json:"series,omitempty"`
	// Placement defines specific machines to become new controller machines.
	Placement []string `json:"placement,omitempty"`
}

ControllersServersSpec contains arguments for the EnableHA client API call.

type ControllersSpecs

type ControllersSpecs struct {
	Specs []ControllersSpec `json:"specs"`
}

ControllersServersSpecs contains all the arguments for the EnableHA API call.

type CountedEntity

type CountedEntity string

CountedEntity identifies an entity that has a count.

const (
	Machines CountedEntity = "machines"
	Cores    CountedEntity = "cores"
	Units    CountedEntity = "units"
)

type CreateSpaceParams

type CreateSpaceParams struct {
	CIDRs      []string `json:"cidrs"`
	SpaceTag   string   `json:"space-tag"`
	Public     bool     `json:"public"`
	ProviderId string   `json:"provider-id,omitempty"`
}

CreateSpaceParams holds the space tag and at least one subnet tag required to create a new space.

type CreateSpaceParamsV4

type CreateSpaceParamsV4 struct {
	SubnetTags []string `json:"subnet-tags"`
	SpaceTag   string   `json:"space-tag"`
	Public     bool     `json:"public"`
	ProviderId string   `json:"provider-id,omitempty"`
}

CreateSpaceParams holds the space tag and at least one subnet tag required to create a new space.

type CreateSpacesParams

type CreateSpacesParams struct {
	Spaces []CreateSpaceParams `json:"spaces"`
}

CreateSpacesParams holds the arguments of the AddSpaces API call.

type CreateSpacesParamsV4

type CreateSpacesParamsV4 struct {
	Spaces []CreateSpaceParamsV4 `json:"spaces"`
}

CreateSpacesParams holds the arguments of the AddSpaces API call.

type CreateSubnetParams

type CreateSubnetParams struct {
	SubnetTag string   `json:"subnet-tag,omitempty"`
	SpaceTag  string   `json:"space-tag"`
	Zones     []string `json:"zones,omitempty"`
	VLANTag   int      `json:"vlan-tag,omitempty"`
	IsPublic  bool     `json:"is-public"`
}

CreateSubnetParams holds a subnet and space tags, vlan tag, and a list of zones to associate the subnet to.

type CreateSubnetsParams

type CreateSubnetsParams struct {
	Subnets []CreateSubnetParams `json:"subnets"`
}

CreateSubnetsParams holds the arguments of CreateSubnets API call.

type CredentialContent

type CredentialContent struct {
	// Name is the short name of the credential.
	Name string `json:"name"`

	// Cloud is the cloud name to which this credential belongs.
	Cloud string `json:"cloud"`

	// AuthType is the authentication type.
	AuthType string `json:"auth-type"`

	// Valid indicates whether credential is valid.
	Valid *bool `json:"valid,omitempty"`

	// Attributes contains credential values.
	Attributes map[string]string `json:"attrs,omitempty"`
}

CredentialContent contains a cloud credential content.

type CredentialContentResult

type CredentialContentResult struct {
	Result *ControllerCredentialInfo `json:"result,omitempty"`
	Error  *Error                    `json:"error,omitempty"`
}

CredentialContentResult contains comprehensive information about stored credential or an error.

type CredentialContentResults

type CredentialContentResults struct {
	Results []CredentialContentResult `json:"results,omitempty"`
}

CredentialContentResults contains a set of CredentialContentResults.

type Creds

type Creds struct {
	AuthTag  string `json:"auth-tag"`
	Password string `json:"password"`
	Nonce    string `json:"nonce"`
}

Creds holds credentials for identifying an entity.

type Delta

type Delta struct {
	// If Removed is true, the entity has been removed;
	// otherwise it has been created or changed.
	Removed bool `json:"removed"`
	// Entity holds data about the entity that has changed.
	Entity EntityInfo `json:"entity"`
}

Delta holds details of a change to the model.

func (*Delta) MarshalJSON

func (d *Delta) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Delta) UnmarshalJSON

func (d *Delta) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DeployerConnectionValues

type DeployerConnectionValues struct {
	APIAddresses []string `json:"api-addresses"`
}

DeployerConnectionValues containers the result of deployer.ConnectionInfo API call.

type DestroyApplicationInfo

type DestroyApplicationInfo struct {
	// DetachedStorage is the tags of storage instances that will be
	// detached from the application's units, and will remain in the
	// model after the units are removed.
	DetachedStorage []Entity `json:"detached-storage,omitempty"`

	// DestroyedStorage is the tags of storage instances that will be
	// destroyed as a result of destroying the application.
	DestroyedStorage []Entity `json:"destroyed-storage,omitempty"`

	// DestroyedUnits is the tags of units that will be destroyed
	// as a result of destroying the application.
	DestroyedUnits []Entity `json:"destroyed-units,omitempty"`
}

DestroyApplicationInfo contains information related to the removal of an application.

type DestroyApplicationOffers

type DestroyApplicationOffers struct {
	OfferURLs []string `json:"offer-urls"`
	Force     bool     `json:"force,omitempty"`
}

DestroyApplicationOffers holds parameters for the DestroyOffers call.

type DestroyApplicationParams

type DestroyApplicationParams struct {
	// ApplicationTag holds the tag of the application to destroy.
	ApplicationTag string `json:"application-tag"`

	// DestroyStorage controls whether or not storage attached to
	// units of the application should be destroyed.
	DestroyStorage bool `json:"destroy-storage,omitempty"`

	// Force controls whether or not the destruction of an application
	// will be forced, i.e. ignore operational errors.
	Force bool `json:"force"`

	// MaxWait specifies the amount of time that each step in application removal
	// 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"`
}

DestroyApplicationParams holds parameters for the Application.DestroyApplication call.

type DestroyApplicationResult

type DestroyApplicationResult struct {
	Error *Error                  `json:"error,omitempty"`
	Info  *DestroyApplicationInfo `json:"info,omitempty"`
}

DestroyApplicationResult contains one of the results of a DestroyApplication API request.

type DestroyApplicationResults

type DestroyApplicationResults struct {
	Results []DestroyApplicationResult `json:"results,omitempty"`
}

DestroyApplicationResults contains the results of a DestroyApplication API request.

type DestroyApplicationUnits

type DestroyApplicationUnits struct {
	UnitNames []string `json:"unit-names"`
}

DestroyApplicationUnits holds parameters for the deprecated Application.DestroyUnits call.

type DestroyApplicationsParams

type DestroyApplicationsParams struct {
	Applications []DestroyApplicationParams `json:"applications"`
}

DestroyApplicationsParams holds bulk parameters for the Application.DestroyApplication call.

type DestroyConsumedApplicationParams

type DestroyConsumedApplicationParams struct {
	ApplicationTag string `json:"application-tag"`

	// Force controls whether or not the destruction process ignores
	// operational errors. When true, the process will ignore them.
	Force *bool `json:"force,omitempty"`

	// MaxWait specifies the amount of time that each step in application removal
	// 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"`
}

DestroyConsumedApplicationParams holds the parameters for the RemoteApplication.Destroy call.

type DestroyConsumedApplicationsParams

type DestroyConsumedApplicationsParams struct {
	Applications []DestroyConsumedApplicationParams `json:"applications"`
}

DestroyConsumedApplicationsParams holds bulk parameters for the Application.DestroyConsumedApplication call.

type DestroyControllerArgs

type DestroyControllerArgs struct {
	// DestroyModels specifies whether or not the hosted models
	// should be destroyed as well. If this is not specified, and there are
	// other hosted models, the destruction of the controller will fail.
	DestroyModels bool `json:"destroy-models"`

	// 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 `json:"destroy-storage,omitempty"`
}

DestroyControllerArgs holds the arguments for destroying a controller.

type DestroyMachineInfo

type DestroyMachineInfo struct {
	// DetachedStorage is the tags of storage instances that will be
	// detached from the machine (assigned units) as a result of
	// destroying the machine, and will remain in the model after
	// the machine and unit are removed.
	DetachedStorage []Entity `json:"detached-storage,omitempty"`

	// DestroyedStorage is the tags of storage instances that will be
	// destroyed as a result of destroying the machine.
	DestroyedStorage []Entity `json:"destroyed-storage,omitempty"`

	// DestroyedStorage is the tags of units that will be destroyed
	// as a result of destroying the machine.
	DestroyedUnits []Entity `json:"destroyed-units,omitempty"`
}

DestroyMachineInfo contains information related to the removal of a machine.

type DestroyMachineResult

type DestroyMachineResult struct {
	Error *Error              `json:"error,omitempty"`
	Info  *DestroyMachineInfo `json:"info,omitempty"`
}

DestroyMachineResult contains one of the results of a MachineManager.Destroy API request.

type DestroyMachineResults

type DestroyMachineResults struct {
	Results []DestroyMachineResult `json:"results,omitempty"`
}

DestroyMachineResults contains the results of a MachineManager.Destroy API request.

type DestroyMachines

type DestroyMachines struct {
	MachineNames []string `json:"machine-names"`
	Force        bool     `json:"force"`
}

DestroyMachines holds parameters for the DestroyMachines call. This is the legacy params struct used with the client facade. TODO(wallyworld) - remove in Juju 3.0

type DestroyMachinesParams

type DestroyMachinesParams struct {
	MachineTags []string `json:"machine-tags"`
	Force       bool     `json:"force,omitempty"`
	Keep        bool     `json:"keep,omitempty"`

	// MaxWait specifies the amount of time that each step in machine 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"`
}

DestroyMachinesParams holds parameters for the DestroyMachinesWithParams call.

type DestroyModelParams

type DestroyModelParams struct {
	// ModelTag is the tag of the model to destroy.
	ModelTag string `json:"model-tag"`

	// DestroyStorage controls whether or not storage in the model.
	//
	// This is ternary: nil, false, or true. If nil and there is persistent
	// storage in the model, an error with the code
	// params.CodeHasPersistentStorage will be returned.
	DestroyStorage *bool `json:"destroy-storage,omitempty"`

	// 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"`
}

DestroyModelParams holds the arguments for destroying a model.

type DestroyModelsParams

type DestroyModelsParams struct {
	Models []DestroyModelParams `json:"models"`
}

DestroyModelsParams holds the arguments for destroying models.

type DestroyRelation

type DestroyRelation struct {
	Endpoints  []string `json:"endpoints,omitempty"`
	RelationId int      `json:"relation-id"`

	// Force specifies whether relation 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 relation 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"`
}

DestroyRelation holds the parameters for making the DestroyRelation call. A relation is identified by either endpoints or id. The endpoints, if specified, are unordered.

type DestroyUnitInfo

type DestroyUnitInfo struct {
	// DetachedStorage is the tags of storage instances that will be
	// detached from the unit, and will remain in the model after
	// the unit is removed.
	DetachedStorage []Entity `json:"detached-storage,omitempty"`

	// DestroyedStorage is the tags of storage instances that will be
	// destroyed as a result of destroying the unit.
	DestroyedStorage []Entity `json:"destroyed-storage,omitempty"`
}

DestroyUnitInfo contains information related to the removal of an application unit.

type DestroyUnitParams

type DestroyUnitParams struct {
	// UnitTag holds the tag of the unit to destroy.
	UnitTag string `json:"unit-tag"`

	// DestroyStorage controls whether or not storage
	// attached to the unit should be destroyed.
	DestroyStorage bool `json:"destroy-storage,omitempty"`

	// Force controls whether or not the destruction of an application
	// will be forced, i.e. ignore operational errors.
	Force bool `json:"force"`

	// MaxWait specifies the amount of time that each step in unit removal
	// 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"`
}

DestroyUnitParams holds parameters for the Application.DestroyUnit call.

type DestroyUnitResult

type DestroyUnitResult struct {
	Error *Error           `json:"error,omitempty"`
	Info  *DestroyUnitInfo `json:"info,omitempty"`
}

DestroyUnitResult contains one of the results of a DestroyUnit API request.

type DestroyUnitResults

type DestroyUnitResults struct {
	Results []DestroyUnitResult `json:"results,omitempty"`
}

DestroyUnitResults contains the results of a DestroyUnit API request.

type DestroyUnitsParams

type DestroyUnitsParams struct {
	Units []DestroyUnitParams `json:"units"`
}

DestroyUnitsParams holds bulk parameters for the Application.DestroyUnit call.

type DetailedStatus

type DetailedStatus struct {
	Status  string                 `json:"status"`
	Info    string                 `json:"info"`
	Data    map[string]interface{} `json:"data"`
	Since   *time.Time             `json:"since"`
	Kind    string                 `json:"kind"`
	Version string                 `json:"version"`
	Life    life.Value             `json:"life"`
	Err     *Error                 `json:"err,omitempty"`
}

DetailedStatus holds status info about a machine or unit agent.

type DeviceBridgeInfo

type DeviceBridgeInfo struct {
	HostDeviceName string `json:"host-device-name"`
	BridgeName     string `json:"bridge-name"`
	MACAddress     string `json:"mac-address"`
}

DeviceBridgeInfo lists the host device and the expected bridge to be created.

type DeviceType

type DeviceType string

DeviceType defines a device type.

type DigestAlgorithm

type DigestAlgorithm string

DigestAlgorithm is one of the values in the IANA registry. See RFC 3230 and 5843.

type DischargeRequiredErrorInfo

type DischargeRequiredErrorInfo struct {
	// Macaroon may hold a macaroon that, when
	// discharged, may allow access to the juju API.
	// This field is associated with the ErrDischargeRequired
	// error code.
	Macaroon *macaroon.Macaroon `json:"macaroon,omitempty"`

	// BakeryMacaroon may hold a macaroon that, when
	// discharged, may allow access to the juju API.
	// This field is associated with the ErrDischargeRequired
	// error code.
	// This is the macaroon emitted by newer Juju controllers using bakery.v2.
	BakeryMacaroon *bakery.Macaroon `json:"bakery-macaroon,omitempty"`

	// MacaroonPath holds the URL path to be associated
	// with the macaroon. The macaroon is potentially
	// valid for all URLs under the given path.
	// If it is empty, the macaroon will be associated with
	// the original URL from which the error was returned.
	MacaroonPath string `json:"macaroon-path,omitempty"`
}

DischargeRequiredErrorInfo provides additional macaroon information for DischargeRequired errors. Note that although these fields are compatible with the same fields in httpbakery.ErrorInfo, the Juju API server does not implement endpoints directly compatible with that protocol because the error response format varies according to the endpoint.

func (DischargeRequiredErrorInfo) AsMap

func (e DischargeRequiredErrorInfo) AsMap() map[string]interface{}

AsMap encodes the error info as a map that can be attached to an Error.

type DistributionGroupResult

type DistributionGroupResult struct {
	Error  *Error        `json:"error,omitempty"`
	Result []instance.Id `json:"result"`
}

DistributionGroupResult contains the result of the DistributionGroup provisioner API call.

type DistributionGroupResults

type DistributionGroupResults struct {
	Results []DistributionGroupResult `json:"results"`
}

DistributionGroupResults is the bulk form of DistributionGroupResult.

type DumpModelRequest

type DumpModelRequest struct {
	Entities   []Entity `json:"entities"`
	Simplified bool     `json:"simplified"`
}

DumpModelRequest wraps the request for a dump-model call. A simplified dump will not contain a complete export, but instead a reduced set that is determined by the server.

type Endpoint

type Endpoint struct {
	ApplicationName string        `json:"application-name"`
	Relation        CharmRelation `json:"relation"`
}

Endpoint holds an application-relation pair.

type EndpointFilterAttributes

type EndpointFilterAttributes struct {
	Role      charm.RelationRole `json:"role"`
	Interface string             `json:"interface"`
	Name      string             `json:"name"`
}

EndpointFilterAttributes is used to filter offers matching the specified endpoint criteria.

type EndpointRelationData

type EndpointRelationData struct {
	Endpoint         string                  `json:"endpoint"`
	CrossModel       bool                    `json:"cross-model"`
	RelatedEndpoint  string                  `json:"related-endpoint"`
	ApplicationData  map[string]interface{}  `yaml:"application-relation-data"`
	UnitRelationData map[string]RelationData `json:"unit-relation-data"`
}

EndpointRelationData holds information about a relation to a given endpoint.

type EndpointStatus

type EndpointStatus struct {
	ApplicationName string `json:"application"`
	Name            string `json:"name"`
	Role            string `json:"role"`
	Subordinate     bool   `json:"subordinate"`
}

EndpointStatus holds status info about a single endpoint.

func (*EndpointStatus) String

func (epStatus *EndpointStatus) String() string

type EnqueuedActions

type EnqueuedActions struct {
	OperationTag string         `json:"operation"`
	Actions      []StringResult `json:"actions,omitempty"`
}

EnqueuedActions represents the result of enqueuing actions to run.

type Entities

type Entities struct {
	Entities []Entity `json:"entities"`
}

Entities identifies multiple entities.

type EntitiesCharmURL

type EntitiesCharmURL struct {
	Entities []EntityCharmURL `json:"entities"`
}

EntitiesCharmURL holds the parameters for making a SetCharmURL API call.

type EntitiesPortRanges

type EntitiesPortRanges struct {
	Entities []EntityPortRange `json:"entities"`
}

EntitiesPortRanges holds the parameters for making an OpenPorts or ClosePorts on some entities.

type EntitiesPorts

type EntitiesPorts struct {
	Entities []EntityPort `json:"entities"`
}

EntitiesPorts holds the parameters for making an OpenPort or ClosePort on some entities.

type EntitiesResult

type EntitiesResult struct {
	Entities []Entity `json:"entities"`
	Error    *Error   `json:"error,omitempty"`
}

EntitiesResult is the result of one query that either yields some set of entities or an error.

type EntitiesResults

type EntitiesResults struct {
	Results []EntitiesResult `json:"results"`
}

EntitiesResults contains multiple Entities results (where each Entities is the result of a query).

type EntitiesVersion

type EntitiesVersion struct {
	AgentTools []EntityVersion `json:"agent-tools"`
}

EntitiesVersion specifies what tools are being run for multiple entities.

type EntitiesWatchResult

type EntitiesWatchResult struct {
	// Note legacy serialization tag.
	EntitiesWatcherId string   `json:"watcher-id"`
	Changes           []string `json:"changes,omitempty"`
	Error             *Error   `json:"error,omitempty"`
}

EntitiesWatchResult holds a EntitiesWatcher id, changes and an error (if any).

type EntitiesWatchResults

type EntitiesWatchResults struct {
	Results []EntitiesWatchResult `json:"results"`
}

EntitiesWatchResults holds the results for any API call which ends up returning a list of EntitiesWatchers.

type Entity

type Entity struct {
	Tag string `json:"tag"`
}

Entity identifies a single entity.

type EntityAnnotations

type EntityAnnotations struct {
	EntityTag   string            `json:"entity"`
	Annotations map[string]string `json:"annotations"`
}

EntityAnnotations stores annotations for an entity.

type EntityCharmURL

type EntityCharmURL struct {
	Tag      string `json:"tag"`
	CharmURL string `json:"charm-url"`
}

EntityCharmURL holds an entity's tag and a charm URL.

type EntityId

type EntityId struct {
	Kind      string `json:"kind"`
	ModelUUID string `json:"model-uuid"`
	Id        string `json:"id"`
}

EntityId uniquely identifies an entity being tracked by the multiwatcherStore.

type EntityInfo

type EntityInfo interface {
	// EntityId returns an identifier that will uniquely
	// identify the entity within its kind
	EntityId() EntityId
}

EntityInfo is implemented by all entity Info types.

type EntityMacaroonArg

type EntityMacaroonArg struct {
	Macaroon *macaroon.Macaroon `json:"macaroon"`
	Tag      string             `json:"tag"`
}

EntityMacaroonArg holds a macaroon and entity which we want to save.

type EntityMacaroonArgs

type EntityMacaroonArgs struct {
	Args []EntityMacaroonArg
}

EntityMacaroonArgs holds the arguments to a SaveMacaroons API call.

type EntityMetrics

type EntityMetrics struct {
	Metrics []MetricResult `json:"metrics,omitempty"`
	Error   *Error         `json:"error,omitempty"`
}

EntityMetrics contains the results of a GetMetrics call for a single entity.

type EntityPassword

type EntityPassword struct {
	Tag      string `json:"tag"`
	Password string `json:"password"`
}

EntityPassword specifies a password change for the entity with the given tag.

type EntityPasswords

type EntityPasswords struct {
	Changes []EntityPassword `json:"changes"`
}

EntityPasswords holds the parameters for making a SetPasswords call.

type EntityPort

type EntityPort struct {
	Tag      string `json:"tag"`
	Protocol string `json:"protocol"`
	Port     int    `json:"port"`
}

EntityPort holds an entity's tag, a protocol and a port.

type EntityPortRange

type EntityPortRange struct {
	Tag      string `json:"tag"`
	Protocol string `json:"protocol"`
	FromPort int    `json:"from-port"`
	ToPort   int    `json:"to-port"`

	// Endpoint can be left empty to indicate that this port range applies
	// to all application endpoints.
	Endpoint string `json:"endpoint"`
}

EntityPortRange holds an entity's tag, a protocol and a port range.

type EntityStatus

type EntityStatus struct {
	Status status.Status          `json:"status"`
	Info   string                 `json:"info"`
	Data   map[string]interface{} `json:"data,omitempty"`
	Since  *time.Time             `json:"since"`
}

EntityStatus holds the status of an entity.

type EntityStatusArgs

type EntityStatusArgs struct {
	Tag    string                 `json:"tag"`
	Status string                 `json:"status"`
	Info   string                 `json:"info"`
	Data   map[string]interface{} `json:"data"`
}

EntityStatusArgs holds parameters for setting the status of a single entity.

type EntityString

type EntityString struct {
	Tag   string `json:"tag"`
	Value string `json:"value"`
}

EntityString holds an entity tag and a string value.

type EntityVersion

type EntityVersion struct {
	Tag   string   `json:"tag"`
	Tools *Version `json:"tools"`
}

EntityVersion specifies the tools version to be set for an entity with the given tag. version.Binary directly.

type EntityWorkloadVersion

type EntityWorkloadVersion struct {
	Tag             string `json:"tag"`
	WorkloadVersion string `json:"workload-version"`
}

EntityWorkloadVersion holds the workload version for an entity.

type EntityWorkloadVersions

type EntityWorkloadVersions struct {
	Entities []EntityWorkloadVersion `json:"entities"`
}

EntityWorkloadVersions holds the parameters for setting the workload version for a set of entities.

type Error

type Error struct {
	Message string                 `json:"message"`
	Code    string                 `json:"code"`
	Info    map[string]interface{} `json:"info,omitempty"`
}

Error is the type of error returned by any call to the state API.

func (Error) Error

func (e Error) Error() string

func (Error) ErrorCode

func (e Error) ErrorCode() string

func (Error) ErrorInfo

func (e Error) ErrorInfo() map[string]interface{}

ErrorInfo implements the rpc.ErrorInfoProvider interface which enables API error attachments to be returned as part of RPC error responses.

func (Error) GoString

func (e Error) GoString() string

GoString implements fmt.GoStringer. It means that a *Error shows its contents correctly when printed with %#v.

func (Error) UnmarshalInfo

func (e Error) UnmarshalInfo(to interface{}) error

UnmarshalInfo attempts to unmarshal the information contained in the Info field of a RequestError into an AdditionalErrorInfo instance a pointer to which is passed via the to argument. The method will return an error if a non-pointer arg is provided.

type ErrorResponse

type ErrorResponse struct {
	Error CharmHubError `json:"error-list"`
}

type ErrorResult

type ErrorResult struct {
	Error *Error `json:"error,omitempty"`
}

ErrorResult holds the error status of a single operation.

type ErrorResults

type ErrorResults struct {
	// Results contains the error results from each operation.
	Results []ErrorResult `json:"results"`
}

ErrorResults holds the results of calling a bulk operation which returns no data, only an error result. The order and number of elements matches the operations specified in the request.

func (ErrorResults) Combine

func (result ErrorResults) Combine() error

Combine returns one error from the result which is an accumulation of the errors. If there are no errors in the result, the return value is nil. Otherwise the error values are combined with new-line characters.

func (ErrorResults) OneError

func (result ErrorResults) OneError() error

OneError returns the error from the result of a bulk operation on a single value.

type ExposeInfoResult

type ExposeInfoResult struct {
	Error *Error `json:"error,omitempty"`

	Exposed bool `json:"exposed,omitempty"`

	// Expose parameters grouped by endpoint name. An empty ("") endpoint
	// name key represents all application endpoints. For compatibility
	// with pre 2.9 clients, if this field is empty, all opened ports
	// for the application will be exposed to 0.0.0.0/0.
	ExposedEndpoints map[string]ExposedEndpoint `json:"exposed-endpoints,omitempty"`
}

ExposeInfoResult holds the result of a GetExposeInfo call.

type ExposeInfoResults

type ExposeInfoResults struct {
	Results []ExposeInfoResult `json:"results"`
}

ExposeInfoResults the expose info for a list of applications.

type ExposedEndpoint

type ExposedEndpoint struct {
	ExposeToSpaces []string `json:"expose-to-spaces,omitempty"`
	ExposeToCIDRs  []string `json:"expose-to-cidrs,omitempty"`
}

ExposedEndpoint describes the spaces and/or CIDRs that should be able to reach the ports opened by an application for a particular endpoint.

type ExternalControllerInfo

type ExternalControllerInfo struct {
	ControllerTag string   `json:"controller-tag"`
	Alias         string   `json:"controller-alias"`
	Addrs         []string `json:"addrs"`
	CACert        string   `json:"ca-cert"`
}

ExternalControllerInfo holds addressed and other information needed to make a connection to an external controller.

type ExternalControllerInfoResult

type ExternalControllerInfoResult struct {
	Result *ExternalControllerInfo `json:"result"`
	Error  *Error                  `json:"error"`
}

ExternalControllerInfoResult contains the result of querying the information of external controllers.

type ExternalControllerInfoResults

type ExternalControllerInfoResults struct {
	Results []ExternalControllerInfoResult `json:"results"`
}

ExternalControllerInfoResults contains the results of querying the information for a set of external controllers.

type FacadeVersions

type FacadeVersions struct {
	Name     string `json:"name"`
	Versions []int  `json:"versions"`
}

FacadeVersions describes the available Facades and what versions of each one are available

type FanConfigEntry

type FanConfigEntry struct {
	Underlay string `json:"underlay"`
	Overlay  string `json:"overlay"`
}

FanConfigEntry holds configuration for a single fan.

type FanConfigResult

type FanConfigResult struct {
	Fans []FanConfigEntry `json:"fans"`
}

FanConfigResult holds configuration for all fans in a model.

type Filesystem

type Filesystem struct {
	FilesystemTag string         `json:"filesystem-tag"`
	VolumeTag     string         `json:"volume-tag,omitempty"`
	Info          FilesystemInfo `json:"info"`
}

Filesystem identifies and describes a storage filesystem in the model.

type FilesystemAttachment

type FilesystemAttachment struct {
	FilesystemTag string                   `json:"filesystem-tag"`
	MachineTag    string                   `json:"machine-tag"`
	Info          FilesystemAttachmentInfo `json:"info"`
}

FilesystemAttachment identifies and describes a filesystem attachment.

type FilesystemAttachmentDetails

type FilesystemAttachmentDetails struct {
	// NOTE(axw) for backwards-compatibility, this must not be given a
	// json tag. This ensures that we collapse FilesystemAttachmentInfo.
	//
	// TODO(axw) when we can break backwards-compatibility (Juju 3.0),
	// give this a field name of "info", like we have in FilesystemDetails
	// above.
	FilesystemAttachmentInfo

	// Life contains the lifecycle state of the filesystem attachment.
	// Juju controllers older than 2.2 do not populate this
	// field, so it may be omitted.
	Life life.Value `json:"life,omitempty"`
}

FilesystemAttachmentDetails describes a filesystem attachment.

type FilesystemAttachmentInfo

type FilesystemAttachmentInfo struct {
	MountPoint string `json:"mount-point,omitempty"`
	ReadOnly   bool   `json:"read-only,omitempty"`
}

FilesystemAttachmentInfo describes a filesystem attachment.

type FilesystemAttachmentParams

type FilesystemAttachmentParams struct {
	FilesystemTag string `json:"filesystem-tag"`
	MachineTag    string `json:"machine-tag"`
	FilesystemId  string `json:"filesystem-id,omitempty"`
	InstanceId    string `json:"instance-id,omitempty"`
	Provider      string `json:"provider"`
	MountPoint    string `json:"mount-point,omitempty"`
	ReadOnly      bool   `json:"read-only,omitempty"`
}

FilesystemAttachmentParams holds the parameters for creating a filesystem attachment.

type FilesystemAttachmentParamsResult

type FilesystemAttachmentParamsResult struct {
	Result FilesystemAttachmentParams `json:"result"`
	Error  *Error                     `json:"error,omitempty"`
}

FilesystemAttachmentParamsResults holds provisioning parameters for a filesystem attachment.

type FilesystemAttachmentParamsResults

type FilesystemAttachmentParamsResults struct {
	Results []FilesystemAttachmentParamsResult `json:"results,omitempty"`
}

FilesystemAttachmentParamsResults holds provisioning parameters for multiple filesystem attachments.

type FilesystemAttachmentResult

type FilesystemAttachmentResult struct {
	Result FilesystemAttachment `json:"result"`
	Error  *Error               `json:"error,omitempty"`
}

FilesystemAttachmentResult holds the details of a single filesystem attachment, or an error.

type FilesystemAttachmentResults

type FilesystemAttachmentResults struct {
	Results []FilesystemAttachmentResult `json:"results,omitempty"`
}

FilesystemAttachmentResults holds a set of FilesystemAttachmentResults.

type FilesystemAttachments

type FilesystemAttachments struct {
	FilesystemAttachments []FilesystemAttachment `json:"filesystem-attachments"`
}

FilesystemAttachments describes a set of storage filesystem attachments.

type FilesystemDetails

type FilesystemDetails struct {
	// FilesystemTag is the tag for the filesystem.
	FilesystemTag string `json:"filesystem-tag"`

	// VolumeTag is the tag for the volume backing the
	// filesystem, if any.
	VolumeTag string `json:"volume-tag,omitempty"`

	// Info contains information about the filesystem.
	Info FilesystemInfo `json:"info"`

	// Life contains the lifecycle state of the filesystem.
	// Juju controllers older than 2.2 do not populate this
	// field, so it may be omitted.
	Life life.Value `json:"life,omitempty"`

	// Status contains the status of the filesystem.
	Status EntityStatus `json:"status"`

	// MachineAttachments contains a mapping from
	// machine tag to filesystem attachment information (IAAS models).
	MachineAttachments map[string]FilesystemAttachmentDetails `json:"machine-attachments,omitempty"`

	// UnitAttachments contains a mapping from
	// unit tag to filesystem attachment information (CAAS models).
	UnitAttachments map[string]FilesystemAttachmentDetails `json:"unit-attachments,omitempty"`

	// Storage contains details about the storage instance
	// that the volume is assigned to, if any.
	Storage *StorageDetails `json:"storage,omitempty"`
}

FilesystemDetails describes a storage filesystem in the model for the purpose of filesystem CLI commands.

This is kept separate from Filesystem which contains only information specific to the filesystem model, whereas FilesystemDetails is intended to contain complete information about a filesystem and related information (status, attachments, storage).

type FilesystemDetailsListResult

type FilesystemDetailsListResult struct {
	Result []FilesystemDetails `json:"result,omitempty"`
	Error  *Error              `json:"error,omitempty"`
}

FilesystemDetailsListResult holds a collection of filesystem details.

type FilesystemDetailsListResults

type FilesystemDetailsListResults struct {
	Results []FilesystemDetailsListResult `json:"results,omitempty"`
}

FilesystemDetailsListResults holds a collection of collections of filesystem details.

type FilesystemDetailsResult

type FilesystemDetailsResult struct {
	Result *FilesystemDetails `json:"result,omitempty"`
	Error  *Error             `json:"error,omitempty"`
}

FilesystemDetailsResult contains details about a filesystem, its attachments or an error preventing retrieving those details.

type FilesystemDetailsResults

type FilesystemDetailsResults struct {
	Results []FilesystemDetailsResult `json:"results,omitempty"`
}

FilesystemDetailsResults holds filesystem details.

type FilesystemFilter

type FilesystemFilter struct {
	// Machines are machine tags to filter on.
	Machines []string `json:"machines,omitempty"`
}

FilesystemFilter holds a filter for filter list API call.

func (*FilesystemFilter) IsEmpty

func (f *FilesystemFilter) IsEmpty() bool

IsEmpty determines if filter is empty

type FilesystemFilters

type FilesystemFilters struct {
	Filters []FilesystemFilter `json:"filters,omitempty"`
}

FilesystemFilters holds a collection of filesystem filters.

type FilesystemInfo

type FilesystemInfo struct {
	FilesystemId string `json:"filesystem-id"`
	// Pool is the name of the storage pool used to
	// allocate the filesystem. Juju controllers older
	// than 2.2 do not populate this field, so it may
	// be omitted.
	Pool string `json:"pool"`
	// Size is the size of the filesystem in MiB.
	Size uint64 `json:"size"`
}

Filesystem describes a storage filesystem in the model.

type FilesystemParams

type FilesystemParams struct {
	FilesystemTag string                      `json:"filesystem-tag"`
	VolumeTag     string                      `json:"volume-tag,omitempty"`
	Size          uint64                      `json:"size"`
	Provider      string                      `json:"provider"`
	Attributes    map[string]interface{}      `json:"attributes,omitempty"`
	Tags          map[string]string           `json:"tags,omitempty"`
	Attachment    *FilesystemAttachmentParams `json:"attachment,omitempty"`
}

FilesystemParams holds the parameters for creating a storage filesystem.

type FilesystemParamsResult

type FilesystemParamsResult struct {
	Result FilesystemParams `json:"result"`
	Error  *Error           `json:"error,omitempty"`
}

FilesystemParamsResults holds provisioning parameters for a filesystem.

type FilesystemParamsResults

type FilesystemParamsResults struct {
	Results []FilesystemParamsResult `json:"results,omitempty"`
}

FilesystemParamsResults holds provisioning parameters for multiple filesystems.

type FilesystemResult

type FilesystemResult struct {
	Result Filesystem `json:"result"`
	Error  *Error     `json:"error,omitempty"`
}

FilesystemResult holds information about a filesystem.

type FilesystemResults

type FilesystemResults struct {
	Results []FilesystemResult `json:"results,omitempty"`
}

FilesystemResults holds information about multiple filesystems.

type Filesystems

type Filesystems struct {
	Filesystems []Filesystem `json:"filesystems"`
}

Filesystems describes a set of storage filesystems in the model.

type FindActionsByNames

type FindActionsByNames struct {
	ActionNames []string `json:"names,omitempty"`
}

FindActionsByName finds actions given an action name.

type FindResponse

type FindResponse struct {
	Type      string   `json:"type"`
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Publisher string   `json:"publisher"`
	Summary   string   `json:"summary"`
	Version   string   `json:"version"`
	Series    []string `json:"series"`
	StoreURL  string   `json:"store-url"`
}

type FindTags

type FindTags struct {
	Prefixes []string `json:"prefixes"`
}

FindTags wraps a slice of strings that are prefixes to use when searching for matching tags.

type FindTagsResults

type FindTagsResults struct {
	Matches map[string][]Entity `json:"matches"`
}

FindTagsResults wraps the mapping between the requested prefix and the matching tags for each requested prefix.

type FindToolsParams

type FindToolsParams struct {
	// Number will be used to match tools versions exactly if non-zero.
	Number version.Number `json:"number"`

	// MajorVersion will be used to match the major version if non-zero.
	MajorVersion int `json:"major"`

	// MinorVersion will be used to match the major version if greater
	// than or equal to zero, and Number is zero.
	MinorVersion int `json:"minor"`

	// Arch will be used to match tools by architecture if non-empty.
	Arch string `json:"arch"`

	// Series will be used to match tools by series if non-empty.
	Series string `json:"series"`

	// AgentStream will be used to set agent stream to search
	AgentStream string `json:"agentstream"`
}

FindToolsParams defines parameters for the FindTools method.

type FindToolsResult

type FindToolsResult struct {
	List  tools.List `json:"list"`
	Error *Error     `json:"error,omitempty"`
}

FindToolsResult holds a list of tools from FindTools and any error.

type FirewallRule

type FirewallRule struct {
	// KnownService is the well known service for a firewall rule.
	KnownService KnownServiceValue `json:"known-service"`

	// WhitelistCIDRS is the ist of subnets allowed access.
	WhitelistCIDRS []string `json:"whitelist-cidrs,omitempty"`
}

FirewallRule is a rule for ingress through a firewall.

type FirewallRuleArgs

type FirewallRuleArgs struct {
	// Args holds the parameters for updating a firewall rule.
	Args []FirewallRule `json:"args"`
}

FirewallRuleArgs holds the parameters for updating one or more firewall rules.

type FullStatus

type FullStatus struct {
	Model               ModelStatusInfo                    `json:"model"`
	Machines            map[string]MachineStatus           `json:"machines"`
	Applications        map[string]ApplicationStatus       `json:"applications"`
	RemoteApplications  map[string]RemoteApplicationStatus `json:"remote-applications"`
	Offers              map[string]ApplicationOfferStatus  `json:"offers"`
	Relations           []RelationStatus                   `json:"relations"`
	ControllerTimestamp *time.Time                         `json:"controller-timestamp"`
	Branches            map[string]BranchStatus            `json:"branches"`
}

FullStatus holds information about the status of a juju model.

func (*FullStatus) IsEmpty

func (fs *FullStatus) IsEmpty() bool

IsEmpty checks all collections on FullStatus to determine if the status is empty. Note that only the collections are checked here as Model information will always be populated.

type GUIArchiveResponse

type GUIArchiveResponse struct {
	Versions []GUIArchiveVersion `json:"versions"`
}

GUIArchiveResponse holds the response to /gui-archive GET requests.

type GUIArchiveVersion

type GUIArchiveVersion struct {
	// Version holds the Juju GUI version number.
	Version version.Number `json:"version"`
	// SHA256 holds the SHA256 hash of the GUI tar.bz2 archive.
	SHA256 string `json:"sha256"`
	// Current holds whether this specific version is the current one served
	// by the controller.
	Current bool `json:"current"`
}

GUIArchiveVersion holds information on a specific GUI archive version.

type GUIVersionRequest

type GUIVersionRequest struct {
	// Version holds the Juju GUI version number.
	Version version.Number `json:"version"`
}

GUIVersionRequest holds the body for /gui-version PUT requests.

type Generation

type Generation struct {
	// BranchName uniquely identifies a branch *amongst in-flight branches*.
	BranchName string `json:"branch"`

	// Created is the Unix timestamp at generation creation.
	Created int64 `json:"created"`

	// Created is the user who created the generation.
	CreatedBy string `json:"created-by"`

	// Completed is the Unix timestamp at generation completion/commit.
	Completed int64 `json:"completed,omitempty"`

	// CompletedBy is the user who committed/completed the generation.
	CompletedBy string `json:"completed-by,omitempty"`

	// GenerationId is the id .
	GenerationId int `json:"generation-id,omitempty"`

	// Applications holds the collection of application changes
	// made under this generation.
	Applications []GenerationApplication `json:"applications"`
}

Generation represents a model generation's details including config changes.

type GenerationApplication

type GenerationApplication struct {
	// ApplicationsName is the name of the application.
	ApplicationName string `json:"application"`

	// UnitProgress is summary information about units tracking the branch.
	UnitProgress string `json:"progress"`

	// UnitsTracking is the names of application units that have been set to
	// track the branch.
	UnitsTracking []string `json:"tracking,omitempty"`

	// UnitsPending is the names of application units that are still tracking
	// the master generation.
	UnitsPending []string `json:"pending,omitempty"`

	// Config changes are the effective new configuration values resulting from
	// changes made under this branch.
	ConfigChanges map[string]interface{} `json:"config"`
}

GenerationApplication represents changes to an application made under a branch.

type GenerationId

type GenerationId struct {
	GenerationId int `json:"generation-id"`
}

GenerationId represents an GenerationId from a branch.

type GenerationResult

type GenerationResult struct {
	// Generation holds the details of the requested generation.
	Generation Generation `json:"generation"`

	// Error holds the value of any error that occurred processing the request.
	Error *Error `json:"error,omitempty"`
}

GenerationResult transports a generation detail.

type GetAnnotations

type GetAnnotations struct {
	Tag string `json:"tag"`
}

GetAnnotations stores parameters for making the GetAnnotations call.

type GetAnnotationsResults

type GetAnnotationsResults struct {
	Annotations map[string]string `json:"annotations"`
}

GetAnnotationsResults holds annotations associated with an entity.

type GetApplicationConstraints

type GetApplicationConstraints struct {
	ApplicationName string `json:"application"`
}

GetApplicationConstraints stores parameters for making the GetApplicationConstraints call.

type GetConstraintsResults

type GetConstraintsResults struct {
	Constraints constraints.Value `json:"constraints"`
}

GetConstraintsResults holds results of the GetConstraints call.

type GetLeadershipSettingsBulkResults

type GetLeadershipSettingsBulkResults struct {
	Results []GetLeadershipSettingsResult `json:"results"`
}

GetLeadershipSettingsBulkResults is the collection of results from a bulk request for leadership settings.

type GetLeadershipSettingsResult

type GetLeadershipSettingsResult struct {
	Settings Settings `json:"settings"`
	Error    *Error   `json:"error,omitempty"`
}

GetLeadershipSettingsResult is the results from requesting leadership settings.

type GetTokenArg

type GetTokenArg struct {
	// Tag is the tag of the entity for which we want the token.
	Tag string `json:"tag"`
}

GetTokenArg holds the model and entity for which we want a token.

type GetTokenArgs

type GetTokenArgs struct {
	Args []GetTokenArg
}

GetTokenArgs holds the arguments to a GetTokens API call.

type GoalState

type GoalState struct {
	Units     UnitsGoalState            `json:"units"`
	Relations map[string]UnitsGoalState `json:"relations"`
}

GoalState goal-state at application level, stores Units and Units-Relations

type GoalStateResult

type GoalStateResult struct {
	Result *GoalState `json:"result"`
	Error  *Error     `json:"error"`
}

GoalStateResult the result of GoalStates per entity.

type GoalStateResults

type GoalStateResults struct {
	Results []GoalStateResult `json:"results"`
}

GoalStateResults holds the results of GoalStates API call

type GoalStateStatus

type GoalStateStatus struct {
	Status string     `json:"status"`
	Since  *time.Time `json:"since"`
}

GoalStateStatus goal-state at unit level

type History

type History struct {
	Statuses []DetailedStatus `json:"statuses"`
	Error    *Error           `json:"error,omitempty"`
}

History holds many DetailedStatus.

type HostNetworkChange

type HostNetworkChange struct {
	Error *Error `json:"error,omitempty"`

	// NewBridges lists the bridges that need to be created and what host
	// device they should be connected to.
	NewBridges []DeviceBridgeInfo `json:"new-bridges"`

	// ReconfigureDelay is the duration in seconds to sleep before
	// raising the bridged interface
	ReconfigureDelay int `json:"reconfigure-delay"`
}

HostNetworkChange holds the information about how a host machine should be modified to prepare for a container.

type HostNetworkChangeResults

type HostNetworkChangeResults struct {
	Results []HostNetworkChange `json:"results"`
}

HostNetworkChangeResults holds the network changes that are necessary for multiple containers to be created.

type HostPort

type HostPort struct {
	Address
	Port int `json:"port"`
}

HostPort associates an address with a port. It's used in the API requests/responses. See also network.HostPort, from/to which this is transformed.

func FromHostPort

func FromHostPort(nhp network.HostPort) HostPort

FromHostPort is a convenience helper to create a parameter out of the network type, here for HostPort.

func FromHostPorts

func FromHostPorts(nhps network.HostPorts) []HostPort

FromHostPorts is a helper to create a parameter out of the network type, here for a slice of HostPort.

func FromProviderHostPort

func FromProviderHostPort(nhp network.ProviderHostPort) HostPort

FromProviderHostPort is a convenience helper to create a parameter out of the network type, here for ProviderHostPort.

func FromProviderHostPorts

func FromProviderHostPorts(nhps network.ProviderHostPorts) []HostPort

FromProviderHostPorts is a helper to create a parameter out of the network type, here for a slice of HostPort.

func (HostPort) MachineHostPort

func (hp HostPort) MachineHostPort() network.MachineHostPort

MachineHostPort transforms the HostPort to a MachineHostPort.

func (HostPort) ProviderHostPort

func (hp HostPort) ProviderHostPort() network.ProviderHostPort

ProviderHostPort transforms the HostPort to a ProviderHostPort.

type HostedModelConfig

type HostedModelConfig struct {
	Name      string                 `json:"name"`
	OwnerTag  string                 `json:"owner"`
	Config    map[string]interface{} `json:"config,omitempty"`
	CloudSpec *CloudSpec             `json:"cloud-spec,omitempty"`
	Error     *Error                 `json:"error,omitempty"`
}

HostedModelConfig contains the model config and the cloud spec for the model, both things that a client needs to talk directly with the provider. This is used to take down mis-behaving models aggressively.

type HostedModelConfigsResults

type HostedModelConfigsResults struct {
	Models []HostedModelConfig `json:"models"`
}

HostedModelConfigsResults contains an entry for each hosted model in the controller.

type ImageFilterParams

type ImageFilterParams struct {
	Images []ImageSpec `json:"images"`
}

ImageFilterParams holds the parameters used to specify images to delete.

type ImageMetadata

type ImageMetadata struct {
	Kind    string    `json:"kind"`
	Arch    string    `json:"arch"`
	Series  string    `json:"series"`
	URL     string    `json:"url"`
	Created time.Time `json:"created"`
}

ImageMetadata represents an image in storage.

type ImageMetadataFilter

type ImageMetadataFilter struct {
	// Region stores metadata region.
	Region string `json:"region,omitempty"`

	// Series stores all desired series.
	Series []string `json:"series,omitempty"`

	// Arches stores all desired architectures.
	Arches []string `json:"arches,omitempty"`

	// Stream can be "" or "released" for the default "released" stream,
	// or "daily" for daily images, or any other stream that the available
	// simplestreams metadata supports.
	Stream string `json:"stream,omitempty"`

	// VirtType stores virtualisation type.
	VirtType string `json:"virt-type,omitempty"`

	// RootStorageType stores storage type.
	RootStorageType string `json:"root-storage-type,omitempty"`
}

ImageMetadataFilter holds filter properties used to search for image metadata. It amalgamates both simplestreams.MetadataLookupParams and simplestreams.LookupParams and adds additional properties to satisfy existing and new use cases.

type ImageSpec

type ImageSpec struct {
	Kind   string `json:"kind"`
	Arch   string `json:"arch"`
	Series string `json:"series"`
}

ImageSpec defines the parameters to select images list or delete.

type ImportStorageDetails

type ImportStorageDetails struct {
	// StorageTag contains the string representation of the storage tag
	// assigned to the imported storage entity.
	StorageTag string `json:"storage-tag"`
}

ImportStorageDetails contains the details of an imported storage entity.

type ImportStorageParams

type ImportStorageParams struct {
	// Kind is the kind of the storage entity to import.
	Kind StorageKind `json:"kind"`

	// Pool is the name of the storage pool into which the storage is to
	// be imported.
	Pool string `json:"pool"`

	// ProviderId is the storage provider's unique ID for the storage,
	// e.g. the EBS volume ID.
	ProviderId string `json:"provider-id"`

	// StorageName is the name of the storage to assign to the entity.
	StorageName string `json:"storage-name"`
}

ImportStorageParams contains the parameters for importing a storage entity.

type ImportStorageResult

type ImportStorageResult struct {
	Result *ImportStorageDetails `json:"result,omitempty"`
	Error  *Error                `json:"error,omitempty"`
}

ImportStorageResult contains the result of importing a storage entity.

type ImportStorageResults

type ImportStorageResults struct {
	Results []ImportStorageResult `json:"results"`
}

ImportStorageResults contains the results of importing a collection of storage entities.

type InfoResponse

type InfoResponse struct {
	Type        string             `json:"type"`
	ID          string             `json:"id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Publisher   string             `json:"publisher"`
	Summary     string             `json:"summary"`
	Series      []string           `json:"series"`
	StoreURL    string             `json:"store-url"`
	Tags        []string           `json:"tags"`
	Charm       *CharmHubCharm     `json:"charm,omitempty"`
	Bundle      *CharmHubBundle    `json:"bundle,omitempty"`
	Channels    map[string]Channel `json:"channel-map"`
	Tracks      []string           `json:"tracks"`
}

type IngressNetworksChangeEvent

type IngressNetworksChangeEvent struct {
	// RelationToken is the token of the relation.
	RelationToken string `json:"relation-token"`

	// ApplicationToken is the token of the application.
	ApplicationToken string `json:"application-token"`

	// Networks are the CIDRs for which ingress is required.
	Networks []string `json:"networks,omitempty"`

	// IngressRequired is true if ingress is needed, otherwise
	// ingress should be disabled.
	IngressRequired bool `json:"ingress-required"`

	// Macaroons are used for authentication.
	Macaroons macaroon.Slice `json:"macaroons,omitempty"`

	// BakeryVersion is the version of the bakery used to mint macaroons.
	BakeryVersion bakery.Version `json:"bakery-version,omitempty"`
}

type IngressNetworksChanges

type IngressNetworksChanges struct {
	Changes []IngressNetworksChangeEvent `json:"changes,omitempty"`
}

IngressNetworksChanges holds a set of IngressNetworksChangeEvent structures.

type InitiateMigrationArgs

type InitiateMigrationArgs struct {
	Specs []MigrationSpec `json:"specs"`
}

InitiateMigrationArgs holds the details required to start one or more model migrations.

type InitiateMigrationResult

type InitiateMigrationResult struct {
	ModelTag    string `json:"model-tag"`
	Error       *Error `json:"error,omitempty"`
	MigrationId string `json:"migration-id"`
}

InitiateMigrationResult is used to return the result of one model migration initiation attempt.

type InitiateMigrationResults

type InitiateMigrationResults struct {
	Results []InitiateMigrationResult `json:"results"`
}

InitiateMigrationResults is used to return the result of one or more attempts to start model migrations.

type InstanceInfo

type InstanceInfo struct {
	Tag             string                            `json:"tag"`
	InstanceId      instance.Id                       `json:"instance-id"`
	DisplayName     string                            `json:"display-name"`
	Nonce           string                            `json:"nonce"`
	Characteristics *instance.HardwareCharacteristics `json:"characteristics"`
	Volumes         []Volume                          `json:"volumes"`
	// VolumeAttachments is a mapping from volume tag to
	// volume attachment info.
	VolumeAttachments map[string]VolumeAttachmentInfo `json:"volume-attachments"`

	NetworkConfig []NetworkConfig `json:"network-config"`
	CharmProfiles []string        `json:"charm-profiles"`
}

InstanceInfo holds information about an instance. Instances are typically virtual machines hosted by a cloud provider but may also be a container.

The InstanceInfo struct contains three categories of information:

- interal data, as the machine's tag and the tags of any attached
  storage volumes
- naming and other provider-specific information, including the
  instance id and display name
- configuration information, including its attached storage volumes,
  charm profiles and networking

type InstanceType

type InstanceType struct {
	Name         string   `json:"name,omitempty"`
	Arches       []string `json:"arches"`
	CPUCores     int      `json:"cpu-cores"`
	Memory       int      `json:"memory"`
	RootDiskSize int      `json:"root-disk,omitempty"`
	VirtType     string   `json:"virt-type,omitempty"`
	Deprecated   bool     `json:"deprecated,omitempty"`
	Cost         int      `json:"cost,omitempty"`
}

InstanceType represents an available instance type in a cloud.

type InstanceTypesResult

type InstanceTypesResult struct {
	InstanceTypes []InstanceType `json:"instance-types,omitempty"`
	CostUnit      string         `json:"cost-unit,omitempty"`
	CostCurrency  string         `json:"cost-currency,omitempty"`
	// CostDivisor Will be present only when the Cost is not expressed in CostUnit.
	CostDivisor uint64 `json:"cost-divisor,omitempty"`
	Error       *Error `json:"error,omitempty"`
}

InstanceTypesResult contains the result of prompting a cloud for its instance types.

type InstanceTypesResults

type InstanceTypesResults struct {
	Results []InstanceTypesResult `json:"results"`
}

InstanceTypesResults contains the bulk result of prompting a cloud for its instance types.

type InstancesInfo

type InstancesInfo struct {
	Machines []InstanceInfo `json:"machines"`
}

InstancesInfo holds the parameters for making a SetInstanceInfo call for multiple machines.

type IntResult

type IntResult struct {
	// Error holds the error (if any) of this call.
	Error *Error `json:"error,omitempty"`
	// Result holds the integer result of the call (if Error is nil).
	Result int `json:"result"`
}

IntResult holds the result of an API call that returns a int or an error.

type IntResults

type IntResults struct {
	// Results holds a list of results for calls that return an int or error.
	Results []IntResult `json:"results"`
}

IntResults holds multiple results with an int in each.

type InterfaceAddress

type InterfaceAddress struct {
	Hostname string `json:"hostname"`
	Address  string `json:"value"`
	CIDR     string `json:"cidr"`
}

InterfaceAddress represents a single address attached to the interface.

type InvalidateCredentialArg

type InvalidateCredentialArg struct {
	// Reason is the description of why we are invalidating credential.
	Reason string `json:"reason,omitempty"`
}

InvalidateCredentialArg is used to invalidate a controller credential.

type IsMasterResult

type IsMasterResult struct {
	// Master reports whether the connected agent
	// lives on the same instance as the mongo replica
	// set master.
	Master bool `json:"master"`
}

IsMasterResult holds the result of an IsMaster API call.

type IsMeteredResult

type IsMeteredResult struct {
	Metered bool `json:"metered"`
}

IsMeteredResult stores result from a charms.IsMetered call

type IssueOperatorCertificateResult

type IssueOperatorCertificateResult struct {
	CACert     string `json:"ca-cert"`
	Cert       string `json:"cert"`
	PrivateKey string `json:"private-key"`
	Error      *Error `json:"error,omitempty"`
}

IssueOperatorCertificateResult contains an x509 certificate for a CAAS Operator.

type IssueOperatorCertificateResults

type IssueOperatorCertificateResults struct {
	Results []IssueOperatorCertificateResult `json:"results"`
}

IssueOperatorCertificateResults holds IssueOperatorCertificate results.

type ItemChange

type ItemChange struct {
	Type     int         `json:"type"`
	Key      string      `json:"key"`
	OldValue interface{} `json:"old,omitempty"`
	NewValue interface{} `json:"new,omitempty"`
}

ItemChange is the multiwatcher representation of a core settings ItemChange.

type JobsResult

type JobsResult struct {
	Jobs  []model.MachineJob `json:"jobs"`
	Error *Error             `json:"error,omitempty"`
}

JobsResult holds the jobs for a machine that are returned by a call to Jobs.

type JobsResults

type JobsResults struct {
	Results []JobsResult `json:"results"`
}

JobsResults holds the result of a call to Jobs.

type KnownServiceArgs

type KnownServiceArgs struct {
	// KnownServices are the well known services for a firewall rule.
	KnownServices []KnownServiceValue `json:"known-services"`
}

KnownServiceArgs holds the parameters for retrieving firewall rules.

type KnownServiceValue

type KnownServiceValue string

KnownServiceValue describes a well known service for which a firewall rule can be set up.

const (

	// SSHRule is a rule for SSH connections.
	SSHRule KnownServiceValue = "ssh"

	// JujuControllerRule is a rule for connections to the Juju controller.
	JujuControllerRule KnownServiceValue = "juju-controller"

	// JujuApplicationOfferRule is a rule for connections to a Juju offer.
	JujuApplicationOfferRule KnownServiceValue = "juju-application-offer"
)

func (KnownServiceValue) Validate

func (v KnownServiceValue) Validate() error

Validate returns an error if the service value is not valid.

type KubernetesDeploymentInfo

type KubernetesDeploymentInfo struct {
	DeploymentType string `json:"deployment-type"`
	ServiceType    string `json:"service-type"`
}

KubernetesDeploymentInfo holds deployment info from charm metadata.

type KubernetesDeviceParams

type KubernetesDeviceParams struct {
	Type       DeviceType        `bson:"type"`
	Count      int64             `bson:"count"`
	Attributes map[string]string `bson:"attributes,omitempty"`
}

KubernetesDeviceParams holds a set of device constraints.

type KubernetesFilesystemAttachmentParams

type KubernetesFilesystemAttachmentParams struct {
	Provider   string `json:"provider"`
	MountPoint string `json:"mount-point,omitempty"`
	ReadOnly   bool   `json:"read-only,omitempty"`
}

KubernetesFilesystemAttachmentParams holds the parameters for creating a filesystem attachment.

type KubernetesFilesystemInfo

type KubernetesFilesystemInfo struct {
	StorageName  string                 `json:"storagename"`
	Pool         string                 `json:"pool"`
	Size         uint64                 `json:"size"`
	MountPoint   string                 `json:"mount-point,omitempty"`
	ReadOnly     bool                   `json:"read-only,omitempty"`
	FilesystemId string                 `json:"filesystem-id"`
	Status       string                 `json:"status"`
	Info         string                 `json:"info"`
	Data         map[string]interface{} `json:"data,omitempty"`
	Volume       KubernetesVolumeInfo   `json:"volume"`
}

KubernetesFilesystemInfo describes a storage filesystem in the cloud as reported to the model.

type KubernetesFilesystemParams

type KubernetesFilesystemParams struct {
	StorageName string                                `json:"storagename"`
	Size        uint64                                `json:"size"`
	Provider    string                                `json:"provider"`
	Attributes  map[string]interface{}                `json:"attributes,omitempty"`
	Tags        map[string]string                     `json:"tags,omitempty"`
	Attachment  *KubernetesFilesystemAttachmentParams `json:"attachment,omitempty"`
}

KubernetesFilesystemParams holds the parameters for creating a storage filesystem.

type KubernetesProvisioningInfo

type KubernetesProvisioningInfo struct {
	DeploymentInfo       *KubernetesDeploymentInfo    `json:"deployment-info,omitempty"`
	PodSpec              string                       `json:"pod-spec"`
	RawK8sSpec           string                       `json:"raw-k8s-spec,omitempty"`
	Constraints          constraints.Value            `json:"constraints"`
	Tags                 map[string]string            `json:"tags,omitempty"`
	Filesystems          []KubernetesFilesystemParams `json:"filesystems,omitempty"`
	Volumes              []KubernetesVolumeParams     `json:"volumes,omitempty"`
	Devices              []KubernetesDeviceParams     `json:"devices,omitempty"`
	OperatorImagePath    string                       `json:"operator-image-path,omitempty"`
	CharmModifiedVersion int                          `json:"charm-modified-version,omitempty"`
}

KubernetesProvisioningInfo holds unit provisioning info.

type KubernetesProvisioningInfoResult

type KubernetesProvisioningInfoResult struct {
	Error  *Error                      `json:"error,omitempty"`
	Result *KubernetesProvisioningInfo `json:"result"`
}

KubernetesProvisioningInfoResult holds unit provisioning info or an error.

type KubernetesProvisioningInfoResults

type KubernetesProvisioningInfoResults struct {
	Results []KubernetesProvisioningInfoResult `json:"results"`
}

KubernetesProvisioningInfoResults holds multiple provisioning info results.

type KubernetesUpgradeArg

type KubernetesUpgradeArg struct {
	AgentTag string         `json:"agent-tag"`
	Version  version.Number `json:"version"`
}

KubernetesUpgradeArg holds args used to upgrade an operator.

type KubernetesVolumeAttachmentParams

type KubernetesVolumeAttachmentParams struct {
	Provider string `json:"provider"`
	ReadOnly bool   `json:"read-only,omitempty"`
}

KubernetesVolumeAttachmentParams holds the parameters for creating a volume attachment.

type KubernetesVolumeInfo

type KubernetesVolumeInfo struct {
	VolumeId   string                 `json:"volume-id"`
	Pool       string                 `json:"pool,omitempty"`
	Size       uint64                 `json:"size"`
	Persistent bool                   `json:"persistent"`
	Status     string                 `json:"status"`
	Info       string                 `json:"info"`
	Data       map[string]interface{} `json:"data,omitempty"`
}

Volume describes a storage volume in the cloud as reported to the model.

type KubernetesVolumeParams

type KubernetesVolumeParams struct {
	StorageName string                            `json:"storagename"`
	Size        uint64                            `json:"size"`
	Provider    string                            `json:"provider"`
	Attributes  map[string]interface{}            `json:"attributes,omitempty"`
	Tags        map[string]string                 `json:"tags,omitempty"`
	Attachment  *KubernetesVolumeAttachmentParams `json:"attachment,omitempty"`
}

KubernetesVolumeParams holds the parameters for creating a storage volume.

type LXDProfile

type LXDProfile struct {
	Config      map[string]string            `json:"config"`
	Description string                       `json:"description"`
	Devices     map[string]map[string]string `json:"devices"`
}

LXDProfile holds status info about a LXDProfile

type LXDProfileUpgrade

type LXDProfileUpgrade struct {
	Entities        []Entity `json:"entities"`
	ApplicationName string   `json:"application-name"`
}

LXDProfileUpgrade holds the parameters for an application lxd profile machines

type LifeResult

type LifeResult struct {
	Life  life.Value `json:"life"`
	Error *Error     `json:"error,omitempty"`
}

LifeResult holds the life status of a single entity, or an error indicating why it is not available.

type LifeResults

type LifeResults struct {
	Results []LifeResult `json:"results"`
}

LifeResults holds the life or error status of multiple entities.

type ListCloudImageMetadataResult

type ListCloudImageMetadataResult struct {
	Result []CloudImageMetadata `json:"result"`
}

ListCloudImageMetadataResult holds the results of querying cloud image metadata.

type ListCloudInfo

type ListCloudInfo struct {
	CloudDetails `json:",inline"`

	// Access is the access level for the user.
	Access string `json:"user-access"`
}

ListCloudInfo holds information about a cloud for a user.

type ListCloudInfoResult

type ListCloudInfoResult struct {
	Result *ListCloudInfo `json:"result,omitempty"`
	Error  *Error         `json:"error,omitempty"`
}

ListCloudInfoResult holds the result of a ListCloudInfo call.

type ListCloudInfoResults

type ListCloudInfoResults struct {
	Results []ListCloudInfoResult `json:"results"`
}

ListCloudInfoResults holds the result of a bulk ListCloudInfo call.

type ListCloudsRequest

type ListCloudsRequest struct {
	UserTag string `json:"user-tag"`
	All     bool   `json:"all,omitempty"`
}

ListCloudsRequest encapsulates how we request a list of cloud details for a user.

type ListFirewallRulesResults

type ListFirewallRulesResults struct {
	// Rules is a list of firewall rules.
	Rules []FirewallRule
}

ListFirewallRulesResults holds the results of listing firewall rules.

type ListImageResult

type ListImageResult struct {
	Result []ImageMetadata `json:"result"`
}

ListImageResult holds the results of querying images.

type ListResourcesArgs

type ListResourcesArgs Entities

ListResourcesArgs are the arguments for the ListResources endpoint.

type ListSSHKeys

type ListSSHKeys struct {
	Entities `json:"entities"`
	Mode     ssh.ListMode `json:"mode"`
}

ListSSHKeys stores parameters used for a KeyManager.ListKeys call.

type ListSpacesResults

type ListSpacesResults struct {
	Results []Space `json:"results"`
}

ListSpacesResults holds the list of all available spaces.

type ListSubnetsResults

type ListSubnetsResults struct {
	Results []Subnet `json:"results"`
}

ListSubnetsResults holds the result of a ListSubnets API call.

type ListUnitResourcesArgs

type ListUnitResourcesArgs struct {
	// ResourceNames holds the names of the application's resources for
	// which information should be provided.
	ResourceNames []string `json:"resource-names"`
}

ListResourcesArgs holds the arguments for an API request to list resources for an application. The application is implicit to the uniter- specific HTTP connection.

type LogForwardingGetLastSentParams

type LogForwardingGetLastSentParams struct {
	// IDs holds the list of IDs for which individual "last sent"
	// timestamps should be returned (in the same order).
	IDs []LogForwardingID `json:"ids"`
}

LogForwardingGetLastSentParams holds the arguments for a call to the GetLastSent method of the LogForwarding facade.

type LogForwardingGetLastSentResult

type LogForwardingGetLastSentResult struct {
	// RecordID is the ID of the last log record that was
	// forwarded for a given model and sink. If Error is set then the
	// meaning of this value is undefined.
	RecordID int64 `json:"record-id"`

	// RecordTimestamp is the timestamp of the last log record that was
	// forwarded for a given model and sink. If Error is set then the
	// meaning of this value is undefined.
	RecordTimestamp int64 `json:"record-timestamp"`

	// Error holds the error, if any, that resulted while handling the
	// request for a specific ID.
	Error *Error `json:"err"`
}

LogForwardingGetLastSentResult holds a single result from a call to the GetLastSent method of the LogForwarding facade.

type LogForwardingGetLastSentResults

type LogForwardingGetLastSentResults struct {
	// Results holds the list of results that correspond to the IDs
	// sent in a GetLastSent call.
	Results []LogForwardingGetLastSentResult `json:"results"`
}

LogForwardingGetLastSentResults holds the results of a call to the GetLastSent method of the LogForwarding facade.

type LogForwardingID

type LogForwardingID struct {
	// ModelTag identifies the model associated with the log record.
	ModelTag string `json:"model"`

	// Sink is the name of the log forwarding target to which a log
	// record was last sent.
	Sink string `json:"sink"`
}

LogForwardingID is the API data that identifies a log forwarding "last sent" value. The controller has a mapping from a set of IDs to a timestamp (for each ID). The timestamp corresponds to the last log record that the specific log forwarding machinery sent to the identified "sink" (for a given model).

type LogForwardingSetLastSentParam

type LogForwardingSetLastSentParam struct {
	LogForwardingID

	// RecordID identifies the record ID to set for the given ID.
	RecordID int64 `json:"record-id"`

	// RecordTimestamp identifies the record timestamp to set for the given ID.
	RecordTimestamp int64 `json:"record-timestamp"`
}

LogForwardingSetLastSentParams holds holds the info needed to set a new "last sent" value via a call to the SetLastSent method of the LogForwarding facade.

type LogForwardingSetLastSentParams

type LogForwardingSetLastSentParams struct {
	// Params holds the list of individual requests for "last sent" info.
	Params []LogForwardingSetLastSentParam `json:"params"`
}

LogForwardingSetLastSentParams holds the arguments for a call to the SetLastSent method of the LogForwarding facade.

type LogMessage

type LogMessage struct {
	Entity    string    `json:"tag"`
	Timestamp time.Time `json:"ts"`
	Severity  string    `json:"sev"`
	Module    string    `json:"mod"`
	Location  string    `json:"loc"`
	Message   string    `json:"msg"`
}

LogMessage is a structured logging entry.

type LogRecord

type LogRecord struct {
	Time     time.Time `json:"t"`
	Module   string    `json:"m"`
	Location string    `json:"l"`
	Level    string    `json:"v"`
	Message  string    `json:"x"`
	Entity   string    `json:"e,omitempty"`
}

LogRecord is used to transmit log messages to the logsink API endpoint. Single character field names are used for serialisation to keep the size down. These messages are going to be sent a lot.

type LogStreamConfig

type LogStreamConfig struct {
	// Sink identifies the target to which log records will be streamed.
	// This is used as a bookmark for where to start the next time logs
	// are streamed for the same sink.
	Sink string `schema:"sink" url:"sink,omitempty"`

	// MaxLookbackDuration is the maximum time duration from the past to stream.
	// It must be a valid time duration string.
	MaxLookbackDuration string `schema:"maxlookbackduration" url:"maxlookbackduration,omitempty"`

	// MaxLookbackRecords is the maximum number of log records to stream from the past.
	MaxLookbackRecords int `schema:"maxlookbackrecords" url:"maxlookbackrecords,omitempty"`
}

LogStreamConfig holds all the information necessary to open a streaming connection to the API endpoint for reading log records.

The field tags relate to the following 2 libraries:

github.com/google/go-querystring/query (encoding)
github.com/gorilla/schema (decoding)

See apiserver/debuglog.go:debugLogParams for additional things we may consider supporting here.

type LogStreamRecord

type LogStreamRecord struct {
	ID        int64     `json:"id"`
	ModelUUID string    `json:"mid"`
	Entity    string    `json:"ent"`
	Version   string    `json:"ver,omitempty"`
	Timestamp time.Time `json:"ts"`
	Module    string    `json:"mod"`
	Location  string    `json:"lo"`
	Level     string    `json:"lv"`
	Message   string    `json:"msg"`
}

LogStreamRecord describes a single log record being streamed from the server.

type LogStreamRecords

type LogStreamRecords struct {
	Records []LogStreamRecord `json:"records"`
}

LogStreamRecord contains a slice of LogStreamRecords.

type LoginRequest

type LoginRequest struct {
	AuthTag       string           `json:"auth-tag"`
	Credentials   string           `json:"credentials"`
	Nonce         string           `json:"nonce"`
	Macaroons     []macaroon.Slice `json:"macaroons"`
	BakeryVersion bakery.Version   `json:"bakery-version,omitempty"`
	CLIArgs       string           `json:"cli-args,omitempty"`
	UserData      string           `json:"user-data"`
}

LoginRequest holds credentials for identifying an entity to the Login v1 facade. AuthTag holds the tag of the user to connect as. If it is empty, then the provided macaroon slices will be used for authentication (if any one is valid, the authentication succeeds). If there are no valid macaroons and macaroon authentication is configured, the LoginResult will contain a macaroon that when discharged, may allow access.

type LoginRequestCompat

type LoginRequestCompat struct {
	LoginRequest `json:"login-request"`
	Creds        `json:"creds"`
}

LoginRequestCompat holds credentials for identifying an entity to the Login v1 or earlier (v0 or even pre-facade).

type LoginResult

type LoginResult struct {
	// DischargeRequired implies that the login request has failed, and none of
	// the other fields are populated. It contains a macaroon which, when
	// discharged, will grant access on a subsequent call to Login.
	// Note: It is OK to use the Macaroon type here as it is explicitly
	// designed to provide stable serialisation of macaroons.  It's good
	// practice to only use primitives in types that will be serialised,
	// however because of the above it is suitable to use the Macaroon type
	// here.
	DischargeRequired *macaroon.Macaroon `json:"discharge-required,omitempty"`

	// BakeryDischargeRequired implies that the login request has failed, and none of
	// the other fields are populated. It contains a macaroon which, when
	// discharged, will grant access on a subsequent call to Login.
	// Note: It is OK to use the Macaroon type here as it is explicitly
	// designed to provide stable serialisation of macaroons.  It's good
	// practice to only use primitives in types that will be serialised,
	// however because of the above it is suitable to use the Macaroon type
	// here.
	// This is the macaroon emitted by newer Juju controllers using bakery.v2.
	BakeryDischargeRequired *bakery.Macaroon `json:"bakery-discharge-required,omitempty"`

	// DischargeRequiredReason holds the reason that the above discharge was
	// required.
	DischargeRequiredReason string `json:"discharge-required-error,omitempty"`

	// Servers is the list of API server addresses.
	Servers [][]HostPort `json:"servers,omitempty"`

	// PublicDNSName holds the host name for which an officially
	// signed certificate will be used for TLS connection to the server.
	// If empty, the private Juju CA certificate must be used to verify
	// the connection.
	PublicDNSName string `json:"public-dns-name,omitempty"`

	// ModelTag is the tag for the model that is being connected to.
	ModelTag string `json:"model-tag,omitempty"`

	// ControllerTag is the tag for the controller that runs the API servers.
	ControllerTag string `json:"controller-tag,omitempty"`

	// UserInfo describes the authenticated user, if any.
	UserInfo *AuthUserInfo `json:"user-info,omitempty"`

	// Facades describes all the available API facade versions to the
	// authenticated client.
	Facades []FacadeVersions `json:"facades,omitempty"`

	// ServerVersion is the string representation of the server version
	// if the server supports it.
	ServerVersion string `json:"server-version,omitempty"`
}

LoginResult holds the result of an Admin Login call.

type LookUpPayloadArg

type LookUpPayloadArg struct {
	// Name is the payload name.
	Name string `json:"name"`

	// ID uniquely identifies the payload for the given name.
	ID string `json:"id"`
}

LookUpPayloadArg contains all the information necessary to identify a payload.

type LookUpPayloadArgs

type LookUpPayloadArgs struct {
	// Args is the list of arguments to pass to this function.
	Args []LookUpPayloadArg `json:"args"`
}

LookUpPayloadArgs are the arguments for the LookUp endpoint.

type MacaroonResult

type MacaroonResult struct {
	Result *macaroon.Macaroon `json:"result,omitempty"`
	Error  *Error             `json:"error,omitempty"`
}

MacaroonResult contains a macaroon or an error.

type MacaroonResults

type MacaroonResults struct {
	Results []MacaroonResult `json:"results"`
}

MacaroonResults contains a set of MacaroonResults.

type MachineAddresses

type MachineAddresses struct {
	Tag       string    `json:"tag"`
	Addresses []Address `json:"addresses"`
}

MachineAddresses holds an machine tag and addresses.

type MachineAddressesResult

type MachineAddressesResult struct {
	Error     *Error    `json:"error,omitempty"`
	Addresses []Address `json:"addresses"`
}

MachineAddressesResult holds a list of machine addresses or an error.

type MachineAddressesResults

type MachineAddressesResults struct {
	Results []MachineAddressesResult `json:"results"`
}

MachineAddressesResults holds the results of calling an API method returning a list of addresses per machine.

type MachineBlockDevices

type MachineBlockDevices struct {
	Machine      string                `json:"machine"`
	BlockDevices []storage.BlockDevice `json:"block-devices,omitempty"`
}

MachineBlockDevices holds a machine tag and the block devices present on that machine.

type MachineContainerResult

type MachineContainerResult struct {
	Error          *Error                   `json:"error,omitempty"`
	ContainerTypes []instance.ContainerType `json:"container-types"`
	Determined     bool                     `json:"determined"`
}

MachineContainerResult holds the result of making the call to SupportedContainers on a given machine.

type MachineContainerResults

type MachineContainerResults struct {
	Results []MachineContainerResult `json:"results"`
}

MachineContainerResults holds the results from making the call to SupportedContainers on a given machine.

type MachineContainers

type MachineContainers struct {
	MachineTag     string                   `json:"machine-tag"`
	ContainerTypes []instance.ContainerType `json:"container-types"`
}

MachineContainers holds the arguments for making an SetSupportedContainers call on a given machine.

type MachineContainersParams

type MachineContainersParams struct {
	Params []MachineContainers `json:"params"`
}

MachineContainersParams holds the arguments for making a SetSupportedContainers API call.

type MachineHardware

type MachineHardware struct {
	Arch             *string   `json:"arch,omitempty"`
	Mem              *uint64   `json:"mem,omitempty"`
	RootDisk         *uint64   `json:"root-disk,omitempty"`
	Cores            *uint64   `json:"cores,omitempty"`
	CpuPower         *uint64   `json:"cpu-power,omitempty"`
	Tags             *[]string `json:"tags,omitempty"`
	AvailabilityZone *string   `json:"availability-zone,omitempty"`
}

MachineHardware holds information about a machine's hardware characteristics.

type MachineInfo

type MachineInfo struct {
	ModelUUID                string                            `json:"model-uuid"`
	Id                       string                            `json:"id"`
	InstanceId               string                            `json:"instance-id"`
	AgentStatus              StatusInfo                        `json:"agent-status"`
	InstanceStatus           StatusInfo                        `json:"instance-status"`
	Life                     life.Value                        `json:"life"`
	Config                   map[string]interface{}            `json:"config,omitempty"`
	Series                   string                            `json:"series"`
	ContainerType            string                            `json:"container-type"`
	IsManual                 bool                              `json:"-"` // internal use only
	SupportedContainers      []instance.ContainerType          `json:"supported-containers"`
	SupportedContainersKnown bool                              `json:"supported-containers-known"`
	HardwareCharacteristics  *instance.HardwareCharacteristics `json:"hardware-characteristics,omitempty"`
	CharmProfiles            []string                          `json:"charm-profiles,omitempty"`
	Jobs                     []model.MachineJob                `json:"jobs"`
	Addresses                []Address                         `json:"addresses"`
	HasVote                  bool                              `json:"has-vote"`
	WantsVote                bool                              `json:"wants-vote"`
}

MachineInfo holds the information about a machine that is tracked by multiwatcherStore.

func (*MachineInfo) EntityId

func (i *MachineInfo) EntityId() EntityId

EntityId returns a unique identifier for a machine across models.

type MachineNetworkConfigResult

type MachineNetworkConfigResult struct {
	Error *Error `json:"error,omitempty"`

	// Tagged to Info due to compatibility reasons.
	Config []NetworkConfig `json:"info"`
}

MachineNetworkConfigResult holds network configuration for a single machine.

type MachineNetworkConfigResults

type MachineNetworkConfigResults struct {
	Results []MachineNetworkConfigResult `json:"results"`
}

MachineNetworkConfigResults holds network configuration for multiple machines.

type MachinePortRange

type MachinePortRange struct {
	UnitTag     string    `json:"unit-tag"`
	RelationTag string    `json:"relation-tag"`
	PortRange   PortRange `json:"port-range"`
}

MachinePortRange holds a single port range open on a machine for the given unit and relation tags.

type MachinePorts

type MachinePorts struct {
	MachineTag string `json:"machine-tag"`
	SubnetTag  string `json:"subnet-tag"`
}

MachinePorts holds a machine and subnet tags. It's used when referring to opened ports on the machine for a subnet.

type MachinePortsParams

type MachinePortsParams struct {
	Params []MachinePorts `json:"params"`
}

MachinePortsParams holds the arguments for making a FirewallerAPIV1.GetMachinePorts() API call.

type MachinePortsResult

type MachinePortsResult struct {
	Error *Error             `json:"error,omitempty"`
	Ports []MachinePortRange `json:"ports"`
}

MachinePortsResult holds a single result of the FirewallerAPIV1.GetMachinePorts() and UniterAPI.AllMachinePorts() API calls.

type MachinePortsResults

type MachinePortsResults struct {
	Results []MachinePortsResult `json:"results"`
}

MachinePortsResults holds all the results of the FirewallerAPIV1.GetMachinePorts() and UniterAPI.AllMachinePorts() API calls.

type MachineStatus

type MachineStatus struct {
	AgentStatus        DetailedStatus `json:"agent-status"`
	InstanceStatus     DetailedStatus `json:"instance-status"`
	ModificationStatus DetailedStatus `json:"modification-status"`

	DNSName string `json:"dns-name"`

	// IPAddresses holds the IP addresses known for this machine. It is
	// here for backwards compatibility. It should be similar to its
	// namesakes in NetworkInterfaces, but may also include any
	// public/floating IP addresses not actually bound to the machine but
	// known to the provider.
	IPAddresses []string `json:"ip-addresses,omitempty"`

	// InstanceId holds the unique identifier for this machine, based on
	// what is supplied by the provider.
	InstanceId instance.Id `json:"instance-id"`

	// DisplayName is a human-readable name for this machine.
	DisplayName string `json:"display-name"`

	// Series holds the name of the operating system release installed on
	// this machine.
	Series string `json:"series"`

	// Id is the Juju identifier for this machine in this model.
	Id string `json:"id"`

	// NetworkInterfaces holds a map of NetworkInterface for this machine.
	NetworkInterfaces map[string]NetworkInterface `json:"network-interfaces,omitempty"`

	// Containers holds the MachineStatus of any containers hosted on this
	// machine.
	Containers map[string]MachineStatus `json:"containers"`

	// Constraints holds a string of space-separated key=value pairs for
	// each constraint datum.
	Constraints string `json:"constraints"`

	// Hardware holds a string of space-separated key=value pairs for each
	// hardware specification datum.
	Hardware string `json:"hardware"`

	Jobs      []model.MachineJob `json:"jobs"`
	HasVote   bool               `json:"has-vote"`
	WantsVote bool               `json:"wants-vote"`

	// LXDProfiles holds all the machines current LXD profiles that have
	// been applied to the machine
	LXDProfiles map[string]LXDProfile `json:"lxd-profiles,omitempty"`

	// PrimaryControllerMachine indicates whether this machine has a primary mongo instance in replicaset and,
	//	// thus, can be considered a primary controller machine in HA setup.
	PrimaryControllerMachine *bool `json:"primary-controller-machine,omitempty"`
}

MachineStatus holds status info about a machine.

type MachineStorageId

type MachineStorageId struct {
	MachineTag string `json:"machine-tag"`
	// AttachmentTag is the tag of the volume or filesystem whose
	// attachment to the machine is represented.
	AttachmentTag string `json:"attachment-tag"`
}

MachineStorageId identifies the attachment of a storage entity to a machine, by their tags.

type MachineStorageIds

type MachineStorageIds struct {
	Ids []MachineStorageId `json:"ids"`
}

MachineStorageIds holds a set of machine/storage-entity attachment identifiers.

type MachineStorageIdsWatchResult

type MachineStorageIdsWatchResult struct {
	MachineStorageIdsWatcherId string             `json:"watcher-id"`
	Changes                    []MachineStorageId `json:"changes"`
	Error                      *Error             `json:"error,omitempty"`
}

MachineStorageIdsWatchResult holds a MachineStorageIdsWatcher id, changes and an error (if any).

type MachineStorageIdsWatchResults

type MachineStorageIdsWatchResults struct {
	Results []MachineStorageIdsWatchResult `json:"results"`
}

MachineStorageIdsWatchResults holds the results for any API call which ends up returning a list of MachineStorageIdsWatchers.

type MapResult

type MapResult struct {
	Result map[string]interface{} `json:"result"`
	Error  *Error                 `json:"error,omitempty"`
}

MapResult holds a generic map or an error.

type MapResults

type MapResults struct {
	Results []MapResult `json:"results"`
}

MapResults holds the bulk operation result of an API call that returns a map or an error.

type MasterMigrationStatus

type MasterMigrationStatus struct {
	Spec             MigrationSpec `json:"spec"`
	MigrationId      string        `json:"migration-id"`
	Phase            string        `json:"phase"`
	PhaseChangedTime time.Time     `json:"phase-changed-time"`
}

MasterMigrationStatus is used to report the current status of a model migration for the migrationmaster. It includes authentication details for the remote controller.

type MergeLeadershipSettingsBulkParams

type MergeLeadershipSettingsBulkParams struct {

	// Params are the parameters for making a bulk leadership settings
	// merge.
	Params []MergeLeadershipSettingsParam `json:"params"`
}

MergeLeadershipSettingsBulkParams is a collection of parameters for making a bulk merge of leadership settings.

type MergeLeadershipSettingsParam

type MergeLeadershipSettingsParam struct {
	// ApplicationTag is the application for which you want to merge
	// leadership settings.
	ApplicationTag string `json:"application-tag,omitempty"`

	// UnitTag is the unit for which you want to merge
	// leadership settings.
	UnitTag string `json:"unit-tag,omitempty"`

	// Settings are the Leadership settings you wish to merge in.
	Settings Settings `json:"settings"`
}

MergeLeadershipSettingsParam are the parameters needed for merging in leadership settings.

type MetadataImageIds

type MetadataImageIds struct {
	Ids []string `json:"image-ids"`
}

MetadataImageIds holds image ids and can be used to identify related image metadata.

type MetadataSaveParams

type MetadataSaveParams struct {
	Metadata []CloudImageMetadataList `json:"metadata,omitempty"`
}

MetadataSaveParams holds lists of cloud image metadata to save. Each list will be saved atomically.

type MeterStatus

type MeterStatus struct {
	Color   string `json:"color"`
	Message string `json:"message"`
}

MeterStatus represents the meter status of a unit.

type MeterStatusParam

type MeterStatusParam struct {
	Tag  string `json:"tag"`
	Code string `json:"code"`
	Info string `json:"info,omitempty"`
}

MeterStatusParam holds meter status information to be set for the specified tag.

type MeterStatusParams

type MeterStatusParams struct {
	Statuses []MeterStatusParam `json:"statues"`
}

MeterStatusParams holds parameters for making SetMeterStatus calls.

type MeterStatusResult

type MeterStatusResult struct {
	Code  string `json:"code"`
	Info  string `json:"info"`
	Error *Error `json:"error,omitempty"`
}

MeterStatusResult holds unit meter status or error.

type MeterStatusResults

type MeterStatusResults struct {
	Results []MeterStatusResult `json:"results"`
}

MeterStatusResults holds meter status results for multiple units.

type Metric

type Metric struct {
	Key    string            `json:"key"`
	Value  string            `json:"value"`
	Time   time.Time         `json:"time"`
	Labels map[string]string `json:"labels,omitempty"`
}

Metric holds a single metric.

type MetricBatch

type MetricBatch struct {
	UUID     string    `json:"uuid"`
	CharmURL string    `json:"charm-url"`
	Created  time.Time `json:"created"`
	Metrics  []Metric  `json:"metrics"`
}

MetricBatch is a list of metrics with metadata.

type MetricBatchParam

type MetricBatchParam struct {
	Tag   string      `json:"tag"`
	Batch MetricBatch `json:"batch"`
}

MetricBatchParam contains a single metric batch.

type MetricBatchParams

type MetricBatchParams struct {
	Batches []MetricBatchParam `json:"batches"`
}

MetricBatchParams contains multiple metric batches.

type MetricResult

type MetricResult struct {
	Time   time.Time         `json:"time"`
	Key    string            `json:"key"`
	Value  string            `json:"value"`
	Unit   string            `json:"unit"`
	Labels map[string]string `json:"labels"`
}

MetricResult contains a single metric.

type MetricResults

type MetricResults struct {
	Results []EntityMetrics `json:"results"`
}

MetricResults contains results from a GetMetrics call, with one item per Entity given as an argument to the command.

func (*MetricResults) OneError

func (m *MetricResults) OneError() error

OneError returns the first error

type MetricsParam

type MetricsParam struct {
	Tag     string   `json:"tag"`
	Metrics []Metric `json:"metrics"`
}

MetricsParam contains the metrics for a single unit.

type MetricsParams

type MetricsParams struct {
	Metrics []MetricsParam `json:"metrics"`
}

MetricsParams contains the metrics for multiple units.

type MigrationModelInfo

type MigrationModelInfo struct {
	UUID                   string         `json:"uuid"`
	Name                   string         `json:"name"`
	OwnerTag               string         `json:"owner-tag"`
	AgentVersion           version.Number `json:"agent-version"`
	ControllerAgentVersion version.Number `json:"controller-agent-version"`
}

MigrationModelInfo is used to report basic model information to the migrationmaster worker.

type MigrationSpec

type MigrationSpec struct {
	ModelTag   string              `json:"model-tag"`
	TargetInfo MigrationTargetInfo `json:"target-info"`
}

MigrationSpec holds the details required to start the migration of a single model.

type MigrationStatus

type MigrationStatus struct {
	MigrationId string `json:"migration-id"`
	Attempt     int    `json:"attempt"`
	Phase       string `json:"phase"`

	// TODO(mjs): I'm not convinced these Source fields will get used.
	SourceAPIAddrs []string `json:"source-api-addrs"`
	SourceCACert   string   `json:"source-ca-cert"`

	TargetAPIAddrs []string `json:"target-api-addrs"`
	TargetCACert   string   `json:"target-ca-cert"`
}

MigrationStatus reports the current status of a model migration.

type MigrationTargetInfo

type MigrationTargetInfo struct {
	ControllerTag   string   `json:"controller-tag"`
	ControllerAlias string   `json:"controller-alias,omitempty"`
	Addrs           []string `json:"addrs"`
	CACert          string   `json:"ca-cert"`
	AuthTag         string   `json:"auth-tag"`
	Password        string   `json:"password,omitempty"`
	Macaroons       string   `json:"macaroons,omitempty"`
}

MigrationTargetInfo holds the details required to connect to and authenticate with a remote controller for model migration.

type MinionReport

type MinionReport struct {
	// MigrationId holds the id of the migration the agent is
	// reporting about.
	MigrationId string `json:"migration-id"`

	// Phase holds the phase of the migration the agent is
	// reporting about.
	Phase string `json:"phase"`

	// Success is true if the agent successfully completed its actions
	// for the migration phase, false otherwise.
	Success bool `json:"success"`
}

MinionReport holds the details of whether a migration minion succeeded or failed for a specific migration phase.

type MinionReports

type MinionReports struct {
	// MigrationId holds the id of the migration the reports related to.
	MigrationId string `json:"migration-id"`

	// Phase holds the phase of the migration the reports related to.
	Phase string `json:"phase"`

	// SuccessCount holds the number of agents which have successfully
	// completed a given migration phase.
	SuccessCount int `json:"success-count"`

	// UnknownCount holds the number of agents still to report for a
	// given migration phase.
	UnknownCount int `json:"unknown-count"`

	// UnknownSample holds the tags of a limited number of agents
	// that are still to report for a given migration phase (for
	// logging or showing in a user interface).
	UnknownSample []string `json:"unknown-sample"`

	// Failed contains the tags of all agents which have reported a
	// failed to complete a given migration phase.
	Failed []string `json:"failed"`
}

MinionReports holds the details of whether a migration minion succeeded or failed for a specific migration phase.

type Model

type Model struct {
	Name     string `json:"name"`
	UUID     string `json:"uuid"`
	Type     string `json:"type"`
	OwnerTag string `json:"owner-tag"`
}

Model holds the result of an API call returning a name and UUID for a model and the tag of the server in which it is running.

type ModelAbstract

type ModelAbstract struct {
	UUID    string `json:"uuid"`
	Removed bool   `json:"removed,omitempty"`

	Controller string   `json:"controller,omitempty"`
	Name       string   `json:"name,omitempty"`
	Admins     []string `json:"admins,omitempty"`

	Cloud