juju: github.com/juju/juju/apiserver/facades/agent/provisioner Index | Files | Directories

package provisioner

import "github.com/juju/juju/apiserver/facades/agent/provisioner"

Index

Package Files

machineerror.go provisioner.go provisioninginfo.go

Variables

var ErrorRetryWaitDelay = 1 * time.Minute

ErrorRetryWaitDelay is the poll time currently used to trigger the watcher.

type BridgePolicy Uses

type BridgePolicy interface {
    // FindMissingBridgesForContainer looks at the spaces that the container should
    // have access to, and returns any host devices need to be bridged for use as
    // the container network.
    FindMissingBridgesForContainer(containerizer.Machine, containerizer.Container) ([]network.DeviceToBridge, int, error)

    // PopulateContainerLinkLayerDevices sets the link-layer devices of the input
    // guest, setting each device to be a child of the corresponding bridge on the
    // host machine.
    PopulateContainerLinkLayerDevices(containerizer.Machine, containerizer.Container) error
}

BridgePolicy is an indirection for containerizer.BridgePolicy.

type Machine Uses

type Machine interface {
    containerizer.Container

    InstanceId() (instance.Id, error)
    IsManual() (bool, error)
    MachineTag() names.MachineTag
}

Machine is an indirection for use in container provisioning. go:generate mockgen -package mocks -destination mocks/package_mock.go github.com/juju/juju/apiserver/facades/agent/provisioner Machine,BridgePolicy go:generate mockgen -package mocks -destination mocks/containerizer_mock.go github.com/juju/juju/network/containerizer LinkLayerDevice,Unit,Application,Charm

type ProvisionerAPI Uses

type ProvisionerAPI struct {
    *common.ControllerConfigAPI
    *common.Remover
    *common.StatusSetter
    *common.StatusGetter
    *common.DeadEnsurer
    *common.PasswordChanger
    *common.LifeGetter
    *common.StateAddresser
    *common.APIAddresser
    *common.ModelWatcher
    *common.ModelMachinesWatcher
    *common.InstanceIdGetter
    *common.ToolsFinder
    *common.ToolsGetter
    *networkingcommon.NetworkConfigAPI
    // contains filtered or unexported fields
}

ProvisionerAPI provides access to the Provisioner API facade.

func NewProvisionerAPI Uses

func NewProvisionerAPI(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPI, error)

NewProvisionerAPI creates a new server-side ProvisionerAPI facade.

func (*ProvisionerAPI) AvailabilityZone Uses

func (api *ProvisionerAPI) AvailabilityZone(args params.Entities) (params.StringResults, error)

AvailabilityZone returns a provider-specific availability zone for each given machine entity

func (*ProvisionerAPI) CACert Uses

func (api *ProvisionerAPI) CACert() (params.BytesResult, error)

CACert returns the certificate used to validate the state connection.

func (*ProvisionerAPI) Constraints Uses

func (api *ProvisionerAPI) Constraints(args params.Entities) (params.ConstraintsResults, error)

Constraints returns the constraints for each given machine entity.

func (*ProvisionerAPI) ContainerConfig Uses

func (api *ProvisionerAPI) ContainerConfig() (params.ContainerConfig, error)

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

func (*ProvisionerAPI) ContainerManagerConfig Uses

func (api *ProvisionerAPI) ContainerManagerConfig(args params.ContainerManagerConfigParams) (params.ContainerManagerConfig, error)

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

func (*ProvisionerAPI) DistributionGroup Uses

func (api *ProvisionerAPI) DistributionGroup(args params.Entities) (params.DistributionGroupResults, error)

DistributionGroup returns, for each given machine entity, a slice of instance.Ids that belong to the same distribution group as that machine. This information may be used to distribute instances for high availability.

func (*ProvisionerAPI) DistributionGroupByMachineId Uses

func (api *ProvisionerAPI) DistributionGroupByMachineId(args params.Entities) (params.StringsResults, error)

DistributionGroupByMachineId returns, for each given machine entity, a slice of machine.Ids that belong to the same distribution group as that machine. This information may be used to distribute instances for high availability.

func (*ProvisionerAPI) GetContainerInterfaceInfo Uses

func (api *ProvisionerAPI) GetContainerInterfaceInfo(args params.Entities) (
    params.MachineNetworkConfigResults,
    error,
)

GetContainerInterfaceInfo returns information to configure networking for a container. It accepts container tags as arguments.

func (*ProvisionerAPI) GetContainerProfileInfo Uses

func (api *ProvisionerAPI) GetContainerProfileInfo(args params.Entities) (params.ContainerProfileResults, error)

GetContainerProfileInfo returns information to configure a lxd profile(s) for a container based on the charms deployed to the container. It accepts container tags as arguments. Unlike machineLXDProfileNames which has the environ write the lxd profiles and returns the names of profiles already written.

func (*ProvisionerAPI) HostChangesForContainers Uses

func (api *ProvisionerAPI) HostChangesForContainers(args params.Entities) (params.HostNetworkChangeResults, error)

HostChangesForContainers returns the set of changes that need to be done to the host machine to prepare it for the containers to be created. Pass in a list of the containers that you want the changes for.

func (*ProvisionerAPI) InstanceStatus Uses

func (api *ProvisionerAPI) InstanceStatus(args params.Entities) (params.StatusResults, error)

InstanceStatus returns the instance status for each given entity. Only machine tags are accepted.

func (*ProvisionerAPI) KeepInstance Uses

func (api *ProvisionerAPI) KeepInstance(args params.Entities) (params.BoolResults, error)

KeepInstance returns the keep-instance value for each given machine entity.

func (*ProvisionerAPI) MachinesWithTransientErrors Uses

func (api *ProvisionerAPI) MachinesWithTransientErrors() (params.StatusResults, error)

MachinesWithTransientErrors returns status data for machines with provisioning errors which are transient.

func (*ProvisionerAPI) MarkMachinesForRemoval Uses

func (api *ProvisionerAPI) MarkMachinesForRemoval(machines params.Entities) (params.ErrorResults, error)

MarkMachinesForRemoval indicates that the specified machines are ready to have any provider-level resources cleaned up and then be removed.

func (*ProvisionerAPI) PrepareContainerInterfaceInfo Uses

func (api *ProvisionerAPI) PrepareContainerInterfaceInfo(args params.Entities) (
    params.MachineNetworkConfigResults,
    error,
)

PrepareContainerInterfaceInfo allocates an address and returns information to configure networking for a container. It accepts container tags as arguments.

func (*ProvisionerAPI) ProvisioningInfo Uses

func (api *ProvisionerAPI) ProvisioningInfo(args params.Entities) (params.ProvisioningInfoResults, error)

ProvisioningInfo returns the provisioning information for each given machine entity.

func (*ProvisionerAPI) ReleaseContainerAddresses Uses

func (api *ProvisionerAPI) ReleaseContainerAddresses(args params.Entities) (params.ErrorResults, error)

ReleaseContainerAddresses finds addresses allocated to a container and marks them as Dead, to be released and removed. It accepts container tags as arguments.

func (*ProvisionerAPI) Series Uses

func (api *ProvisionerAPI) Series(args params.Entities) (params.StringResults, error)

Series returns the deployed series for each given machine entity.

func (*ProvisionerAPI) SetCharmProfiles Uses

func (api *ProvisionerAPI) SetCharmProfiles(args params.SetProfileArgs) (params.ErrorResults, error)

SetCharmProfiles records the given slice of charm profile names.

func (*ProvisionerAPI) SetHostMachineNetworkConfig Uses

func (api *ProvisionerAPI) SetHostMachineNetworkConfig(args params.SetMachineNetworkConfig) error

func (*ProvisionerAPI) SetInstanceInfo Uses

func (api *ProvisionerAPI) SetInstanceInfo(args params.InstancesInfo) (params.ErrorResults, error)

SetInstanceInfo sets the provider specific machine id, nonce, metadata and network info for each given machine. Once set, the instance id cannot be changed.

func (*ProvisionerAPI) SetInstanceStatus Uses

