Skip to main content

Public Interface

1. Interface Description

Function: For functions with relatively fixed interface forms, manager-node provides a common method call via commonService.

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

⚠️ Starting from version 3.0.0, commonService is used as a method with request parameters (service?: string, version?: string), which constitutes a breaking change.

2. Input Parameters

commonService method

FieldTypeRequiredDescription
servicestringNoService to which the resource belongs
versionstringNoInterface version

call method

FieldTypeRequiredDescription
-ICommonApiServiceOptionYesPublic interface parameters

ICommonApiServiceOption Structure

FieldTypeRequiredDescription
ActionStringYesInterface name
ParamObjectYesInterface parameters; refer to the respective interface guides for specific formats

3. Response

FieldTypeRequiredDescription
-ObjectYesThe response object varies depending on the action.

4. Sample Code

import CloudBase from "@cloudbase/manager-node";

const manager = new CloudBase({
secretId: "Your SecretId",
secretKey: "Your SecretKey",
envId: "Your envId", // CloudBase environment ID, obtain from the Tencent CloudBase Console
});

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

test();