cloudfunctions/SegmentPortraitPic/node_modules/tencentcloud-sdk-nodejs/examples/cvm/v20170312/describe_instances.js

(完整代码) 967B

const tencentcloud = require("../../../../tencentcloud-sdk-nodejs")

// 导入对应产品模块的client models。
const CvmClient = tencentcloud.cvm.v20170312.Client

// 实例化要请求产品的client对象。profile可选。
const client = new CvmClient({
  credential: {
    secretId: process.env.secretId,
    secretKey: process.env.secretKey,
  },
  region: "ap-shanghai",
  profile: {
    signMethod: "TC3-HMAC-SHA256",
    httpProfile: {
      reqMethod: "POST",
      reqTimeout: 30,
    },
  },
})

client.DescribeInstances(
  {
    Filters: [
      {
        Name: "zone",
        Values: ["ap-shanghai-1", "ap-shanghai-2"],
      },
      {
        Name: "instance-charge-type",
        Values: ["POSTPAID_BY_HOUR"],
      },
    ],
  },
  function (err, response) {
    // 请求异常返回,打印异常信息
    if (err) {
      console.log(err)
      return
    }
    // 请求正常返回,打印response对象
    console.log(response)
  }
)

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。