你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

教程:使用 Well Delivery DDMS API 处理井数据记录

使用 Postman 中的 Well Delivery Domain Data Management Services (DDMS) API 处理 Azure Data Manager for Energy 实例中的井数据。

本教程介绍如何执行下列操作:

  • 设置 Postman 以使用 Well Delivery DDMS 集合。
  • 设置 Postman 以使用 Well Delivery DDMS 环境。
  • 通过 Postman 发送请求。
  • 生成授权令牌。
  • 使用 Well Delivery DDMS API 处理井数据记录。

有关 DDMS 的详细信息,请参阅 DDMS 概念

先决条件

获取 Azure Data Manager for Energy 实例详细信息

首先从 Azure 门户中的 Azure Data Manager for Energy 实例获取以下信息:

参数 示例
CLIENT_ID 应用程序(客户端)ID 3dbbbcc2-f28f-44b6-a5ab-xxxxxxxxxxxx
CLIENT_SECRET 客户端机密 _fl******************
TENANT_ID 目录(租户)ID 72f988bf-86f1-41af-91ab-xxxxxxxxxxxx
SCOPE 应用程序(客户端)ID 3dbbbcc2-f28f-44b6-a5ab-xxxxxxxxxxxx
base_uri URI <instance>.energy.azure.com
data-partition-id 数据分区 <instance>-<data-partition-name>

本教程的后面部分需使用此信息。

设置 Postman

  1. 下载并安装 Postman 桌面应用。

  2. 将以下文件导入 Postman:

    要导入这些文件:

    1. 通过复制集合和环境文件中的数据,在计算机上创建两个 JSON 文件。

    2. 在 Postman 中,选择“导入”>“文件”>“选择文件”,然后选择计算机上的这两个 JSON 文件。

    3. 在 Postman 中的“导入实体”中,选择“导入”。

      Screenshot that shows importing collection and environment files in Postman.

  3. 在 Postman 环境中,使用 Azure Data Manager for Energy 实例中的信息更新“当前值”

    1. 在 Postman 的左侧菜单中,选择“环境”,然后选择“WellDelivery 环境”

    2. 在“当前值”列中,输入本教程的获取 Azure Data Manager for Energy 实例详细信息部分的表中的信息。

    Screenshot that shows where to enter current values in the Well Delivery DDMS environment.

发送 Postman 请求

Well Delivery DDMS 的 Postman 集合包含可用于与 Azure Data Manager for Energy 实例中有关井、井眼、测井曲线和井轨迹数据的数据进行交互的请求。

有关如何发送 Postman 请求的示例,请参阅井身 DDMS 教程

为 API 生成令牌

生成可用于处理 Well Delivery DDMS API 的令牌:

  1. 在 Postman 中导入以下 cURL 命令以生成持有者令牌。 使用 Azure Data Manager for Energy 实例中的值。

     curl --location --request POST 'https://login.microsoftonline.com/{{TENANT_ID}}/oauth2/v2.0/token' \
         --header 'Content-Type: application/x-www-form-urlencoded' \
         --data-urlencode 'grant_type=client_credentials' \
         --data-urlencode 'client_id={{CLIENT_ID}}' \
         --data-urlencode 'client_secret={{CLIENT_SECRET}}' \
         --data-urlencode 'scope={{SCOPE}}'  
    

    Screenshot of cURL code in a Well Delivery DDMS token.

  2. 在 Well Delivery DDMS 环境中使用令牌输出更新 access_token。 然后,可以在其他 API 调用中将持有者令牌用作授权类型。

使用 Well Delivery DDMS API 处理井数据记录

成功完成以下 Well Delivery DDMS API 中所述的 Postman 请求表示成功引入和检索 Azure Data Manager for Energy 实例中的井记录。

创建井记录

在 Azure Data Manager for Energy 实例中创建钻井记录。

API:UC1>entity_create well

方法:PUT

Screenshot that shows the API that creates a well record.

创建井眼记录

在 Azure Data Manager for Energy 实例中创建井眼记录。

API:UC1>entity_create wellbore

方法:PUT

Screenshot that shows the API that creates a wellbore record.

获取井版本

根据特定井 ID 获取井记录。

API:UC1>entity_create well Copy

方法:GET

Screenshot that shows the API that gets a well record based on a specific well ID.

创建活动计划

创建活动计划。

API:UC1>entity_create activityplan

方法:PUT

Screenshot that shows the API that creates an activity plan.

按井 ID 获取活动计划

获取特定井 ID 的活动计划对象。

API:UC2>activity_plans_by_well

方法:GET

Screenshot of the API that gets an activity plan by well ID.

删除井身记录

可以使用 Well Delivery DDMS API 删除 Azure Data Manager for Energy 实例中的井身记录。 以下屏幕截图显示了一个示例。

Screenshot that shows how to use an API to delete a wellbore record.

删除井记录

可以使用 Well Delivery DDMS API 删除 Azure Data Manager for Energy 实例中的井号记录。 以下屏幕截图显示了一个示例。

Screenshot that shows how to use an API to delete a well record.

后续步骤

请转到下一教程,了解如何使用 Wellbore DDMS API 处理井数据: