@canonical/jujulib
Version:
Juju API client
234 lines (233 loc) • 7.31 kB
JavaScript
/**
Juju Storage version 6.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Models
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";
/**
StorageAPI implements the latest version (v6) of the Storage API.
*/
class StorageV6 {
constructor(transport, info) {
this.NAME = "Storage";
this.VERSION = 6;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
AddToUnit validates and creates additional storage instances for units.
A "CHANGE" block can block this operation.
*/
addToUnit(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "AddToUnit",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Attach attaches existing storage instances to units.
A "CHANGE" block can block this operation.
*/
attach(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "Attach",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
CreatePool creates a new pool with specified parameters.
*/
createPool(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "CreatePool",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
DetachStorage sets the specified storage attachments to Dying, unless they are
already Dying or Dead. Any associated, persistent storage will remain
alive. This call can be forced.
*/
detachStorage(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "DetachStorage",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Import imports existing storage into the model.
A "CHANGE" block can block this operation.
*/
import(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "Import",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListFilesystems returns a list of filesystems in the environment matching
the provided filter. Each result describes a filesystem in detail, including
the filesystem's attachments.
*/
listFilesystems(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "ListFilesystems",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListPools returns a list of pools.
If filter is provided, returned list only contains pools that match
the filter.
Pools can be filtered on names and provider types.
If both names and types are provided as filter,
pools that match either are returned.
This method lists union of pools and environment provider types.
If no filter is provided, all pools are returned.
*/
listPools(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "ListPools",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListStorageDetails returns storage matching a filter.
*/
listStorageDetails(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "ListStorageDetails",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
ListVolumes lists volumes with the given filters. Each filter produces
an independent list of volumes, or an error if the filter is invalid
or the volumes could not be listed.
*/
listVolumes(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "ListVolumes",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Remove sets the specified storage entities to Dying, unless they are
already Dying or Dead, such that the storage will eventually be removed
from the model. If the arguments specify that the storage should be
destroyed, then the associated cloud storage will be destroyed first;
otherwise it will only be released from Juju's control.
*/
remove(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "Remove",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
RemovePool deletes the named pool
*/
removePool(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "RemovePool",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
StorageDetails retrieves and returns detailed information about desired
storage identified by supplied tags. If specified storage cannot be
retrieved, individual error is returned instead of storage information.
*/
storageDetails(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "StorageDetails",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
UpdatePool deletes the named pool
*/
updatePool(params) {
return new Promise((resolve, reject) => {
const req = {
type: "Storage",
request: "UpdatePool",
version: 6,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
StorageV6.NAME = "Storage";
StorageV6.VERSION = 6;
export default StorageV6;
//# sourceMappingURL=StorageV6.js.map