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 (only validates whether the data source is valid). Valid values:
|
true |
| body |
object |
No |
The request struct. |
{} |
| 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 resides. |
vpc_hz_domain_1 |
| config |
object |
No |
The configuration information. |
|
| endpoint |
string |
No |
The endpoint of the ODPS data source or the OSS data source. |
http://service.cn-hangzhou.maxcompute.aliyun-inc.com/api |
| accessKey |
string |
No |
The AccessKey ID of the ODPS data source. |
L***p |
| accessSecret |
string |
No |
The AccessKey secret of the ODPS data source. |
5**9a6 |
| project |
string |
No |
The project name of the ODPS data source. |
kubenest |
| partition |
string |
No |
The ODPS partition. |
ds=20220713 |
| table |
string |
No |
The ODPS table name. |
item |
| namespace |
string |
No |
The namespace. |
aegis-ops |
| path |
string |
No |
The HDFS file path. |
test-hdfs-path |
| ossPath |
string |
No |
The OSS file path. |
/opensearch/search |
| bucket |
string |
No |
oss bucket |
opensearch |
| catalog |
string |
No |
||
| database |
string |
No |
||
| tag |
string |
No |
||
| saroConfig |
object |
No |
The Saro datasource config. |
|
| namespace |
string |
No |
The namespace of the Saro data source. |
igraph-cn-x0r3e3abe02 |
| tableName |
string |
No |
The Saro data table name. |
index_hdfs |
| autoBuildIndex |
boolean |
No |
Specifies whether to automatically rebuild indexes. |
true |
Request example
POST /openapi/ha3/instances/ha3_instances_id/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 request ID. |
10D5E615-69F7-5F49-B850-00169ADE513C |
| result |
object |
The returned result. |
{} |
Response example
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 struct.
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.