你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
清单引入提供将清单引入到 Azure Data Manager for Energy 实例的功能。
本教程中,您将学习如何:
- 使用 cURL 将示例清单引入 Azure Data Manager for Energy 实例。
- 使用 cURL 搜索在清单引入期间创建的存储元数据记录。
Prerequisites
- Azure 订阅服务
- 在 Azure 订阅中创建的一个 Azure Data Manager for Energy 实例
- 计算机上安装的 cURL 命令行工具
- 用于调用引入 API 的服务主体访问令牌。 请参阅如何生成身份验证令牌。
获取 Azure Data Manager for Energy 实例的详细信息
在本教程中,需要以下参数:
| Parameter | 要使用的值 | Example | 在何处查找此值 |
|---|---|---|---|
DNS |
URI | <instance>.energy.azure.com |
在 Azure Data Manager for Energy 实例的概述页上找到此值。 |
data-partition-id |
Data partition | <data-partition-id> |
在 Azure Data Manager for Energy 实例中的“数据分区”部分找到此值。 |
access_token |
访问令牌值 | 0.ATcA01-XWHdJ0ES-qDevC6r........... |
按照 如何生成身份验证令牌 来创建访问令牌并将其保存。 |
按照 “管理用户指南 ”为运行本教程的用户添加适当的权利。
配置你的环境
确保已在 cURL 系统上安装,以便进行 API 调用。
使用 引入示例清单
若要将示例清单引入 Azure Data Manager for Energy 实例,请完成以下步骤:
创建法律标记:使用
cURL以下命令为数据符合性目的创建法律标记:curl -X POST "https://<DNS>/api/legal/v1/legaltags" \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -H "data-partition-id: <data-partition-id>" \ -d '{ "name": "<tagName>", "description": "Legal Tag added for Well", "properties": { "contractId": "123456", "countryOfOrigin": ["US", "CA"], "dataType": "Third Party Data", "exportClassification": "EAR99", "originator": "Schlumberger", "personalData": "No Personal Data", "securityClassification": "Private", "expirationDate": "2025-12-25" } }'Sample Response:
{ "name": "abcd", "description": "Legal Tag added for Well", "properties": { "contractId": "123456", "countryOfOrigin": ["US", "CA"], "dataType": "Third Party Data", "exportClassification": "EAR99", "originator": "Schlumberger", "personalData": "No Personal Data", "securityClassification": "Private", "expirationDate": "2025-12-25" } }引入主组件、引用和工作产品组件(WPC)数据:使用以下命令
cURL引入主组件、引用和工作产品组件(WPC)清单元数据:curl -X POST "https://<DNS>/api/workflow/v1/workflow/Osdu_ingest/workflowRun" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \ -H "Content-Type: application/json" \ -d '{ "executionContext": { "Payload": { "AppKey": "test-app", "data-partition-id": "<data-partition-id>" }, "manifest": { "kind": "osdu:wks:Manifest:1.0.0", "ReferenceData": [ { "id": "osdu:wks:reference-data--FacilityType:1.0.0", "name": "FacilityType", "description": "Reference data for facility types" } ], "MasterData": [ { "id": "osdu:wks:master-data--Well:1.0.0", "name": "Well", "description": "Master data for wells" } ], "Data": { "kind": "osdu:wks:dataset--File.Generic:1.0.0", "name": "Sample Dataset", "description": "Dataset for testing purposes" } } } }'Sample Response:
{ "workflowId": "Osdu_ingest", "runId":"5d6c4e37-ab53-4c5e-9c27-49dd77895377", "status": "In Progress", "message": "Workflow started successfully." }将
runId响应保存为后续步骤中的run_id。获取清单引入工作流状态:使用
cURL以下命令检查工作流状态(替换为<run_id>工作流运行 ID):curl -X GET "https://<DNS>/api/workflow/v1/workflow/Osdu_ingest/workflowRun/<run_id>" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \Sample Response:
{ "workflowId": "Osdu_ingest", "runId":"5d6c4e37-ab53-4c5e-9c27-49dd77895377", "status": "finished" }
使用 搜索引入的数据
若要搜索在清单引入期间创建的存储元数据记录,请完成以下步骤:
搜索工作产品:使用
cURL以下命令检索工作产品元数据记录:curl -X POST "https://<DNS>/api/search/v2/query" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \ -H "Content-Type: application/json" \ -d '{ "kind": "osdu:wks:work-product--WorkProduct:1.0.0", "query": "id:\"<data-partition-id>:work-product--WorkProduct:feb22:1<randomIdWP>\"" }'Sample Response:
{ "results": [ { "id": "<data-partition-id>:work-product--WorkProduct:feb22:1<randomIdWP>", "kind": "osdu:wks:work-product--WorkProduct:1.0.0", "data": { "name": "Sample Work Product", "description": "Description of the work product." } } ] }Search Work Product Components:使用
cURL以下命令检索 WPC 元数据记录:curl -X POST "https://<DNS>/api/search/v2/query" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \ -H "Content-Type: application/json" \ -d '{ "kind": "osdu:wks:work-product-component--WellboreMarkerSet:1.0.0", "query": "id:\"<data-partition-id>:work-product-component--WellboreMarkerSet:feb22:1<randomIdWPC>\"" }'Sample Response:
{ "results": [ { "id": "<data-partition-id>:work-product-component--WellboreMarkerSet:feb22:1<randomIdWPC>", "kind": "osdu:wks:work-product-component--WellboreMarkerSet:1.0.0", "data": { "name": "Sample WPC", "description": "Description of the work product component." } } ] }搜索数据集:使用
cURL以下命令检索数据集元数据记录:curl -X POST "https://<DNS>/api/search/v2/query" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \ -H "Content-Type: application/json" \ -d '{ "kind": "osdu:wks:dataset--File.Generic:1.0.0", "query": "id:\"<data-partition-id>:dataset--File.Generic:feb22:1<randomIdDataset>\"" }'Sample Response:
{ "results": [ { "id": "<data-partition-id>:dataset--File.Generic:feb22:1<randomIdDataset>", "kind": "osdu:wks:dataset--File.Generic:1.0.0", "data": { "name": "Sample Dataset", "description": "Description of the dataset." } } ] }搜索 Master 数据:使用
cURL以下命令检索主元数据记录:curl -X POST "https://<DNS>/api/search/v2/query" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \ -H "Content-Type: application/json" \ -d '{ "kind": "osdu:wks:master-data--Well:1.0.0", "query": "id:\"<data-partition-id>:master-data--Well:1112-<randomIdMasterData>\"" }'Sample Response:
{ "results": [ { "id": "<data-partition-id>:master-data--Well:1112-<randomIdMasterData>", "kind": "osdu:wks:master-data--Well:1.0.0", "data": { "name": "Sample Well", "description": "Description of the well." } } ] }搜索引用数据:使用
cURL以下命令检索引用元数据记录:curl -X POST "https://<DNS>/api/search/v2/query" \ -H "Authorization: Bearer <access_token>" \ -H "data-partition-id: <data-partition-id>" \ -H "Content-Type: application/json" \ -d '{ "kind": "osdu:wks:reference-data--FacilityType:1.0.0", "query": "id:\"<data-partition-id>:reference-data--FacilityType:Well-<randomIdReferenceData>\"" }'Sample Response:
{ "results": [ { "id": "<data-partition-id>:reference-data--FacilityType:Well-<randomIdReferenceData>", "kind": "osdu:wks:reference-data--FacilityType:1.0.0", "data": { "name": "Sample Facility Type", "description": "Description of the facility type." } } ] }
Next step
转到下一教程:
有关清单引入的详细信息,请参阅 OSDU作员数据加载快速入门指南。