Querying the List of Data Sources
Function
This API is used to query the data source list in the current workspace.
URI
GET /v2.0/{project_id}/workspaces/{workspace_id}/data-sources
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. |
| workspace_id | Yes | String | Workspace ID |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Content type. The value is application/json. |
| X-Auth-Token | Yes | String | User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| datasources | Array of datasources objects | Data source details list |
| is_success | Boolean | Whether the request is successful |
| message | String | Response message (This field is not returned when the request is successful.) |
| error_code | String | Error code (This parameter is not returned when the request is successful.) |
| Parameter | Type | Description |
|---|---|---|
| datasource_id | String | Data source ID |
| datasource_name | String | Name |
| status | String | Status |
| structure | String | Structure |
| workspace_id | String | Workspace ID |
| data_config | DataConfig object | Data settings |
| specs_config | SpecsConfig object | Computing specifications settings |
| created_at | String | Creation time |
| update_at | Long | Update time |
| Parameter | Type | Description |
|---|---|---|
| offline | Offline object | Offline computing specifications |
| nearline | Nearline object | Nearline data source |
| Parameter | Type | Description |
|---|---|---|
| user_url | String | User data URL |
| item_url | String | Item data URL |
| behavior_url | String | Behavior data URL |
Example Requests
This API is used to query the data sources in the current workspace.
/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/data-sources -
Example Responses
Status code: 200
OK
{
"is_success" : true,
"datasources" : [ {
"specs_config" : {
"offline" : "4CU"
},
"data_config" : {
"offline" : {
"user_url" : "<OBS path for storing user data>",
"item_url" : "<OBS path for storing item data>",
"behavior_url" : "<OBS path for storing behavior data>"
}
},
"datasource_name" : "test",
"workspace_id" : "06a7c49afc00d4972ff1c0113d8c49ba",
"datasource_id" : "51d48ed2da324cefa1c8336136b36557",
"status" : "Draft",
"created_at" : 1588850804912,
"update_at" : 1588850804912
}, {
"specs_config" : {
"offline" : "4CU"
},
"data_config" : {
"offline" : {
"user_url" : "<OBS path for storing user data>",
"item_url" : "<OBS path for storing item data>",
"behavior_url" : "<OBS path for storing behavior data>"
}
},
"datasource_name" : "test-cyz",
"workspace_id" : "06a7c49afc00d4972ff1c0113d8c49ba",
"datasource_id" : "aa6d657026de42a2927a50400ae69a4b",
"status" : "Succeed",
"created_at" : 1587953962684,
"update_at" : 1587953962684,
"structure" : "{\"user_attrs\":[{\"name\":\"age\",\"data_type\":\"long\"},{\"name\":\"extend_float\",\"data_type\":\"float\"},{\"name\":\"extend_long\",\"data_type\":\"long\"},{\"name\":\"extend_strArray\",\"data_type\":\"strArray\"},{\"name\":\"extend_string\",\"data_type\":\"string\"},{\"name\":\"gender\",\"data_type\":\"string\"},{\"name\":\"location\",\"data_type\":\"location\"},{\"name\":\"tags\",\"data_type\":\"strArray\"},{\"name\":\"userId\",\"data_type\":\"string\"}],\"item_attrs\":[{\"name\":\"author\",\"data_type\":\"strArray\"},{\"name\":\"category\",\"data_type\":\"string\"},{\"name\":\"expireTime\",\"data_type\":\"long\"},{\"name\":\"extend_float\",\"data_type\":\"float\"},{\"name\":\"extend_long\",\"data_type\":\"long\"},{\"name\":\"extend_strArray\",\"data_type\":\"strArray\"},{\"name\":\"extend_string\",\"data_type\":\"string\"},{\"name\":\"itemId\",\"data_type\":\"string\"},{\"name\":\"itemType\",\"data_type\":\"string\"},{\"name\":\"location\",\"data_type\":\"location\"},{\"name\":\"publishTime\",\"data_type\":\"long\"},{\"name\":\"score\",\"data_type\":\"long\"},{\"name\":\"status\",\"data_type\":\"long\"},{\"name\":\"tags\",\"data_type\":\"strArray\"}],\"behaviors\":{\"positive_behaviors\":[{\"behavior_type\":\"click\",\"weight\":0.3},{\"behavior_type\":\"like\",\"weight\":0.8}],\"negative_behaviors\":[{\"behavior_type\":\"view\",\"weight\":0.1},{\"behavior_type\":\"dislike\",\"weight\":0.8}]}}"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
See Error Codes.
Last Article: Creating a Data Source
Next Article: Querying the Details of a Data Source
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.