application

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 69 Imported by: 6

Documentation

Overview

Package application contains API calls for functionality related to deploying and managing applications and their related charms.

Index

Constants

This section is empty.

Variables

View Source
var ClassifyDetachedStorage = storagecommon.ClassifyDetachedStorage
View Source
var (
	// ErrInvalidAgentVersions is a sentinal error for when we can no longer
	// upgrade juju using 2.5.x agents with 2.6 or greater controllers.
	ErrInvalidAgentVersions = errors.Errorf(
		"Unable to upgrade LXDProfile charms with the current model version. " +
			"Please run juju upgrade-model to upgrade the current model to match your controller.")
)

Functions

func ConfigSchema

func ConfigSchema() (configschema.Fields, schema.Defaults, error)

ConfigSchema returns the config schema and defaults for an application.

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

func StateCharmOrigin

func StateCharmOrigin(origin corecharm.Origin) (*state.CharmOrigin, error)

StateCharmOrigin returns a state layer CharmOrigin given a core Origin.

Types

type APIBase

type APIBase struct {
	// contains filtered or unexported fields
}

APIBase implements the shared application interface and is the concrete implementation of the api end point.

func NewAPIBase

func NewAPIBase(
	backend Backend,
	services Services,
	storageAccess StorageInterface,
	authorizer facade.Authorizer,
	blockChecker BlockChecker,
	model Model,
	modelInfo model.ModelInfo,
	leadershipReader Leadership,
	repoDeploy DeployFromRepository,
	deployApplication DeployApplicationFunc,
	registry storage.ProviderRegistry,
	resources facade.Resources,
	caasBroker CaasBrokerInterface,
	store objectstore.ObjectStore,
	logger corelogger.Logger,
) (*APIBase, error)

NewAPIBase returns a new application API facade.

func (*APIBase) AddRelation

func (api *APIBase) AddRelation(ctx context.Context, args params.AddRelation) (_ params.AddRelationResults, err error)

AddRelation adds a relation between the specified endpoints and returns the relation info.

func (*APIBase) AddUnits

AddUnits adds a given number of units to an application.

func (*APIBase) ApplicationsInfo

func (api *APIBase) ApplicationsInfo(ctx context.Context, in params.Entities) (params.ApplicationInfoResults, error)

ApplicationsInfo returns applications information.

func (*APIBase) CharmConfig

CharmConfig returns charm config for the input list of applications.

func (*APIBase) CharmRelations

CharmRelations implements the server side of Application.CharmRelations.

func (*APIBase) Consume

Consume adds remote applications to the model without creating any relations.

func (*APIBase) Deploy

Deploy fetches the charms from the charm store and deploys them using the specified placement directives.

func (*APIBase) DeployFromRepository

DeployFromRepository is a one-stop deployment method for repository charms. Only a charm name is required to deploy. If argument validation fails, a list of all errors found in validation will be returned. If a local resource is provided, details required for uploading the validated resource will be returned.

func (*APIBase) DestroyApplication

DestroyApplication removes a given set of applications.

func (*APIBase) DestroyConsumedApplications

func (api *APIBase) DestroyConsumedApplications(ctx context.Context, args params.DestroyConsumedApplicationsParams) (params.ErrorResults, error)

DestroyConsumedApplications removes a given set of consumed (remote) applications.

func (*APIBase) DestroyRelation

func (api *APIBase) DestroyRelation(ctx context.Context, args params.DestroyRelation) (err error)

DestroyRelation removes the relation between the specified endpoints or an id.

func (*APIBase) DestroyUnit

DestroyUnit removes a given set of application units.

func (*APIBase) Expose

func (api *APIBase) Expose(ctx context.Context, args params.ApplicationExpose) error

Expose changes the juju-managed firewall to expose any ports that were also explicitly marked by units as open.

func (*APIBase) Get

Get returns the charm configuration for an application.

func (*APIBase) GetCharmURLOrigin

func (api *APIBase) GetCharmURLOrigin(ctx context.Context, args params.ApplicationGet) (params.CharmURLOriginResult, error)

GetCharmURLOrigin returns the charm URL and charm origin the given application is running at present.

func (*APIBase) GetConfig

GetConfig returns the charm config for each of the input applications.

func (*APIBase) GetConstraints

GetConstraints returns the constraints for a given application.

func (*APIBase) Leader

func (api *APIBase) Leader(ctx context.Context, entity params.Entity) (params.StringResult, error)

Leader returns the unit name of the leader for the given application.

