Share via


教學課程:使用 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 應用程式 (用戶端) 識別碼 3dbbbcc2-f28f-44b6-a5ab-xxxxxxxxxxxx
CLIENT_SECRET 用戶端密碼 _fl******************
TENANT_ID 目錄 (租用戶) 識別碼 72f988bf-86f1-41af-91ab-xxxxxxxxxxxx
SCOPE 應用程式 (用戶端) 識別碼 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 執行個體中取得之資訊更新 [CURRENT VALUE]

    1. 在 Postman 的左側功能表中,選取 [環境],然後選取 [WellDelivery 環境]

    2. 在 [CURRENT VALUE] 資料行中,輸入本教學課程取得您 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 要求的範例,請參閱 Wellbore 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.

取得井版本

根據特定井識別碼取得井記錄。

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.

依井識別碼取得活動計劃

取得特定井識別碼的活動計劃物件。

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 來處理井資料: