How to use the tencentcloud-sdk-nodejs.tag function in tencentcloud-sdk-nodejs

To help you get started, we’ve selected a few tencentcloud-sdk-nodejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serverless-tencent / serverless-tencent-scf / shared / handler.js View on Github external
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);
	}
github serverless-components / tencent-scf / library / abstract.js View on Github external
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
const ScfClient = tencentcloud.scf.v20180416.Client
const CamClient = tencentcloud.cam.v20190116.Client
const TagClient = tencentcloud.tag.v20180813.Client

class AbstractHandler {
  constructor({ appid, secret_id, secret_key, options, context }) {
    this.appid = appid
    this.options = options
    this.context = context
    assert(options, 'Options should not is empty')
    this._scfClient = AbstractHandler.createScfClient(secret_id, secret_key, options)
    this._tagClient = AbstractHandler.createTagClient(secret_id, secret_key, options)
    this._cosClient = AbstractHandler.createCosClient(secret_id, secret_key, options)
    this._camClient = AbstractHandler.createCamClient(secret_id, secret_key, options)
  }

  static getClientInfo(secret_id, secret_key, options) {
    const cred = options.token
      ? new Credential(secret_id, secret_key, options.token)