Comments (4)
@roura356a tencentcloud-sdk-nodejs is a SDK for Tencent Cloud API 3.0 (with endpoint *.tencentcloudapi.com), the document you referred is Tencent Cloud API 2.0 (with endpoint *.api.qcloud.com/v2/index.php). Since they are not compatible, you cannot get what you want with API 2.0 parameters while calling API 3.0 interface.
There is a tool, named API Explorer, which can be used to get familiar with API 3.0, while generating simple SDK source code, for this particular interface, please refer to: https://console.cloud.tencent.com/api/explorer?Product=monitor&Version=2018-07-24&Action=GetMonitorData&SignVersion=
here is the source code I generated with the tool, you can adjust the parameters according to you purpose:
const tencentcloud = require("../../../../tencentcloud-sdk-nodejs");
const MonitorClient = tencentcloud.monitor.v20180724.Client;
const models = tencentcloud.monitor.v20180724.Models;
const Credential = tencentcloud.common.Credential;
const ClientProfile = tencentcloud.common.ClientProfile;
const HttpProfile = tencentcloud.common.HttpProfile;
let cred = new Credential("masked-secret-id", "masked-secret-key");
let httpProfile = new HttpProfile();
httpProfile.endpoint = "monitor.tencentcloudapi.com";
let clientProfile = new ClientProfile();
clientProfile.httpProfile = httpProfile;
let client = new MonitorClient(cred, "ap-guangzhou", clientProfile);
let req = new models.GetMonitorDataRequest();
let params = '{"Namespace":"QCE/CVM","MetricName":"CPUUsage","Instances":[{"Dimensions":[{"Name":"InstanceId","Value":"ins-oxbabxrc"}]}]}'
req.from_json_string(params);
client.GetMonitorData(req, function(errMsg, response) {
if (errMsg) {
console.log(errMsg);
return;
}
console.log(response.to_json_string());
});
The document you need to read is https://cloud.tencent.com/document/product/248/30385 , unfortunately it is Chinese simplified only.
from tencentcloud-sdk-nodejs.
Ohh got it, @zqfan! Thank you so much for the clarification. I'm still quite new with Tencent Cloud. I'll be more aware from now on about this differences 👍
from tencentcloud-sdk-nodejs.
Sadly the Api Explorer is locked to the Chinese portal and I can't access with my international login.
from tencentcloud-sdk-nodejs.
I thought it just doesn't support English.
International account is different, I think the support will not be soon.
from tencentcloud-sdk-nodejs.
Related Issues (20)
- TDMQ没有ReceiveCmqMsg HOT 1
- 这里网络请求有bug
- 在vite项目中引入tencentcloud-sdk-nodejs,get-stream 这个包const { promisify } = require('util')提示undefined HOT 1
- Missing "ImageConfig" and "DeployMode" fields in GetFunctionResponse if it is image mode
- tencentcloud-sdk-nodejs-trtc Bug, 当开始云端混流StartMCUMixTranscode()参数"EncodeParams"下的"VideoFramerate"或"VideoBitrate"超出范围时,混流返回结果不会报错 HOT 1
- Any plans on including AbortSignal? HOT 2
- 文档无法使用
- 基于3.0版本创建d.ts文件报错
- tts使用官方nodejs api调试报错 HOT 1
- 没有发消息接口? HOT 2
- abstract_client.ts 中的改动导致 HTTP 请求头中包含非法的 token HOT 1
- uniapp项目引入tencentcloud-sdk-nodejs报错:TypeError: promisify is not a function HOT 6
- 这文档写的真是垃圾啊,跟阿里云相差100000倍 HOT 2
- DescribeCaptchaResult 报错没传SecretId HOT 2
- 请问cos对应哪个目录 HOT 3
- Could not resolve "json-bigint" HOT 2
- services模块可以支持上cos吗?
- 腾讯云函数不支持ESM, `Error [ERR_REQUIRE_ESM]: require() of ES Module /var/user/index.js from /var/runtime/node18/UserFunction.js not supported.`
- Please add 'exports' option to 'pacakge.json' to support modular approach of ESM
- SDK 4.0.842 version build is error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tencentcloud-sdk-nodejs.