func (*APIBase) MergeBindings

MergeBindings merges operator-defined bindings with the current bindings for one or more applications.

func (*APIBase) ResolveUnitErrors

func (api *APIBase) ResolveUnitErrors(ctx context.Context, p params.UnitsResolved) (params.ErrorResults, error)

ResolveUnitErrors marks errors on the specified units as resolved.

func (*APIBase) ScaleApplications

ScaleApplications scales the specified application to the requested number of units.

func (*APIBase) SetCharm

func (api *APIBase) SetCharm(ctx context.Context, args params.ApplicationSetCharmV2) error

SetCharm sets the charm for a given for the application.

func (*APIBase) SetConfigs

func (api *APIBase) SetConfigs(ctx context.Context, args params.ConfigSetArgs) (params.ErrorResults, error)

SetConfigs implements the server side of Application.SetConfig. Both application and charm config are set. It does not unset values in Config map that are set to an empty string. Unset should be used for that.

func (*APIBase) SetConstraints

func (api *APIBase) SetConstraints(ctx context.Context, args params.SetConstraints) error

SetConstraints sets the constraints for a given application.

func (*APIBase) SetRelationsSuspended

func (api *APIBase) SetRelationsSuspended(ctx context.Context, args params.RelationSuspendedArgs) (params.ErrorResults, error)

SetRelationsSuspended sets the suspended status of the specified relations.

func (*APIBase) Unexpose

func (api *APIBase) Unexpose(ctx context.Context, args params.ApplicationUnexpose) error

Unexpose changes the juju-managed firewall to unexpose any ports that were also explicitly marked by units as open.

func (*APIBase) UnitsInfo

func (api *APIBase) UnitsInfo(ctx context.Context, in params.Entities) (params.UnitInfoResults, error)

UnitsInfo returns unit information for the given entities (units or applications).

func (*APIBase) UnsetApplicationsConfig

func (api *APIBase) UnsetApplicationsConfig(ctx context.Context, args params.ApplicationConfigUnsetArgs) (params.ErrorResults, error)

UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig.

type APIv19

type APIv19 struct {
	*APIv20
}

APIv19 provides the Application API facade for version 19.

func (*APIv19) SetCharm

func (api *APIv19) SetCharm(ctx context.Context, argsV1 params.ApplicationSetCharmV1) error

SetCharm sets the charm for a given for the application. The v1 args use "storage-constraints" as the storage directive attr tag.

type APIv20

type APIv20 struct {
	*APIBase
}

APIv20 provides the Application API facade for version 20.

type AgentTools

type AgentTools interface {
	AgentTools() (*tools.Tools, error)
}

AgentTools is a point of use agent tools requester.

type AgentVersioner

type AgentVersioner interface {
	AgentVersion() (version.Number, error)
}

AgentVersioner is a point of use agent version object.

type Application

type Application interface {
	Name() string
	AddUnit(state.AddUnitParams) (Unit, error)
	AllUnits() ([]Unit, error)
	ApplicationConfig() (coreconfig.ConfigAttributes, error)
	ApplicationTag() names.ApplicationTag
	CharmURL() (*string, bool)
	CharmOrigin() *state.CharmOrigin
	ClearExposed() error
	CharmConfig() (charm.Settings, error)
	DestroyOperation(objectstore.ObjectStore) *state.DestroyApplicationOperation
	EndpointBindings() (Bindings, error)
	ExposedEndpoints() map[string]state.ExposedEndpoint
	Endpoints() ([]relation.Endpoint, error)
	IsExposed() bool
	IsPrincipal() bool
	IsRemote() bool
	SetCharm(state.SetCharmConfig, objectstore.ObjectStore) error
	SetConstraints(constraints.Value) error
	MergeExposeSettings(map[string]state.ExposedEndpoint) error
	UnsetExposeSettings([]string) error
	UpdateCharmConfig(charm.Settings) error
	UpdateApplicationConfig(coreconfig.ConfigAttributes, []string, configschema.Fields, schema.Defaults) error
	MergeBindings(*state.Bindings, bool) error
}

Application defines a subset of the functionality provided by the state.Application type, as required by the application facade. For details on the methods, see the methods on state.Application with the same names.

func DeployApplication

func DeployApplication(
	ctx context.Context, st ApplicationDeployer, model Model,
	modelInfo coremodel.ModelInfo,
	applicationService ApplicationService,
	store objectstore.ObjectStore,
	args DeployApplicationParams,
	logger corelogger.Logger,
) (Application, error)

