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
| Field | Type | Required | Description |
|---|---|---|---|
| service | string | No | Service to which the resource belongs |
| version | string | No | Interface version |
call method
| Field | Type | Required | Description |
|---|---|---|---|
| - | ICommonApiServiceOption | Yes | Public interface parameters |
ICommonApiServiceOption Structure
| Field | Type | Required | Description |
|---|---|---|---|
| Action | String | Yes | Interface name |
| Param | Object | Yes | Interface parameters; refer to the respective interface guides for specific formats |
3. Response
| Field | Type | Required | Description |
|---|---|---|---|
| - | Object | Yes | The 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();