qcloudapi-sdk
腾讯云 API SDK for node.js
Last updated 7 years ago by dannykong .
Apache 2.0 · Original npm · Tarball · package.json
$ cnpm install qcloudapi-sdk 
SYNC missed versions from official npm registry.

Tencent Qcloud API SDK for node.js

qcloudapi-sdk腾讯云 API 2.0/3.0 的 node.js SDK 工具包.

安装

npm i qcloudapi-sdk --save

使用

  1. 使用之前请在腾讯云的云 API 控制台中创建自己的安全凭证(SecretId 和 SecretKey). SecretKey 要严格保管, 避免泄露.
  2. 安装并引入本 SDK.

示例

var Capi = require("qcloudapi-sdk");

//通过构造函数传入的参数将作为默认配置
var capi = new Capi({
  SecretId: "Your SecretId here",
  SecretKey: "Your SecretKey here",
  serviceType: "account"
});

capi.request(
  {
    Region: "gz",
    Action: "DescribeProject",
    otherParam1: "otherParam1",
    otherParam2: "otherParam2"
  },
  function(error, data) {
    console.log(data);
  }
);

//传入配置以覆盖默认项
capi.request(
  {
    Region: "gz",
    Action: "DescribeInstances",
    otherParam1: "otherParam1",
    otherParam2: "otherParam2"
  },
  {
    serviceType: "cvm"
  },
  function(error, data) {
    console.log(data);
  }
);

//生成 querystring
var qs = capi.generateQueryString(
  {
    Region: "gz",
    Action: "DescribeInstances",
    otherParam1: "otherParam1",
    otherParam2: "otherParam2"
  },
  {
    serviceType: "cvm"
  }
);
//'Region=gz&SecretId=&Timestamp=1449461969&Nonce=20874&Action=DescribeInstances&otherParam1=otherParam1&otherParam2=otherParam2&Signature=r%2Fa9nqMxEIn5RsMjqmIksQ5XcYc%3D'

SDK API

请访问 api.md

资源

Current Tags

  • 0.2.1                                ...           latest (7 years ago)

9 Versions

  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.6                                ...           8 years ago
  • 0.1.5                                ...           9 years ago
  • 0.1.4                                ...           10 years ago
  • 0.1.3                                ...           10 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 2
Last Month 1
Dependencies (3)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |