Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const tencentcloudcos = require('cos-nodejs-sdk-v5');
const tencentcloud = require('tencentcloud-sdk-nodejs');
const ClientProfile = require('tencentcloud-sdk-nodejs/tencentcloud/common/profile/client_profile.js');
const HttpProfile = require('tencentcloud-sdk-nodejs/tencentcloud/common/profile/http_profile.js');
const assert = require('assert');
const COS = require('cos-nodejs-sdk-v5');
const Credential = tencentcloud.common.Credential;
const ScfClient = tencentcloud.scf.v20180416.Client;
const TagClient = tencentcloud.tag.v20180813.Client;
const MonitorClinet = tencentcloud.monitor.v20180724.Client;
class AbstractHandler {
constructor(appid, secret_id, secret_key, options) {
this.appid = appid;
this.secret_id = secret_id;
this.secret_key = secret_key;
this.options = options;
assert(options, 'options should not is empty');
this._scfClient = AbstractHandler.createScfClient(secret_id, secret_key, options);
this._cosClient = AbstractHandler.createCosClient(secret_id, secret_key, options);
this._tagClient = AbstractHandler.createTagClient(secret_id, secret_key, options);
this._monitorClient = AbstractHandler.createMonitorClient(secret_id, secret_key, options);
}
logger() {
const tencentcloud = require('tencentcloud-sdk-nodejs')
const AbstractHandler = require('../../shared/handler')
const scf_models = tencentcloud.scf.v20180416.Models
const monitor_models = tencentcloud.monitor.v20180724.Models
const util = require('util')
class MetricsFunction extends AbstractHandler {
async functionList(service, stage) {
const req = new scf_models.ListFunctionsRequest()
const body = {
Namespace: 'default',
Filters: [
{
Name: 'tag-Application',
Values: [service]
},
{
Name: 'tag-Stage',
Values: [stage]
}