Creates a data source.
Operation description
Method
POST
URI
/openapi/ha3/instances/{instanceId}/data-sources
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
searchengine:CreateDataSource |
create |
*Instance
|
None | None |
Request syntax
POST /openapi/ha3/instances/{instanceId}/data-sources HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| instanceId |
string |
Yes |
The instance ID. |
ha-cn-pl32rf0**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| dryRun |
boolean |
No |
Specifies whether to perform a dry run to check the request. A dry run checks the validity of the data source without creating it. Valid values: true and false. |
true |
| body |
object |
No |
The request body. |
{} |
| name |
string |
No |
The name of the data source. |
ha-cn-pl32rf0****_test_api |
| type |
string |
No |
The type of the data source. Valid values: odps, oss, and swift. |
odps |
| domain |
string |
No |
The data center where the data source is located. |
vpc_hz_domain_1 |
| config |
object |
No |
The data source configuration. |
|
| endpoint |
string |
No |
The endpoint of the MaxCompute or OSS data source. |
http://service.cn-hangzhou.maxcompute.aliyun-inc.com/api |
| accessKey |
string |
No |
The AccessKey ID for the MaxCompute data source. |
L***p |
| accessSecret |
string |
No |
The AccessKey secret for the MaxCompute data source. |
5**9a6 |
| project |
string |
No |
The name of the MaxCompute project. |
kubenest |
| partition |
string |
No |
The partition in the MaxCompute table. |
ds=20220713 |
| table |
string |
No |
The name of the MaxCompute table. |
item |
| namespace |
string |
No |
The namespace. |
aegis-ops |
| path |
string |
No |
The path of the HDFS file. |
test-hdfs-path |
| ossPath |
string |
No |
The path of the OSS file. |
/opensearch/search |
| bucket |
string |
No |
The name of the OSS bucket. |
opensearch |
| catalog |
string |
No |
||
| database |
string |
No |
||
| tag |
string |
No |
||
| saroConfig |
object |
No |
The configuration of the saro data source. |
|
| namespace |
string |
No |
The namespace of the saro data source. |
igraph-cn-x0r3e3abe02 |
| tableName |
string |
No |
The name of the saro data table. |
index_hdfs |
| autoBuildIndex |
boolean |
No |
Specifies whether to automatically reindex the data source after it is created. |
true |
Request example
POST /openapi/ha3/instances/ha-cn-pl32rf0****/data-sources
{
"name": "data_source_name",
"type": "odps",
"config":{
"accessKey": "xxx",
"accessSecret": "xxxs",
"project":"xxxx",
"table":"xxx",
"partition":"xxxx"
},
"autoBuildIndex": true
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| requestId |
string |
The ID of the request. |
10D5E615-69F7-5F49-B850-00169ADE513C |
| result |
object |
The returned result. |
{} |
Response examples
Success response
{
"requestId": "0A6EB64B-B4C8-CF02-810F-E660812972FF",
"result": {}
}
Error response
{
"requestId": "0A6EB64B-B4C8-CF02-810F-E660812972FF",
"result": {
"success": false,
"data": "some error message"
}
}
For more information, see Response structure.
Examples
Success response
JSON format
{
"requestId": "10D5E615-69F7-5F49-B850-00169ADE513C",
"result": {}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.