Modifying a Data Source
Function
This API is used to modify a specified data source.
URI
PUT /v2.0/{project_id}/workspaces/{workspace_id}/data-sources/{datasource_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| datasource_id | Yes | String | Data source ID |
| 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Content type. The value is application/json. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Data source name, which is a string of 1 to 64 characters and contains letters, digits, underscores (_), and hyphens (-) Minimum: 1 Maximum: 64 |
| data_config | Yes | DataConfig object | Data settings |
| specs_config | Yes | SpecsConfig object | Computing specifications settings |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offline | Yes | Offline object | Offline computing specifications |
| nearline | No | Nearline object | Nearline data source |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_url | Yes | String | User data URL |
| item_url | Yes | String | Item data URL |
| behavior_url | Yes | String | Behavior data URL |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| is_success | Boolean | Whether the request is successful |
| message | String | Response message |
| error_code | String | Error code (This parameter is not returned when the request is successful.) |
Example Requests
This API is used to modify a data source.
/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/data-sources/testuuidxxxxxxxxxxxxxxxxxxxxxxxx
{
"datasource_name" : "jby-test-datasourc1e",
"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>"
}
},
"specs_config" : {
"offline" : "4CU",
"nearline" : "8CU"
}
} Example Responses
Status code: 200
OK
{
"is_success" : true,
"message" : "Successed to update data source."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
See Error Codes.
Last Article: Querying the Details of a Data Source
Next Article: Modifying Features in a Data Source
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.