func (api *ProvisionerAPI) SetInstanceStatus(args params.SetStatus) (params.ErrorResults, error)

SetInstanceStatus updates the instance status for each given entity. Only machine tags are accepted.

func (*ProvisionerAPI) SetModificationStatus Uses

func (api *ProvisionerAPI) SetModificationStatus(args params.SetStatus) (params.ErrorResults, error)

SetModificationStatus updates the instance whilst changes are occurring. This is different from SetStatus and SetInstanceStatus, by the fact this holds information about the ongoing changes that are happening to instances. Consider LXD Profile updates that can modify a instance, but may not cause the instance to be placed into a error state. This modification status serves the purpose of highlighting that to the operator. Only machine tags are accepted.

func (*ProvisionerAPI) SetSupportedContainers Uses

func (api *ProvisionerAPI) SetSupportedContainers(args params.MachineContainersParams) (params.ErrorResults, error)

SetSupportedContainers updates the list of containers supported by the machines passed in args.

func (*ProvisionerAPI) SupportedContainers Uses

func (api *ProvisionerAPI) SupportedContainers(args params.Entities) (params.MachineContainerResults, error)

SupportedContainers returns the list of containers supported by the machines passed in args.

func (*ProvisionerAPI) WatchAllContainers Uses

func (api *ProvisionerAPI) WatchAllContainers(args params.WatchContainers) (params.StringsWatchResults, error)

WatchAllContainers starts a StringsWatcher to watch all containers deployed to any machine passed in args.

func (*ProvisionerAPI) WatchContainers Uses

func (api *ProvisionerAPI) WatchContainers(args params.WatchContainers) (params.StringsWatchResults, error)

WatchContainers starts a StringsWatcher to watch containers deployed to any machine passed in args.

func (*ProvisionerAPI) WatchMachineErrorRetry Uses

func (api *ProvisionerAPI) WatchMachineErrorRetry() (params.NotifyWatchResult, error)

WatchMachineErrorRetry returns a NotifyWatcher that notifies when the provisioner should retry provisioning machines with transient errors.

type ProvisionerAPIV4 Uses

type ProvisionerAPIV4 struct {
    *ProvisionerAPIV5
}

ProvisionerAPIV4 provides v4 (and v3 for some reason) of the provisioner facade.

func NewProvisionerAPIV4 Uses

func NewProvisionerAPIV4(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPIV4, error)

NewProvisionerAPIV4 creates a new server-side version 4 Provisioner API facade.

func (*ProvisionerAPIV4) DistributionGroupByMachineId Uses

func (p *ProvisionerAPIV4) DistributionGroupByMachineId(_, _ struct{})

DistributionGroupByMachineId isn't on the v4 API.

type ProvisionerAPIV5 Uses

type ProvisionerAPIV5 struct {
    *ProvisionerAPIV6
}

ProvisionerAPIV5 provides v5 of the provisioner facade.

func NewProvisionerAPIV5 Uses

func NewProvisionerAPIV5(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPIV5, error)

NewProvisionerAPIV5 creates a new server-side Provisioner API facade.

func (*ProvisionerAPIV5) ContainerConfig Uses

func (p *ProvisionerAPIV5) ContainerConfig() (params.ContainerConfigV5, error)

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

type ProvisionerAPIV6 Uses

type ProvisionerAPIV6 struct {
    *ProvisionerAPIV7
}

ProvisionerAPIV6 provides v6 of the provisioner facade.

func NewProvisionerAPIV6 Uses

func NewProvisionerAPIV6(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPIV6, error)

NewProvisionerAPIV6 creates a new server-side Provisioner API facade.

type ProvisionerAPIV7 Uses

type ProvisionerAPIV7 struct {
    *ProvisionerAPIV8
}

ProvisionerAPIV7 provides v7 of the provisioner facade.

func NewProvisionerAPIV7 Uses

func NewProvisionerAPIV7(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPIV7, error)

NewProvisionerAPIV7 creates a new server-side Provisioner API facade.

func (*ProvisionerAPIV7) SetModificationStatus Uses

func (p *ProvisionerAPIV7) SetModificationStatus(_, _ struct{})

