Επεξεργασία

Κοινή χρήση μέσω


Tutorial: Work with well data records by using Well Delivery DDMS APIs

Use Well Delivery Domain Data Management Services (DDMS) APIs in Postman to work with well data in your instance of Azure Data Manager for Energy.

In this tutorial, you learn how to:

  • Set up Postman to use a Well Delivery DDMS collection.
  • Set up Postman to use a Well Delivery DDMS environment.
  • Send requests via Postman.
  • Generate an authorization token.
  • Use Well Delivery DDMS APIs to work with well data records.

For more information about DDMS, see DDMS concepts.

Prerequisites

Get your Azure Data Manager for Energy instance details

The first step is to get the following information from your Azure Data Manager for Energy instance in the Azure portal:

Parameter Value Example
CLIENT_ID Application (client) ID 3dbbbcc2-f28f-44b6-a5ab-xxxxxxxxxxxx
CLIENT_SECRET Client secrets _fl******************
TENANT_ID Directory (tenant) ID 72f988bf-86f1-41af-91ab-xxxxxxxxxxxx
SCOPE Application (client) ID 3dbbbcc2-f28f-44b6-a5ab-xxxxxxxxxxxx
base_uri URI <instance>.energy.azure.com
data-partition-id Data partitions <instance>-<data-partition-name>

You'll use this information later in the tutorial.

Set up Postman

  1. Download and install the Postman desktop app.

  2. Import the following files in Postman:

    To import the files:

    1. Create two JSON files on your computer by copying the data that's in the collection and environment files.

    2. In Postman, select Import > Files > Choose Files, and then select the two JSON files on your computer.

    3. In Import Entities in Postman, select Import.

      Screenshot that shows importing collection and environment files in Postman.

  3. In the Postman environment, update CURRENT VALUE with the information from your Azure Data Manager for Energy instance:

    1. In Postman, on the left menu, select Environments, and then select WellDelivery Environment.

    2. In the CURRENT VALUE column, enter the information from the table in the Get your Azure Data Manager for Energy instance details section of this tutorial.

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

Send a Postman request

The Postman collection for Well Delivery DDMS contains requests that you can use to interact with data about wells, wellbores, well logs, and well trajectory in your Azure Data Manager for Energy instance.

For an example of how to send a Postman request, see the Wellbore DDMS tutorial.

Generate a token for APIs

Generate a token that you can use to work with Well Delivery DDMS APIs:

  1. Import the following cURL command in Postman to generate a bearer token. Use the values from your Azure Data Manager for Energy instance.

     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. Use the token output to update access_token in your Well Delivery DDMS environment. Then, you can use the bearer token as an authorization type in other API calls.

Use Well Delivery DDMS APIs to work with well data records

Successfully completing the Postman requests that are described in the following Well Delivery DDMS APIs indicates successful ingestion and retrieval of well records in your Azure Data Manager for Energy instance.

Create a well record

Create a well record in your Azure Data Manager for Energy instance.

API: UC1 > entity_create well

Method: PUT

Screenshot that shows the API that creates a well record.

Create a wellbore record

Create a wellbore record in your Azure Data Manager for Energy instance.

API: UC1 > entity_create wellbore

Method: PUT

Screenshot that shows the API that creates a wellbore record.

Get a well version

Get a well record based on a specific well ID.

API: UC1 > entity_create well Copy

Method: GET

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

Create an activity plan

Create an activity plan.

API: UC1 > entity_create activityplan

Method: PUT

Screenshot that shows the API that creates an activity plan.

Get an activity plan by well ID

Get the activity plan object for a specific well ID.

API: UC2 > activity_plans_by_well

Method: GET

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

Delete a wellbore record

You can delete a wellbore record in your Azure Data Manager for Energy instance by using Well Delivery DDMS APIs. The following screenshot shows an example.

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

Delete a well record

You can delete a well record in your Azure Data Manager for Energy instance by using Well Delivery DDMS APIs. The following screenshot shows an example.

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

Next steps

Go to the next tutorial to learn how to work with well data by using Wellbore DDMS APIs: