Skip to main content

General Cloud API Calls

1. API Description

manager-node provides a unified method call for commonService to invoke TencentCloud Cloud APIs.

API declaration: manager.commonService(service, version).call(option): Promise<Object>

⚠️ Starting from version 3.0.0, commonService is used as a method in this API with request parameters (service?: string, version?: string), which is an incompatible change.

2. Input Parameters

commonService method

FieldTypeRequiredDescription
servicestringNoService to which the request resource belongs
versionstringNoAPI version

call method

FieldTypeRequiredDescription
-ICommonApiServiceOptionYesCommon API parameter passing

ICommonApiServiceOption struct

FieldTypeRequiredDescription
ActionStringYesAPI name
ParamObjectYesAPI parameters; refer to the respective API documentation for specific forms

3. Return Results

FieldTypeRequiredDescription
-ObjectYesResponse object varies by action.

4. Sample Code

import CloudBase from '@cloudbase/manager-node'

const manager = new CloudBase({
secretId: 'Your SecretId',
secretKey: 'Your SecretKey',
envId: 'Your envId' // TCB environment ID, which can be obtained from the Tencent Cloud TCB console
})

async function test() {
const res = await manager.commonService().call({
Action: 'DescribeDatabaseACL',
Param: {
CollectionName: 'xxx',
EnvId: 'xxx'
}
})
console.log(res)
}

test()