Overview
Creates project modification records to add or remove tables. Supported only for projects in the RUNNING, FAILED, or SUSPEND state. Corresponds to CommonModifyProjectController.createProjectModifyRecords.
API details
Constraints
The caller must have an AccessKey to access the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey Secret, see Manage AccessKeys.
Request path
PUT /api/v2/oms/project/modifyRecords
Request parameters
Header
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| X-Ob-Project-Id | String | Yes | Project ID. | proj-xxxxxxxx |
| X-Ob-Org-Id | String | Yes | Organization ID. | org-xxxxxxxx |
Body
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| id | String | Yes | Project ID. | np_7befdmp08juo |
| databases | List<TransferSchema> |
No | Updated list of databases or schemas. Can be used instead of or together with transferMapping. | |
| transferMapping | Object | No | Updated transfer object mappings, with the same structure as transferMapping in CreateProject. |
If
transferMappingis omitted, the system usesdatabasesto construct transfer mappings inSPECIFICmode.
TransferSchema structure
Field |
Type |
Description |
|---|---|---|
| name | String | Original database or schema name. |
| mappedName | String | Mapped database or schema name. |
| tables | List<TransferTable> |
List of table configurations. |
| views | List<TransferView> |
List of view configurations. |
Response parameters
Field |
Type |
Description |
Example value |
|---|---|---|---|
| success | Boolean | Whether the request succeeded. | true |
| data | Long | Modification record ID. | 123456789 |
| requestId | String | Request ID. | req-xxx-xxx |
| cost | String | Time taken. | 123ms |
Examples
Request example
curl --digest -u '<your AK:SK>' \
--request PUT \
--url 'https://api-cloud.oceanbase.com/api/v2/oms/project/modifyRecords' \
-H 'Content-Type: application/json' \
-H 'X-Ob-Project-Id: <project ID>' \
-H 'X-Ob-Org-Id: <organization ID>' \
--data @request.json
{
"id": "np_xxx",
"transferMapping": {
"mode": "COMPLEX",
"schemas": [
{
"name": "source_db",
"mappedName": "target_db",
"tables": [
{ "name": "table_1", "mappedName": "table_1" }
]
}
]
}
}
Response example
{
"success": true,
"data": 123456789,
"requestId": "req-xxx-xxx",
"cost": "123ms"
}