DeployApplication takes a charm and various parameters and deploys it.

func NewStateApplication

func NewStateApplication(
	st *state.State,
	app *state.Application,
) Application

NewStateApplication converts a state.Application into an Application.

type ApplicationDeployer

type ApplicationDeployer interface {
	AddApplication(state.AddApplicationArgs, objectstore.ObjectStore) (Application, error)

	// ReadSequence is a stop gap to allow the next unit number to be read from mongo
	// so that correctly matching units can be written to dqlite.
	ReadSequence(name string) (int, error)
}

type ApplicationService

type ApplicationService interface {
	// CreateApplication creates the specified application and units if required.
	CreateApplication(ctx context.Context, name string, charm internalcharm.Charm, origin corecharm.Origin, params applicationservice.AddApplicationArgs, units ...applicationservice.AddUnitArg) (coreapplication.ID, error)
	// AddUnits adds units to the application.
	AddUnits(ctx context.Context, name string, units ...applicationservice.AddUnitArg) error
	// SetApplicationCharm sets a new charm for the application, validating that aspects such
	// as storage are still viable with the new charm.
	SetApplicationCharm(ctx context.Context, name string, params applicationservice.UpdateCharmParams) error
	// SetApplicationScale sets the application's desired scale value.
	// This is used on CAAS models.
	SetApplicationScale(ctx context.Context, name string, scale int) error
	// ChangeApplicationScale alters the existing scale by the provided change amount, returning the new amount.
	// This is used on CAAS models.
	ChangeApplicationScale(ctx context.Context, name string, scaleChange int) (int, error)

	// DestroyApplication prepares an application for removal from the model.
	DestroyApplication(ctx context.Context, name string) error

	// DeleteApplication deletes the specified application,
	// TODO(units) - remove when destroy is fully implemented.
	DeleteApplication(ctx context.Context, name string) error

	// DestroyUnit prepares a unit for removal from the model.
	DestroyUnit(context.Context, unit.Name) error

	// GetApplicationLife looks up the life of the specified application.
	GetApplicationLife(ctx context.Context, name string) (life.Value, error)

	// GetUnitLife looks up the life of the specified unit.
	GetUnitLife(context.Context, unit.Name) (life.Value, error)

	// GetUnitUUID returns the UUID for the named unit.
	GetUnitUUID(context.Context, unit.Name) (unit.UUID, error)

	// GetSupportedFeatures returns the set of features that the model makes
	// available for charms to use.
	GetSupportedFeatures(context.Context) (assumes.FeatureSet, error)

	// GetCharmLocatorByApplicationName returns a CharmLocator by application name.
	// It returns an error if the charm can not be found by the name. This can also
	// be used as a cheap way to see if a charm exists without needing to load the
	// charm metadata.
	GetCharmLocatorByApplicationName(ctx context.Context, name string) (applicationcharm.CharmLocator, error)

	// GetCharm returns the charm by name, source and revision. Calling this method
	// will return all the data associated with the charm. It is not expected to
	// call this method for all calls, instead use the move focused and specific
	// methods. That's because this method is very expensive to call. This is
	// implemented for the cases where all the charm data is needed; model
	// migration, charm export, etc.
	GetCharm(ctx context.Context, locator applicationcharm.CharmLocator) (internalcharm.Charm, applicationcharm.CharmLocator, bool, error)

	// GetCharmMetadata returns the metadata for the charm using the charm name,
	// source and revision.
	GetCharmMetadata(ctx context.Context, locator applicationcharm.CharmLocator) (internalcharm.Meta, error)

	// GetCharmConfig returns the config for the charm using the charm name,
	// source and revision.
	GetCharmConfig(ctx context.Context, locator applicationcharm.CharmLocator) (internalcharm.Config, error)

	// GetCharmMetadataName returns the name for the charm using the
	// charm name, source and revision.
	GetCharmMetadataName(ctx context.Context, locator applicationcharm.CharmLocator) (string, error)

	// GetCharmDownloadInfo returns the download info for the charm using the
	// charm name, source and revision.
	GetCharmDownloadInfo(ctx context.Context, locator applicationcharm.CharmLocator) (*applicationcharm.DownloadInfo, error)

	// IsCharmAvailable returns whether the charm is available for use. This
	// indicates if the charm has been uploaded to the controller.
	// This will return true if the charm is available, and false otherwise.
	IsCharmAvailable(ctx context.Context, locator applicationcharm.CharmLocator) (bool, error)

	// GetApplicationIDByName returns an application ID by application name. It
	// returns an error if the application can not be found by the name.
	//
	// Returns [applicationerrors.ApplicationNameNotValid] if the name is not valid,
	// and [applicationerrors.ApplicationNotFound] if the application is not found.
	GetApplicationIDByName(ctx context.Context, name string) (coreapplication.ID, error)

	// GetApplicationConstraints returns the application constraints for the
	// specified application ID.
	// Empty constraints are returned if no constraints exist for the given
	// application ID.
	// If no application is found, an error satisfying
	// [applicationerrors.ApplicationNotFound] is returned.
	GetApplicationConstraints(ctx context.Context, appID coreapplication.ID) (constraints.Value, error)

	// SetApplicationConstraints sets the application constraints for the
	// specified application ID.
	// This method overwrites the full constraints on every call.
	// If invalid constraints are provided (e.g. invalid container type or
	// non-existing space), a [applicationerrors.InvalidApplicationConstraints]
	// error is returned.
	// If no application is found, an error satisfying
	// [applicationerrors.ApplicationNotFound] is returned.
	SetApplicationConstraints(ctx context.Context, appID coreapplication.ID, cons constraints.Value) error
}

