Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 571 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 571 Bytes

Cloudtower Node Sdk

typescript 编写的 Cloudtower SDK。

安装

yarn install cloudtower-node-sdk

使用

创建Client并鉴权

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);