Query data assets¶
Query the corresponding data assets after processing according to the original file ID.
GET https://moi.matrixorigin.cn/newmoi/catalog/files/{file_id}/data-asset
Preparation before calling¶
First query the file list to obtain the original file ID. Prepare the personal access token, target workspace ID, and file ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$FILE_ID: To query the original file ID of the data asset.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/catalog/files/$FILE_ID/data-asset" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
string |
Original file ID. |
Successful response¶
Returns 200 and data asset information on success. 404 is returned when the file has not been processed into a data asset, and the interface will not automatically create data assets.
{
"code": "OK",
"msg": "OK",
"data": {
"asset": {
"id": 1,
"asset_id": "asset-123",
"name": "orders.csv",
"volume_id": 789,
"asset_type": "file",
"asset_ref": "file-123"
},
"derivations": [],
"assets_by_id": {}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
The data asset corresponding to the original file. |
|
integer |
Data asset internal ID. |
|
string |
Data asset ID. |
|
string |
Asset name. |
|
integer |
The volume ID to which it belongs. |
|
string |
Data asset type. |
|
string |
Data asset reference identifier. |
|
string |
Data asset source. |
|
object |
Data asset extended metadata. |
|
integer |
Unix timestamp of creation time in seconds. |
|
integer |
Unix timestamp of the update time in seconds. |
|
array |
Asset derivation relationship. |
|
object |
Mapping metadata between original file and parsed product; may be omitted if not available. |
|
object |
Related assets indexed by asset ID. |
Error response¶
{
"code": "ErrNotFound",
"msg": "对象不存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Pass in a valid original file ID. |
|
|
The current identity does not have read permission on the root volume to which it belongs. |
Use credentials with read access, or contact your administrator for authorization. |
|
|
The file does not exist, or the file has not generated data assets. |
Check the file ID; if you need a product, please complete the corresponding process first. |
|
|
The service cannot parse the data asset. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
When modifications are needed Update database. When returning the list Query file products.