PHP
Python
Java
Go
.NET
Node.js
C++
npm install tencentcloud-sdk-nodejs-intl-en --save
const tencentcloud = require("../../../../tencentcloud-sdk-nodejs-intl-en");// Import the client models of the corresponding product module.const CvmClient = tencentcloud.cvm.v20170312.Client;const models = tencentcloud.cvm.v20170312.Models;const Credential = tencentcloud.common.Credential;// Instantiate an authentication object. The Tencent Cloud account secretId and secretKey need to be passed in as the input parameters.let cred = new Credential("secretId", "secretKey");// Instantiate the client object to request the product (with CVM as an example).let client = new CvmClient(cred, "ap-shanghai");// Instantiate a request object.let req = new models.DescribeZonesRequest();// Call the API you want to access through the client object; you need to pass in the request object and the response callback function.client.DescribeZones(req, function(errMsg, response) {// The request is returned exceptionally and the exception information is printed.if (errMsg) {console.log(errMsg);return;}// The request is returned normally and the response object is printed.console.log(response.to_json_string());});
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback