Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function callCloudApi(secretId, secretKey) {
const CvmClient = tencentcloud.cvm.v20170312.Client;
const models = tencentcloud.cvm.v20170312.Models;
const Credential = tencentcloud.common.Credential;
let cred = new Credential(secretId, secretKey);
let client = new CvmClient(cred, 'ap-shanghai');
let req = new models.DescribeZonesRequest();
return new Promise((resolve, reject) => {
client.DescribeZones(req, function (err, response) {
if (err) {
reject(err);
return;
}
resolve(response);
});
});
}
exports.callCloudApi = callCloudApi;
export function callCloudApi(secretId, secretKey) {
const CvmClient = tencentcloud.cvm.v20170312.Client;
const models = tencentcloud.cvm.v20170312.Models;
const Credential = tencentcloud.common.Credential;
let cred = new Credential(secretId, secretKey);
let client = new CvmClient(cred, "ap-shanghai");
let req = new models.DescribeZonesRequest();
return new Promise((resolve, reject) => {
client.DescribeZones(req, function (err, response) {
if (err) {
reject(err)
return;
}
resolve(response)
});
})
}
function callCloudApi(secretId, secretKey) {
const CvmClient = tencentcloud.cvm.v20170312.Client;
const models = tencentcloud.cvm.v20170312.Models;
const Credential = tencentcloud.common.Credential;
let cred = new Credential(secretId, secretKey);
let client = new CvmClient(cred, 'ap-shanghai');
let req = new models.DescribeZonesRequest();
return new Promise((resolve, reject) => {
client.DescribeZones(req, function (err, response) {
if (err) {
reject(err);
return;
}
resolve(response);
});
});
}
exports.callCloudApi = callCloudApi;
export function callCloudApi(secretId, secretKey) {
const CvmClient = tencentcloud.cvm.v20170312.Client;
const models = tencentcloud.cvm.v20170312.Models;
const Credential = tencentcloud.common.Credential;
let cred = new Credential(secretId, secretKey);
let client = new CvmClient(cred, "ap-shanghai");
let req = new models.DescribeZonesRequest();
return new Promise((resolve, reject) => {
client.DescribeZones(req, function (err, response) {
if (err) {
reject(err)
return;
}
resolve(response)
});
})
}