typescript 编写的 Cloudtower SDK。
yarn install cloudtower-node-sdk
import { CloudTowerClient, UserSource } from "cloudtower-node-sdk";
const client = new CloudTowerClient(
{
username: "username",
password: "password",
source: UserSource.LOCAL,
},
{
baseURL: "http://<path-to-tower>/v2/api",
}
);
const api = new VmApi(client);
const data = await api.getVms({
first: 10,
});
console.log(data);