ApplicationService instances save an application to dqlite state.

type Backend

type Backend interface {
	Application(string) (Application, error)
	ApplyOperation(state.ModelOperation) error
	AddApplication(state.AddApplicationArgs, objectstore.ObjectStore) (Application, error)
	RemoteApplication(string) (RemoteApplication, error)
	AddRemoteApplication(state.AddRemoteApplicationParams) (RemoteApplication, error)
	Machine(string) (Machine, error)
	Unit(string) (Unit, error)
	UnitsInError() ([]Unit, error)
	ControllerTag() names.ControllerTag

	// ReadSequence is a stop gap to allow the next unit number to be read from mongo
	// so that correctly matching units can be written to dqlite.
	ReadSequence(name string) (int, error)
}

Backend defines the state functionality required by the application facade. For details on the methods, see the methods on state.State with the same names.

type Bindings

type Bindings interface {
	Map() map[string]string
	MapWithSpaceNames(network.SpaceInfos) (map[string]string, error)
}

Bindings defines a subset of the functionality provided by the state.Bindings type, as required by the application facade. For details on the methods, see the methods on state.Bindings with the same names.

type BlockChecker

type BlockChecker interface {
	ChangeAllowed(context.Context) error
	RemoveAllowed(context.Context) error
}

BlockChecker defines the block-checking functionality required by the application facade. This is implemented by apiserver/common.BlockChecker.

type CaasBrokerInterface

type CaasBrokerInterface interface {
	ValidateStorageClass(ctx context.Context, config map[string]interface{}) error
}

type Charm

type Charm interface {
	CharmMeta
	Config() *charm.Config
	Actions() *charm.Actions
	Revision() int
	URL() string
	Version() string
}

Charm defines a subset of the functionality provided by the state.Charm type, as required by the application facade. For details on the methods, see the methods on state.Charm with the same names.

type CharmMeta

type CharmMeta interface {
	Manifest() *charm.Manifest
	Meta() *charm.Meta
}

CharmMeta describes methods that inform charm operation.

type CredentialService

type CredentialService interface {
	// CloudCredential returns the cloud credential for the given tag.
	CloudCredential(ctx context.Context, key credential.Key) (cloud.Credential, error)
	// WatchCredential returns a watcher that observes changes to the specified
	// credential.
	WatchCredential(ctx context.Context, key credential.Key) (watcher.NotifyWatcher, error)
}

CredentialService provides access to credentials.

type DeployApplicationFunc

DeployApplicationFunc is a function that deploys an application.

type DeployApplicationParams

type DeployApplicationParams struct {
	ApplicationName   string
	Charm             Charm
	CharmOrigin       corecharm.Origin
	ApplicationConfig *config.Config
	CharmConfig       charm.Settings
	Constraints       constraints.Value
	NumUnits          int
	// Placement is a list of placement directives which may be used
	// instead of a machine spec.
	Placement        []*instance.Placement
	Storage          map[string]storage.Directive
	Devices          map[string]devices.Constraints
	AttachStorage    []names.StorageTag
	EndpointBindings map[string]string
	// Resources is a map of resource name to IDs of pending resources.
	Resources map[string]string

	// If set to true, any charm-specific requirements ("assumes" section)
	// will be ignored.
	Force bool
}

DeployApplicationParams contains the arguments required to deploy the referenced charm.

