我创建了一个Watson数据科学体验(DSX)帐户,在其中创建了目录并添加了数据资产。我正在尝试使用REST API,如以下文档所示:https://developer.ibm.com/api/view/id-1084:title-Watson_Data_Platform_Core_Services#id36962…使用curl检索资产。
curl -H "Authorization: Bearer <---stripped the auth token --->" -X GET 'https://api.dataplatform.ibm.com/v2/assets?catalog_id=bd2b56c3-091f-4ff5-beab-b3a1da85488d'
I get the following response:
{
"errors": [
{
"code": "invalid_parameter",
"message": "COMSV3006E: Missing or Invalid 'asset' id",
"target": {
"name": "asset",
"type": "parameter"
}
}
],
"trace": "e7b07khusvkj7s0ymgrggm6si"
}
如何指定要检索的资产id?此外,我希望上传资产,使用RESTAPI为现有资产分配元数据/标记。有什么文档/教程可以帮助我解释吗?
一个选项是搜索api,尽管它被列为不推荐使用的:
curl -X POST -d '{"query":"asset.asset_state:available"}' -H "Content-Type: application/json" https://api.dataplatform.ibm.com/v2/catalogs/<catalog_guid>/types/<type>/search -H "Authorization: Bearer ...."
https://developer.ibm.com/api/view/id-1084:title-Watson_Data_Platform_Core_Services#id37001
对于<type>
,您可能想要data_asset
,但也可以查找所有现有类型:
curl -X GET https://api.dataplatform.ibm.com/v2/catalogs/<catalog_guid>/types -H "Authorization: Bearer ...."
https://developer.ibm.com/api/view/id-1084:title-Watson_Data_Platform_Core_Services#id36916