Update Metadata of Collection Data
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| gpdb:UpdateCollectionDataMetadata | create | *Collection acs:gpdb:{#regionId}:{#accountId}:collection/{#DBInstanceId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| DBInstanceId | string | No | Instance ID. Note
You can call the DescribeDBInstances API to view details of all AnalyticDB for PostgreSQL instances in the target region, including the instance ID.
| gp-j788ghhjjxxxx |
| Namespace | string | No | Namespace. Note
You can use the ListNamespaces API to view the list.
| mynamespace |
| Collection | string | Yes | Collection name. Note
You can use the ListCollections API to view the list.
| document |
| RegionId | string | Yes | Region ID where the instance is located. | cn-hangzhou |
| NamespacePassword | string | Yes | Password corresponding to the namespace. | testpassword |
| Filter | string | No | Filter condition for the data to be updated, in SQL WHERE format. This field cannot be empty at the same time as the Ids field. | business_value = 'chat_file_1' |
| Ids | array | No | ID list of the data to be updated, i.e., the Row.Id specified when uploading the data. This field cannot be empty at the same time as the Filter field. | |
| string | No | ID of the data to be updated. | AC-2642a8744eba4c5eb7d7595d08306d15 | |
| Metadata | object | Yes | Data to be updated, in a JSON string of MAP format. The key is the field name, and the value is the new data value. | |
| any | No | Metadata value. | new title | |
| WorkspaceId | string | No | ID of the Workspace composed of multiple database instances. This parameter and the DBInstanceId parameter cannot both be empty. When both are specified, this parameter takes precedence. | gp-ws-***** |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "failed to connect database, detailMsg: getConnection fail::SQL State: 28P01, Error Code: 0, Error Message: FATAL: password",
"Status": "success",
"AppliedRows": 10
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-08-04 | The request parameters of the API has changed | View Change Details |
| 2023-12-06 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