type DeployFromRepository

type DeployFromRepository interface {
	DeployFromRepository(context.Context, params.DeployFromRepositoryArg) (params.DeployFromRepositoryInfo, []*params.PendingResourceUpload, []error)
}

DeployFromRepository defines an interface for deploying a charm from a repository.

func NewDeployFromRepositoryAPI

func NewDeployFromRepositoryAPI(
	state DeployFromRepositoryState, applicationService ApplicationService,
	store objectstore.ObjectStore, validator DeployFromRepositoryValidator,
	logger corelogger.Logger,
) DeployFromRepository

NewDeployFromRepositoryAPI creates a new DeployFromRepositoryAPI.

type DeployFromRepositoryAPI

type DeployFromRepositoryAPI struct {
	// contains filtered or unexported fields
}

DeployFromRepositoryAPI provides the deploy from repository API facade for any given version. It is expected that any API parameter changes should be performed before entering the API.

type DeployFromRepositoryState

type DeployFromRepositoryState interface {
	AddApplication(state.AddApplicationArgs, objectstore.ObjectStore) (Application, error)
	Machine(string) (Machine, error)

	ReadSequence(name string) (int, error)
}

DeployFromRepositoryState defines a common set of functions for retrieving state objects.

type DeployFromRepositoryValidator

type DeployFromRepositoryValidator interface {
	ValidateArg(context.Context, params.DeployFromRepositoryArg) (deployTemplate, []error)
}

DeployFromRepositoryValidator defines an deploy config validator.

type ExternalControllerService

type ExternalControllerService interface {
	// UpdateExternalController persists the input controller
	// record.
	UpdateExternalController(ctx context.Context, ec crossmodel.ControllerInfo) error
}

ExternalControllerService provides a subset of the external controller domain service methods.

type Leadership

type Leadership interface {

	// Leaders returns all application leaders in the current model.
	// TODO (manadart 2019-02-27): The return in this signature includes error
	// in order to support state.ApplicationLeaders for legacy leases.
	// When legacy leases are removed, so can the error return.
	Leaders() (map[string]string, error)
}

Leadership describes the capability to read the current state of leadership.

type Machine

type Machine interface {
	Base() state.Base
	Id() string
	PublicAddress() (network.SpaceAddress, error)
}

Machine defines a subset of the functionality provided by the state.Machine type, as required by the application facade. For details on the methods, see the methods on state.Machine with the same names.

type MachinePlacementBackend

type MachinePlacementBackend interface {
	Machine(string) (Machine, error)
}

type MachineService

type MachineService interface {
	// CreateMachine creates the specified machine.
	CreateMachine(context.Context, machine.Name) (string, error)
	// GetMachineUUID returns the UUID of a machine identified by its name.
	GetMachineUUID(ctx context.Context, name machine.Name) (string, error)
	// HardwareCharacteristics returns the hardware characteristics of the
	// specified machine.
	HardwareCharacteristics(ctx context.Context, machineUUID string) (*instance.HardwareCharacteristics, error)
}

MachineService defines the methods that the facade assumes from the Machine service.

type Model

type Model interface {
	ModelTag() names.ModelTag
	Type() state.ModelType
	// The following methods are required for querying the featureset
	// supported by the model.
	CloudName() string
	CloudCredentialTag() (names.CloudCredentialTag, bool)
	CloudRegion() string
	ControllerUUID() string
}

Model defines a subset of the functionality provided by the state.Model type, as required by the application facade. For details on the methods, see the methods on state.Model with the same names.

type ModelConfigService

type ModelConfigService interface {
	// ModelConfig returns the current config for the model.
	ModelConfig(context.Context) (*config.Config, error)
}

ModelConfigService provides access to the model configuration.

type ModelService

type ModelService interface {
	// GetSupportedFeatures returns the set of features that the model makes
	// available for charms to use.
	GetSupportedFeatures(ctx context.Context) (coreassumes.FeatureSet, error)
}

ModelService provides access to the model state.

type NetworkService

type NetworkService interface {
	// Space returns a space from state that matches the input ID.
	// An error is returned if the space does not exist or if there was a problem
	// accessing its information.
	Space(ctx context.Context, uuid string) (*network.SpaceInfo, error)
	// SpaceByName returns a space from state that matches the input name.
	// An error is returned that satisfied errors.NotFound if the space was not found
	// or an error static any problems fetching the given space.
	SpaceByName(ctx context.Context, name string) (*network.SpaceInfo, error)
	// GetAllSpaces returns all spaces for the model.
	GetAllSpaces(ctx context.Context) (network.SpaceInfos, error)
}