SetModificationStatus isn't on the v7 or lower API.

type ProvisionerAPIV8 Uses

type ProvisionerAPIV8 struct {
    *ProvisionerAPIV9
}

ProvisionerAPIV8 provides v8 of the provisioner facade. Added ModificationStatus and SetModificationStatus

func NewProvisionerAPIV8 Uses

func NewProvisionerAPIV8(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPIV8, error)

NewProvisionerAPIV8 creates a new server-side Provisioner API facade.

func (*ProvisionerAPIV8) CharmProfileChangeInfo Uses

func (p *ProvisionerAPIV8) CharmProfileChangeInfo(args params.ProfileArgs) (params.ProfileChangeResults, error)

CharmProfileChangeInfo retrieves the info necessary to change a charm profile used by a machine.

Remove in juju 3, this is for compatibility of provisioner using APIV7 or APIV8. It is required for the worker to start, and for the former processProfileChanges, which will no longer be used in APIv9. Code in apiserver application SetCharm() will prevent APIv8 models from upgrading charm with profiles and causing issues.

func (*ProvisionerAPIV8) RemoveUpgradeCharmProfileData Uses

func (p *ProvisionerAPIV8) RemoveUpgradeCharmProfileData(args params.Entities) (params.ErrorResults, error)

RemoveUpgradeCharmProfileData completely removes the instance charm profile data for a machine, even if the machine is dead.

Remove in juju 3. Upgrading existing charm profiles is now handled in the instance mutater worker. This is for compatibility only with older provisioners.

func (*ProvisionerAPIV8) SetUpgradeCharmProfileComplete Uses

func (p *ProvisionerAPIV8) SetUpgradeCharmProfileComplete(args params.SetProfileUpgradeCompleteArgs) (params.ErrorResults, error)

SetUpgradeCharmProfileComplete recorded that the result of updating the machine's charm profile(s)

Remove in juju 3. Upgrading existing charm profiles is now handled in the instance mutater worker. This is for compatibility only with older provisioners.

func (*ProvisionerAPIV8) SupportedContainers Uses

func (p *ProvisionerAPIV8) SupportedContainers(_, _ struct{}) (params.MachineContainerResults, error)

func (*ProvisionerAPIV8) WatchContainersCharmProfiles Uses

func (p *ProvisionerAPIV8) WatchContainersCharmProfiles(args params.WatchContainers) (params.StringsWatchResults, error)

WatchContainersCharmProfiles starts a StringsWatcher to notifies when the provisioner should update the charm profiles used by a container on the given machine.

Remove in juju 3, this is for compatibility of provisioner using APIV7 or APIV8. It is required for the worker to start, and for the former processProfileChanges, which will no longer be used in APIv9. Code in apiserver application SetCharm() will prevent APIv8 models from upgrading charm with profiles and causing issues.

func (*ProvisionerAPIV8) WatchModelMachinesCharmProfiles Uses

func (p *ProvisionerAPIV8) WatchModelMachinesCharmProfiles() (params.StringsWatchResult, error)

WatchModelMachinesCharmProfiles returns a StringsWatcher that notifies when the provisioner should update the charm profiles used by a machine.

Remove in juju 3, this is for compatibility of provisioner using APIV7 or APIV8. It is required for the worker to start, and for the former processProfileChanges, which will no longer be used in APIv9. Code in apiserver application SetCharm() will prevent APIv8 models from upgrading charm with profiles and causing issues.

type ProvisionerAPIV9 Uses

type ProvisionerAPIV9 struct {
    *ProvisionerAPI
}

ProvisionerAPIV9 provides v9 of the provisioner facade. Added SupportedContainers

func NewProvisionerAPIV9 Uses

func NewProvisionerAPIV9(st *state.State, resources facade.Resources, authorizer facade.Authorizer) (*ProvisionerAPIV9, error)

NewProvisionerAPIV9 creates a new server-side Provisioner API facade.

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package provisioner imports 38 packages (graph) and is imported by 4 packages. Updated 2019-10-19. Refresh now. Tools for package owners.