UNPKG

@canonical/jujulib

Version:
735 lines (733 loc) 23.9 kB
/** Juju Provisioner version 11. This facade is available on: Controller-machine-agent Machine-agent NOTE: This file was generated using the Juju schema from Juju 3.3 at the git SHA 65fa4c1ee5. Do not manually edit this file. */ import { autoBind } from "../../utils.js"; /** ProvisionerAPIV11 provides v10 of the provisioner facade. It relies on agent-set origin when calling SetHostMachineNetworkConfig. */ class ProvisionerV11 { constructor(transport, info) { this.NAME = "Provisioner"; this.VERSION = 11; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** APIAddresses returns the list of addresses used to connect to the API. */ aPIAddresses(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "APIAddresses", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** APIHostPorts returns the API server addresses. */ aPIHostPorts(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "APIHostPorts", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** AvailabilityZone returns a provider-specific availability zone for each given machine entity */ availabilityZone(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "AvailabilityZone", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** CACert returns the certificate used to validate the state connection. */ cACert(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "CACert", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** Constraints returns the constraints for each given machine entity. */ constraints(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "Constraints", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ContainerConfig returns information from the model config that is needed for container cloud-init. */ containerConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ContainerConfig", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ContainerManagerConfig returns information from the model config that is needed for configuring the container manager. */ containerManagerConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ContainerManagerConfig", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ControllerAPIInfoForModels returns the controller api connection details for the specified models. */ controllerAPIInfoForModels(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ControllerAPIInfoForModels", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ControllerConfig returns the controller's configuration. */ controllerConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ControllerConfig", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** 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. */ distributionGroup(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "DistributionGroup", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** 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. */ distributionGroupByMachineId(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "DistributionGroupByMachineId", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** EnsureDead calls EnsureDead on each given entity from state. It will fail if the entity is not present. If it's Alive, nothing will happen (see state/EnsureDead() for units or machines). */ ensureDead(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "EnsureDead", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** FindTools returns a List containing all tools matching the given parameters. */ findTools(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "FindTools", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** GetContainerInterfaceInfo returns information to configure networking for a container. It accepts container tags as arguments. */ getContainerInterfaceInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "GetContainerInterfaceInfo", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** 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. */ getContainerProfileInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "GetContainerProfileInfo", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** 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. */ hostChangesForContainers(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "HostChangesForContainers", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** InstanceId returns the provider specific instance id for each given machine or an CodeNotProvisioned error, if not set. */ instanceId(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "InstanceId", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** InstanceStatus returns the instance status for each given entity. Only machine tags are accepted. */ instanceStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "InstanceStatus", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** KeepInstance returns the keep-instance value for each given machine entity. */ keepInstance(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "KeepInstance", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** Life returns the life status of every supplied entity, where available. */ life(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "Life", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** MachinesWithTransientErrors returns status data for machines with provisioning errors which are transient. */ machinesWithTransientErrors(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "MachinesWithTransientErrors", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** MarkMachinesForRemoval indicates that the specified machines are ready to have any provider-level resources cleaned up and then be removed. */ markMachinesForRemoval(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "MarkMachinesForRemoval", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelConfig returns the current model's configuration. */ modelConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ModelConfig", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ModelUUID returns the model UUID that the current connection is for. */ modelUUID(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ModelUUID", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** PrepareContainerInterfaceInfo allocates an address and returns information to configure networking for a container. It accepts container tags as arguments. */ prepareContainerInterfaceInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "PrepareContainerInterfaceInfo", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ProvisioningInfo returns the provisioning information for each given machine entity. It supports all positive space constraints. */ provisioningInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ProvisioningInfo", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** ReleaseContainerAddresses finds addresses allocated to a container and marks them as Dead, to be released and removed. It accepts container tags as arguments. */ releaseContainerAddresses(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "ReleaseContainerAddresses", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** Remove removes every given entity from state, calling EnsureDead first, then Remove. It will fail if the entity is not present. */ remove(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "Remove", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetCharmProfiles records the given slice of charm profile names. */ setCharmProfiles(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetCharmProfiles", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** */ setHostMachineNetworkConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetHostMachineNetworkConfig", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetInstanceInfo sets the provider specific machine id, nonce, metadata and network info for each given machine. Once set, the instance id cannot be changed. */ setInstanceInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetInstanceInfo", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetInstanceStatus updates the instance status for each given entity. Only machine tags are accepted. */ setInstanceStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetInstanceStatus", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** 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. */ setModificationStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetModificationStatus", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetObservedNetworkConfig reads the network config for the machine identified by the input args. This config is merged with the new network config supplied in the same args and updated if it has changed. */ setObservedNetworkConfig(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetObservedNetworkConfig", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetPasswords sets the given password for each supplied entity, if possible. */ setPasswords(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetPasswords", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetStatus sets the status of each given entity. */ setStatus(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetStatus", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SetSupportedContainers updates the list of containers supported by the machines passed in args. */ setSupportedContainers(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SetSupportedContainers", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** Status returns the status of each given entity. */ status(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "Status", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** SupportedContainers returns the list of containers supported by the machines passed in args. */ supportedContainers(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "SupportedContainers", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** Tools finds the tools necessary for the given agents. */ tools(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "Tools", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchAPIHostPorts watches the API server addresses. */ watchAPIHostPorts(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchAPIHostPorts", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchAllContainers starts a StringsWatcher to watch all containers deployed to any machine passed in args. */ watchAllContainers(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchAllContainers", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchContainers starts a StringsWatcher to watch containers deployed to any machine passed in args. */ watchContainers(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchContainers", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. Note that although the NotifyWatchResult contains an Error field, it's not used because we are only returning a single watcher, so we use the regular error return. */ watchForModelConfigChanges(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchForModelConfigChanges", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchMachineErrorRetry returns a NotifyWatcher that notifies when the provisioner should retry provisioning machines with transient errors. */ watchMachineErrorRetry(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchMachineErrorRetry", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchModelMachineStartTimes watches the non-container machines in the model for changes to the Life or AgentStartTime fields and reports them as a batch. */ watchModelMachineStartTimes(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchModelMachineStartTimes", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchModelMachines returns a StringsWatcher that notifies of changes to the life cycles of the top level machines in the current model. */ watchModelMachines(params) { return new Promise((resolve, reject) => { const req = { type: "Provisioner", request: "WatchModelMachines", version: 11, params: params, }; this._transport.write(req, resolve, reject); }); } } ProvisionerV11.NAME = "Provisioner"; ProvisionerV11.VERSION = 11; export default ProvisionerV11; //# sourceMappingURL=ProvisionerV11.js.map