Creates a metadata lock.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dlf:CreateLock |
*All Resource
|
None | None |
Request syntax
POST /api/metastore/catalogs/databases/tables/locks HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Body |
object |
No |
The request body. |
|
| LockObjList |
array |
No |
A list of lock information. |
{"databaseName":"db","tableName":"test"} |
| LockObj |
No |
The lock information. |
The LockObjList parameter can contain only one lock object.
The LockObj parameter supports only table locks. Partition-level locks are not supported.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| Code |
string |
The status code. |
OK |
| Message |
string |
The returned message. |
. |
| RequestId |
string |
The request ID. |
73201200-4C1A-4FEF-BD6B-C0DA7994FFA2 |
| Success |
boolean |
Indicates whether the call was successful. Valid values:
|
True |
| LockStatus | LockStatus |
The lock status information. |
{"lockId":12323,"lockStatus":"ACQUIRED"} |
Code: The error code.
Message: The error message.
RequestId: The unique ID of the request.
Success: Indicates whether the request is successful. Valid values are true and false.
LockStatus: This field is returned only if the request is successful. Otherwise, this field is empty. The LockStatus object contains two fields: LockId and LockState. The LockId field has a value if the value of LockState is ACQUIRED. Otherwise, the LockId field is empty.
Examples
Success response
JSON format
{
"Code": "OK",
"Message": ".",
"RequestId": "73201200-4C1A-4FEF-BD6B-C0DA7994FFA2",
"Success": true,
"LockStatus": {
"LockId": 1,
"LockState": "ACQUIRED"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.