NetworkService is the interface that is used to interact with the network spaces/subnets.

type OfferConnection

type OfferConnection interface {
	UserName() string
	OfferUUID() string
}

type PortService

type PortService interface {
	// GetUnitOpenedPorts returns the opened ports for a given unit uuid,
	// grouped by endpoint.
	GetUnitOpenedPorts(ctx context.Context, unitUUID unit.UUID) (network.GroupedPortRanges, error)
}

PortService defines the methods that the facade assumes from the Port service.

type RelationService

type RelationService interface {
	// AddRelation takes two endpoint identifiers of the form
	// <application>[:<endpoint>]. The identifiers will be used to infer two
	// endpoint between applications on the model. A new relation will be created
	// between these endpoints and the details of the endpoint returned.
	//
	// If the identifiers do not uniquely specify a relation, an error will be
	// returned.
	AddRelation(ctx context.Context, ep1, ep2 string) (relation.Endpoint, relation.Endpoint, error)

	// ApplicationRelationsInfo returns all EndpointRelationData for an application.
	ApplicationRelationsInfo(ctx context.Context, applicationID coreapplication.ID) ([]relation.EndpointRelationData, error)
}

RelationService defines operations for managing relations between application endpoints.

type RemoteApplication

type RemoteApplication interface {
	Name() string
	SourceModel() names.ModelTag
	Endpoints() ([]relation.Endpoint, error)
	AddEndpoints(eps []charm.Relation) error
	Destroy() error
	DestroyOperation(force bool) *state.DestroyRemoteApplicationOperation
	Status() (status.StatusInfo, error)
	Life() state.Life
}

type ResourceService

type ResourceService interface {
	DeleteResourcesAddedBeforeApplication(ctx context.Context, resources []coreresource.UUID) error
}

ResourceService defines the methods that the facade assumes from the Resource service.

type Services

type Services struct {
	ApplicationService        ApplicationService
	ExternalControllerService ExternalControllerService
	MachineService            MachineService
	ModelConfigService        ModelConfigService
	NetworkService            NetworkService
	PortService               PortService
	RelationService           RelationService
	ResourceService           ResourceService
	StorageService            StorageService
	StubService               StubService
}

Services represents all the services that the application facade requires.

func (Services) Validate

func (s Services) Validate() error

Validate checks that all the services are set.

type StorageInterface

type StorageInterface interface {
	storagecommon.StorageAccess
	VolumeAccess() storagecommon.VolumeAccess
	FilesystemAccess() storagecommon.FilesystemAccess
}

type StorageService

type StorageService interface {
	// GetStoragePoolByName returns the storage pool with the specified name.
	GetStoragePoolByName(ctx context.Context, name string) (*storage.Config, error)
}

StorageService instances get a storage pool by name.

type StubService

type StubService interface {
	// AssignUnitsToMachines assigns the given units to the given machines but setting
	// unit net node to the machine net node.
	//
	// Deprecated: AssignUnitsToMachines will become redundant once the machine and
	// application domains have become fully implemented.
	AssignUnitsToMachines(context.Context, map[string][]unit.Name) error
}

StubService is the interface used to interact with the stub service. A special service which collects temporary methods required to wire together together domains which are not completely implemented or wired up.

TODO: Remove this dependency once units are properly assigned to machines via net nodes.

type Subnet

type Subnet interface {
	CIDR() string
	VLANTag() int
	ProviderId() network.Id
	ProviderNetworkId() network.Id
}

type Unit

type Unit interface {
	Name() string
	Tag() names.Tag
	UnitTag() names.UnitTag
	ApplicationName() string
	Destroy(objectstore.ObjectStore) error
	DestroyOperation(objectstore.ObjectStore) *state.DestroyUnitOperation
	IsPrincipal() bool
	Resolve(retryHooks bool) error
	AgentTools() (*tools.Tools, error)

	AssignedMachineId() (string, error)
	WorkloadVersion() (string, error)
	AssignUnit() error
	AssignWithPlacement(*instance.Placement, network.SpaceInfos) error
	ContainerInfo() (state.CloudContainer, error)
}

Unit defines a subset of the functionality provided by the state.Unit type, as required by the application facade. For details on the methods, see the methods on state.Unit with the same names.

type UnitAdder

type UnitAdder interface {
	AddUnit(state.AddUnitParams) (Unit, error)
}

Jump to

Keyboard shortcuts

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