@canonical/jujulib
Version:
Juju API client
40 lines • 1.11 kB
JavaScript
/**
Juju Admin version 4.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Controllers
Models
*/
import AdminV3 from "../facades/admin/AdminV3.js";
/**
admin is the only object that unlogged-in clients can access. It holds any
methods that are needed to log in.
*/
class AdminV4 extends AdminV3 {
constructor(transport, info) {
super(transport, info);
this.NAME = "Admin";
this.VERSION = 4;
}
/**
LoginWithSessionCookie logs in if the session cookie exists when the
websocket connection is made. All subsequent requests on the
connection will act as the authenticated user.
*/
loginWithSessionCookie() {
return new Promise((resolve, reject) => {
const req = {
type: "Admin",
request: "LoginWithSessionCookie",
version: 4,
};
this._transport.write(req, resolve, reject);
});
}
}
AdminV4.NAME = "Admin";
AdminV4.VERSION = 4;
export default AdminV4;
//# sourceMappingURL=AdminV4.js.map