Creates a metadatabase in Data Lake Formation (DLF).
Debugging
Request headers
This operation uses only common request headers. For more information, see Common request parameters.
Request syntax
POST /api/metastore/catalogs/databases
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
Object | Body | No |
The HTTP request body, in the JSON format. |
||
CatalogId | String | Body | No | 1344371 |
Default value: the user ID of your Alibaba Cloud account. |
DatabaseInput | Common data structures | Body | No |
The details about the metadatabase. |
|
RegionId | String | Host | No | cn-hangzhou |
The ID of the region where DLF is activated. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | OK |
The description of the status code. |
Message | String | . |
The error message that is returned. |
RequestId | String | B7F4B621-E41E-4C84-B97F-42B5380A32BB |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call was successful. |
Error codes
InvalidObject: The specified name, partition, column, or skewed field failed the verification.
AlreadyExists: The specified metadatabase already exists.
InternalError: An internal error has occurred. Troubleshoot the error based on the error message that is returned.
Examples
Sample requests
POST /api/metastore/catalogs/databases HTTP/1.1
{
"CatalogId":"1344371",
"DatabaseInput":{
"Name":"database_test",
"Description":"this is a hive database",
"LocationUri":"/hdfs/hivedb/data",
"OwnerName":"zhangsan",
"OwnerType":"USER",
"Parameters":{
"k1":"v1"
}
}
}
Sample success responses
JSON
format
{
"Success": true,
"Code": "OK",
"Message": "",
"HttpStatusCode": 200,
"RequestId": "B7F4B621-E41E-4C84-B97F-42B5380A32BB"
}
Error codes
For a list of error codes, visit the API Error Center.