CreateLock
Creates a specified metadata lock.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dlf:CreateLock |
create |
*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 HTTP request body. |
|
| LockObjList |
array |
No |
The list of lock information. |
{"databaseName":"db","tableName":"test"} |
| LockObj |
No |
The lock information. |
Currently, LockObjList only supports a size of 1, which means you can obtain only one object lock.
Currently, LockObj only supports table locks and does not support partition-level locks.
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 is 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 current request.
Success: true or false. Indicates whether the request is successful.
LockStatus: If Success is true, this field has a value. Otherwise, it is empty. LockStatus contains two fields: lockId and Lockstate. If Lockstate is Acquired, lockId has a value. Otherwise, it 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.