@canonical/jujulib
Version:
Juju API client
106 lines (105 loc) • 3.22 kB
JavaScript
/**
Juju SSHClient version 3.
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.0-beta4 at the git SHA a13ab81a.
Do not manually edit this file.
*/
import { autoBind } from "../../utils.js";
/**
Facade implements the API required by the sshclient worker.
*/
class SSHClientV3 {
constructor(transport, info) {
this.NAME = "SSHClient";
this.VERSION = 3;
this._transport = transport;
this._info = info;
// Automatically bind all methods to instances.
autoBind(this);
}
/**
AllAddresses reports all addresses that might have SSH listening for each
entity in args. The result is sorted with public addresses first.
Machines and units are supported as entity types.
*/
allAddresses(params) {
return new Promise((resolve, reject) => {
const req = {
type: "SSHClient",
request: "AllAddresses",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
PrivateAddress reports the preferred private network address for one or
more entities. Machines and units are supported.
*/
privateAddress(params) {
return new Promise((resolve, reject) => {
const req = {
type: "SSHClient",
request: "PrivateAddress",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
Proxy returns whether SSH connections should be proxied through the
controller hosts for the model associated with the API connection.
*/
proxy(params) {
return new Promise((resolve, reject) => {
const req = {
type: "SSHClient",
request: "Proxy",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
PublicAddress reports the preferred public network address for one
or more entities. Machines and units are supported.
*/
publicAddress(params) {
return new Promise((resolve, reject) => {
const req = {
type: "SSHClient",
request: "PublicAddress",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
/**
PublicKeys returns the public SSH hosts for one or more
entities. Machines and units are supported.
*/
publicKeys(params) {
return new Promise((resolve, reject) => {
const req = {
type: "SSHClient",
request: "PublicKeys",
version: 3,
params: params,
};
this._transport.write(req, resolve, reject);
});
}
}
SSHClientV3.NAME = "SSHClient";
SSHClientV3.VERSION = 3;
export default SSHClientV3;
//# sourceMappingURL=SSHClientV3.js.map