You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Tutorial: Work with well data records by using Well Delivery DDMS APIs
15
15
16
-
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.
16
+
This tutorial demonstrates how to utilize Well Delivery Domain Data Management Services (DDMS) APIs with cURL to manage well record within an Azure Data Manager for Energy instance.
17
17
18
18
In this tutorial, you learn how to:
19
19
20
20
> [!div class="checklist"]
21
21
>
22
-
> - Set up Postman to use a Well Delivery DDMS collection.
23
-
> - Set up Postman to use a Well Delivery DDMS environment.
24
-
> - Send requests via Postman.
25
-
> - Generate an authorization token.
26
22
> - Use Well Delivery DDMS APIs to work with well data records.
27
23
28
24
For more information about DDMS, see [DDMS concepts](concepts-ddms.md).
29
25
30
26
## Prerequisites
31
-
32
-
- An Azure subscription
33
-
- An instance of [Azure Data Manager for Energy](quickstart-create-microsoft-energy-data-services-instance.md) created in your Azure subscription
27
+
* An Azure subscription
28
+
* An instance of [Azure Data Manager for Energy](quickstart-create-microsoft-energy-data-services-instance.md) created in your Azure subscription
29
+
* cURL command-line tool installed on your machine
30
+
* Generate the service principal access token to call the Seismic APIs. See [How to generate auth token](how-to-generate-auth-token.md).
34
31
35
32
## Get your Azure Data Manager for Energy instance details
36
33
37
-
The first step is to get the following information from your [Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md) in the [Azure portal](https://portal.azure.com/?microsoft_azure_marketplace_ItemHideKey=Microsoft_Azure_OpenEnergyPlatformHidden):
To proceed, gather the following details from your [Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md) via the [Azure portal](https://portal.azure.com/?microsoft_azure_marketplace_ItemHideKey=Microsoft_Azure_OpenEnergyPlatformHidden):
60
35
61
-
1. Create two JSON files on your computer by copying the data that's in the collection and environment files.
36
+
| Parameter | Description | Example | Where to find this value |
|`client_id`| Application (client) ID |`00001111-aaaa-2222-bbbb-3333cccc4444`| You use this app or client ID when registering the application with the Microsoft identity platform. See [Register an application](../active-directory/develop/quickstart-register-app.md#register-an-application)|
39
+
|`client_secret`| Client secret |`_fl******************`|Sometimes called an *application password*, a client secret is a string value that your app can use in place of a certificate to identity itself. See [Add a client secret](../active-directory/develop/quickstart-register-app.md#add-a-client-secret).|
40
+
|`tenant_id`| Directory (tenant) ID |`72f988bf-86f1-41af-91ab-xxxxxxxxxxxx`| Hover over your account name in the Azure portal to get the directory or tenant ID. Alternatively, search for and select **Microsoft Entra ID** > **Properties** > **Tenant ID** in the Azure portal. |
41
+
|`base_url`| Instance URL |`https://<instance>.energy.azure.com`| Find this value on the overview page of the Azure Data Manager for Energy instance.|
42
+
|`data_partition_id`| Data partition name |`opendes`| Find this value on the overview page of the Azure Data Manager for Energy instance.|
43
+
|`access_token`| Access token value |`0.ATcA01-XWHdJ0ES-qDevC6r...........`| Follow [How to generate auth token](how-to-generate-auth-token.md) to create an access token and save it.|
62
44
63
-
1. In Postman, select **Import** > **Files** > **Choose Files**, and then select the two JSON files on your computer.
64
45
65
-
1. In **Import Entities** in Postman, select **Import**.
66
-
67
-
:::image type="content" source="media/tutorial-well-delivery/import-files.png" alt-text="Screenshot that shows importing collection and environment files." lightbox="media/tutorial-well-delivery/import-files.png":::
68
-
69
-
1. In the Postman environment, update **CURRENT VALUE** with the information from your Azure Data Manager for Energy instance:
70
-
71
-
1. In Postman, on the left menu, select **Environments**, and then select **WellDelivery Environment**.
72
-
73
-
1. In the **CURRENT VALUE** column, enter the information from the table in the [Get your Azure Data Manager for Energy instance details](#get-your-azure-data-manager-for-energy-instance-details) section of this tutorial.
74
-
75
-
:::image type="content" source="media/tutorial-well-delivery/postman-environment-current-values.png" alt-text="Screenshot that shows where to enter current values in the Well Delivery DDMS environment.":::
76
-
77
-
## Send a Postman request
46
+
## Use Well Delivery DDMS APIs to work with well data records
78
47
79
-
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.
48
+
### Create a legal tag
80
49
50
+
Create a legal tag for data compliance.
81
51
82
-
## Generate a token for APIs
52
+
Run the following `cURL` command to create a legal tag:
83
53
84
-
Generate a token that you can use to work with Well Delivery DDMS APIs:
54
+
```bash
55
+
curl -X POST "https://{base_url}/api/legal/v1/legaltags" \
56
+
-H "Authorization: Bearer <access_token>" \
57
+
-H "Content-Type: application/json" \
58
+
-H "data-partition-id: <data_partition_id>" \
59
+
-d '{
60
+
"name": "LegalTagName",
61
+
"description": "Legal Tag added for Well",
62
+
"properties": {
63
+
"contractId": "123456",
64
+
"countryOfOrigin": ["US", "CA"],
65
+
"dataType": "Third Party Data",
66
+
"exportClassification": "EAR99",
67
+
"originator": "xyz",
68
+
"personalData": "No Personal Data",
69
+
"securityClassification": "Private",
70
+
"expirationDate": "2025-12-25"
71
+
}
72
+
}'
73
+
```
85
74
86
-
1. Import the following cURL command in Postman to generate a bearer token. Use the values from your Azure Data Manager for Energy instance.
75
+
**Sample Response:**
76
+
```json
77
+
{
78
+
"name": "LegalTagName",
79
+
"status": "Created"
80
+
}
81
+
```
87
82
88
-
```bash
89
-
curl --location --request POST 'https://login.microsoftonline.com/{{TENANT_ID}}/oauth2/v2.0/token' \
For more information, see [Manage legal tags](how-to-manage-legal-tags.md).
96
84
97
-
:::image type="content" source="media/tutorial-well-delivery/postman-generate-token.png" alt-text="Screenshot of cURL code in a Well Delivery DDMS token." lightbox="media/tutorial-well-delivery/postman-generate-token.png":::
85
+
### Add users to an entitlement group
98
86
99
-
1. Use the token output to update `access_token`in your Well Delivery DDMS environment. Then, you can use the bearer token as an authorization typein other API calls.
87
+
For users to have the proper permissions to make Petrel DDMS API calls, they must be part of the `users.datalake.admins@{data-partition-id}.dataservices.energy` entitlement group. This call adds a user to the proper group.
100
88
101
-
## Use Well Delivery DDMS APIs to work with well data records
89
+
The user in this case is the client ID or OID in the token that's used for authentication. For example, if you generate a token by using a client ID of `8cdxxxxxxxxxxxx`, you must add `8cdxxxxxxxxxxxx` to the `users.datalake.admins` group.
90
+
Follow the [Manage users](how-to-manage-users.md) guide to add appropriate entitlements for the user .
102
91
103
-
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.
104
92
105
93
### Create a well record
106
94
107
95
Create a well record in your Azure Data Manager for Energy instance.
108
96
109
-
API: **UC1**>**entity_create well**
110
-
111
97
Method: `PUT`
112
98
113
-
:::image type="content" source="media/tutorial-well-delivery/postman-api-create-well.png" alt-text="Screenshot that shows the API that creates a well record." lightbox="media/tutorial-well-delivery/postman-api-create-well.png":::
Create a wellbore record in your Azure Data Manager for Energy instance.
118
141
119
-
API: **UC1**>**entity_create wellbore**
120
-
121
142
Method: `PUT`
122
143
123
-
:::image type="content" source="media/tutorial-well-delivery/postman-api-create-well-bore.png" alt-text="Screenshot that shows the API that creates a wellbore record." lightbox="media/tutorial-well-delivery/postman-api-create-well-bore.png":::
:::image type="content" source="media/tutorial-well-delivery/postman-api-get-well.png" alt-text="Screenshot that shows the API that gets a well record based on a specific well ID." lightbox="media/tutorial-well-delivery/postman-api-get-well.png":::
134
185
135
186
### Create an activity plan
136
187
137
188
Create an activity plan.
138
189
139
-
API: **UC1**>**entity_create activityplan**
140
-
141
190
Method: `PUT`
142
191
143
-
:::image type="content" source="media/tutorial-well-delivery/postman-api-create-activity-plan.png" alt-text="Screenshot that shows the API that creates an activity plan." lightbox="media/tutorial-well-delivery/postman-api-create-activity-plan.png":::
144
-
145
-
### Get an activity plan by well ID
146
-
147
-
Get the activity plan object for a specific well ID.
148
-
149
-
API: **UC2**>**activity_plans_by_well**
150
192
151
-
Method: `GET`
152
-
153
-
:::image type="content" source="media/tutorial-well-delivery/postman-api-activity-plans-by-well.png" alt-text="Screenshot of the API that gets an activity plan by well ID." lightbox="media/tutorial-well-delivery/postman-api-activity-plans-by-well.png":::
154
-
155
-
### Delete a wellbore record
156
-
157
-
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.
158
-
159
-
:::image type="content" source="media/tutorial-well-delivery/postman-api-delete-well-bore.png" alt-text="Screenshot that shows how to use an API to delete a wellbore record.":::
160
-
161
-
### Delete a well record
162
-
163
-
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.
164
-
165
-
:::image type="content" source="media/tutorial-well-delivery/postman-api-delete-well.png" alt-text="Screenshot that shows how to use an API to delete a well record.":::
Go to the next tutorial to learn how to work with well data by using Wellbore DDMS APIs:
170
236
171
237
> [!div class="nextstepaction"]
172
238
> [Tutorial: Work with well data records by using Wellbore DDMS APIs](tutorial-wellbore-ddms.md)
239
+
240
+
For more information on the Well Delivery DDMS REST APIs in Azure Data Manager for Energy, see the OpenAPI specifications available in the [adme-samples](https://microsoft.github.io/adme-samples/) GitHub repository.
0 commit comments