UNPKG

@canonical/jujulib

Version:
63 lines (62 loc) 1.79 kB
/** Juju Admin version 3. This facade is available on: Controller-machine-agent Machine-agent Unit-agent Controllers 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"; /** admin is the only object that unlogged-in clients can access. It holds any methods that are needed to log in. */ class AdminV3 { constructor(transport, info) { this.NAME = "Admin"; this.VERSION = 3; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** Login logs in with the provided credentials. All subsequent requests on the connection will act as the authenticated user. */ login(params) { return new Promise((resolve, reject) => { const req = { type: "Admin", request: "Login", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } /** RedirectInfo returns redirected host information for the model. In Juju it always returns an error because the Juju controller does not multiplex controllers. */ redirectInfo(params) { return new Promise((resolve, reject) => { const req = { type: "Admin", request: "RedirectInfo", version: 3, params: params, }; this._transport.write(req, resolve, reject); }); } } AdminV3.NAME = "Admin"; AdminV3.VERSION = 3; export default AdminV3; //# sourceMappingURL=AdminV3.js.map