Skip to content

Commit 070abc6

Browse files
authored
Merge pull request #303204 from preetisingh110/postmanfix
Postmanfix for pds and wellbore
2 parents 94cffe8 + 51a5c38 commit 070abc6

File tree

4 files changed

+552
-264
lines changed

4 files changed

+552
-264
lines changed

articles/energy-data-services/tutorial-manifest-ingestion.md

Lines changed: 276 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -20,85 +20,292 @@ In this tutorial, you learn how to:
2020

2121
> [!div class="checklist"]
2222
>
23-
> * Ingest sample manifests into an Azure Data Manager for Energy instance by using Postman.
24-
> * Search for storage metadata records created during manifest ingestion by using Postman.
23+
> * Ingest sample manifests into an Azure Data Manager for Energy instance by using cURL.
24+
> * Search for storage metadata records created during manifest ingestion by using cURL.
2525
2626
## Prerequisites
2727

28-
Before you start this tutorial, complete the following prerequisites.
28+
* An Azure subscription
29+
* An instance of [Azure Data Manager for Energy](quickstart-create-microsoft-energy-data-services-instance.md) created in your Azure subscription
30+
* cURL command-line tool installed on your machine
31+
* Service principal access token to call the Ingestion APIs. See [How to generate auth token](how-to-generate-auth-token.md).
2932

3033
### Get details for the Azure Data Manager for Energy instance
3134

32-
* You need an Azure Data Manager for Energy instance. If you don't already have one, create one by following the steps in [Quickstart: Create an Azure Data Manager for Energy instance](quickstart-create-microsoft-energy-data-services-instance.md).
33-
* For this tutorial, you need the following parameters:
35+
For this tutorial, you need the following parameters:
3436

35-
| Parameter | Value to use | Example | Where to find this value |
36-
| ------------------ | ------------------------ |-------------------------------------- |-------------------------------------- |
37-
| `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). |
38-
| `CLIENT_SECRET` | Client secrets | `_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).|
39-
| `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. Alternately, search for and select **Microsoft Entra ID** > **Properties** > **Tenant ID** in the Azure portal. |
40-
| `SCOPE` | Application (client) ID | `00001111-aaaa-2222-bbbb-3333cccc4444` | This value is the same as the app or client ID mentioned earlier. |
41-
| `refresh_token` | Refresh token value | `0.ATcA01-XWHdJ0ES-qDevC6r...........` | Follow [How to generate auth token](how-to-generate-auth-token.md) to create a refresh token and save it. You need this refresh token later to generate a user token. |
42-
| `DNS` | URI | `<instance>.energy.Azure.com` | Find this value on the overview page of the Azure Data Manager for Energy instance.|
43-
| `data-partition-id` | Data partitions | `<data-partition-id>` | Find this value on the overview page of the Azure Data Manager for Energy instance.|
37+
| Parameter | Value to use | Example | Where to find this value |
38+
|----|----|----|----|
39+
| `DNS` | URI | `<instance>.energy.azure.com` | Find this value on the overview page of the Azure Data Manager for Energy instance. |
40+
| `data-partition-id` | Data partition | `<data-partition-id>` | Find this value on the Data Partition section within the Azure Data Manager for Energy instance. |
41+
| `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.|
4442

4543
Follow the [Manage users](how-to-manage-users.md) guide to add appropriate entitlements for the user who's running this tutorial.
4644

47-
### Set up Postman and execute requests
48-
49-
1. Download and install the [Postman](https://www.postman.com/) desktop app.
50-
51-
1. Import the following files into Postman:
52-
53-
* [Manifest ingestion Postman collection](https://raw.githubusercontent.com/microsoft/meds-samples/main/postman/IngestionWorkflows.postman_collection.json)
54-
* [Manifest ingestion Postman environment](https://raw.githubusercontent.com/microsoft/meds-samples/main/postman/IngestionWorkflowEnvironment.postman_environment.json)
55-
56-
To import the Postman collection and environment variables, follow the steps in [Importing data into Postman](https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#importing-data-into-postman).
57-
58-
1. Update **CURRENT VALUE** for the Postman environment with the information that you obtained in the details of the Azure Data Manager for Energy instance.
59-
60-
1. The Postman collection for manifest ingestion contains multiple requests that you must execute sequentially.
61-
62-
Be sure to choose **Ingestion Workflow Environment** before you trigger the Postman collection.
63-
64-
:::image type="content" source="media/tutorial-manifest-ingestion/tutorial-postman-choose-environment.png" alt-text="Screenshot of the Postman environment." lightbox="media/tutorial-manifest-ingestion/tutorial-postman-choose-environment.png":::
65-
66-
1. Trigger each request by selecting the **Send** button.
67-
68-
On every request, Postman validates the actual API response code against the expected response code. If there's any mismatch, the test section indicates failures.
69-
70-
Here's an example of a successful Postman request:
71-
72-
:::image type="content" source="media/tutorial-manifest-ingestion/tutorial-postman-test-success.png" alt-text="Screenshot of a successful Postman call." lightbox="media/tutorial-manifest-ingestion/tutorial-postman-test-success.png":::
73-
74-
Here's an example of a failed Postman request:
75-
76-
:::image type="content" source="media/tutorial-manifest-ingestion/tutorial-postman-test-failure.png" alt-text="Screenshot of a failed Postman call." lightbox="media/tutorial-manifest-ingestion/tutorial-postman-test-failure.png":::
77-
78-
## Ingest sample manifests by using Postman
79-
80-
To ingest sample manifests into the Azure Data Manager for Energy instance by using the Postman collection, complete the following steps:
81-
82-
1. **Get a User Access Token**: Generate the user token, which will be used to authenticate further API calls.
83-
1. **Create a Legal Tag**: Create a legal tag that will be added to the manifest data for data compliance purposes.
84-
1. **Get a Signed URL for uploading a file**: Get the signed URL path to which the manifest file will be uploaded.
85-
1. **Upload a file**: Download the [Wellbore.csv](https://github.com/microsoft/meds-samples/blob/main/test-data/wellbore.csv) sample to your local machine. It could be any file type, including CSV, LAS, or JSON. Select this file in Postman by clicking the **Select File** button.
86-
87-
:::image type="content" source="media/tutorial-manifest-ingestion/tutorial-select-manifest-file.png" alt-text="Screenshot of uploading a manifest file." lightbox="media/tutorial-manifest-ingestion/tutorial-select-manifest-file.png":::
88-
1. **Upload File Metadata**: Upload the file metadata information, such as file location and other relevant fields.
89-
1. **Get the File Metadata**: Call to validate if the metadata was created successfully.
90-
1. **Ingest Master, Reference and Work Product Component (WPC) data**: Ingest the master, reference, and work product component (WPC) manifest metadata.
91-
1. **Get Manifest Ingestion Workflow status**: The workflow starts and is in the **running** state. Keep querying until the state changes to **finished** (typically 20 to 30 seconds).
92-
93-
## Search for ingested data by using Postman
94-
95-
To search for storage metadata records created during the manifest ingestion by using the Postman collection, complete the following steps:
96-
97-
1. **Search Work Products**: Call the search service to retrieve the work product metadata records.
98-
1. **Search Work Product Components**: Call the search service to retrieve the WPC metadata records.
99-
1. **Search for Dataset**: Call the search service to retrieve the dataset metadata records.
100-
1. **Search for Master data**: Call the search service to retrieve the master metadata records.
101-
1. **Search for Reference Data**: Call the search service to retrieve the reference metadata records.
45+
### Set up your environment
46+
47+
Ensure you have `cURL` installed on your system to make API calls.
48+
49+
## Ingest sample manifests by using `cURL`
50+
51+
To ingest sample manifests into the Azure Data Manager for Energy instance, complete the following steps:
52+
53+
1. **Create a Legal Tag**: Use the following `cURL` command to create a legal tag for data compliance purposes:
54+
55+
```bash
56+
curl -X POST "https://<DNS>/api/legal/v1/legaltags" \
57+
-H "Authorization: Bearer <access_token>" \
58+
-H "Content-Type: application/json" \
59+
-H "data-partition-id: <data-partition-id>" \
60+
-d '{
61+
"name": "<tagName>",
62+
"description": "Legal Tag added for Well",
63+
"properties": {
64+
"contractId": "123456",
65+
"countryOfOrigin": ["US", "CA"],
66+
"dataType": "Third Party Data",
67+
"exportClassification": "EAR99",
68+
"originator": "Schlumberger",
69+
"personalData": "No Personal Data",
70+
"securityClassification": "Private",
71+
"expirationDate": "2025-12-25"
72+
}
73+
}'
74+
```
75+
76+
**Sample Response:**
77+
```json
78+
{
79+
"name": "abcd",
80+
"description": "Legal Tag added for Well",
81+
"properties": {
82+
"contractId": "123456",
83+
"countryOfOrigin": ["US", "CA"],
84+
"dataType": "Third Party Data",
85+
"exportClassification": "EAR99",
86+
"originator": "Schlumberger",
87+
"personalData": "No Personal Data",
88+
"securityClassification": "Private",
89+
"expirationDate": "2025-12-25"
90+
}
91+
}
92+
```
93+
94+
2. **Ingest Master, Reference, and Work Product Component (WPC) data**: Use the following `cURL` command to ingest the master, reference, and work product component (WPC) manifest metadata:
95+
96+
```bash
97+
curl -X POST "https://<DNS>/api/workflow/v1/workflow/Osdu_ingest/workflowRun" \
98+
-H "Authorization: Bearer <access_token>" \
99+
-H "data-partition-id: <data-partition-id>" \
100+
-H "Content-Type: application/json" \
101+
-d '{
102+
"executionContext": {
103+
"Payload": {
104+
"AppKey": "test-app",
105+
"data-partition-id": "<data-partition-id>"
106+
},
107+
"manifest": {
108+
"kind": "osdu:wks:Manifest:1.0.0",
109+
"ReferenceData": [
110+
{
111+
"id": "osdu:wks:reference-data--FacilityType:1.0.0",
112+
"name": "FacilityType",
113+
"description": "Reference data for facility types"
114+
}
115+
],
116+
"MasterData": [
117+
{
118+
"id": "osdu:wks:master-data--Well:1.0.0",
119+
"name": "Well",
120+
"description": "Master data for wells"
121+
}
122+
],
123+
"Data": {
124+
"kind": "osdu:wks:dataset--File.Generic:1.0.0",
125+
"name": "Sample Dataset",
126+
"description": "Dataset for testing purposes"
127+
}
128+
}
129+
}
130+
}'
131+
```
132+
133+
**Sample Response:**
134+
```json
135+
{
136+
"workflowId": "Osdu_ingest",
137+
"runId":"5d6c4e37-ab53-4c5e-9c27-49dd77895377",
138+
"status": "In Progress",
139+
"message": "Workflow started successfully."
140+
}
141+
```
142+
Save the `runId` from the response for use as run_id in the next steps.
143+
144+
3. **Get Manifest Ingestion Workflow status**: Use the following `cURL` command to check the workflow status (replace `<run_id>` with the workflow run ID):
145+
146+
```bash
147+
curl -X GET "https://<DNS>/api/workflow/v1/workflow/Osdu_ingest/workflowRun/<run_id>" \
148+
-H "Authorization: Bearer <access_token>" \
149+
-H "data-partition-id: <data-partition-id>" \
150+
```
151+
152+
**Sample Response:**
153+
```json
154+
{
155+
"workflowId": "Osdu_ingest",
156+
"runId":"5d6c4e37-ab53-4c5e-9c27-49dd77895377",
157+
"status": "finished"
158+
}
159+
```
160+
161+
## Search for ingested data by using `cURL`
162+
163+
To search for storage metadata records created during the manifest ingestion, complete the following steps:
164+
165+
1. **Search Work Products**: Use the following `cURL` command to retrieve the work product metadata records:
166+
167+
```bash
168+
curl -X POST "https://<DNS>/api/search/v2/query" \
169+
-H "Authorization: Bearer <access_token>" \
170+
-H "data-partition-id: <data-partition-id>" \
171+
-H "Content-Type: application/json" \
172+
-d '{
173+
"kind": "osdu:wks:work-product--WorkProduct:1.0.0",
174+
"query": "id:\"<data-partition-id>:work-product--WorkProduct:feb22:1<randomIdWP>\""
175+
}'
176+
```
177+
178+
**Sample Response:**
179+
```json
180+
{
181+
"results": [
182+
{
183+
"id": "<data-partition-id>:work-product--WorkProduct:feb22:1<randomIdWP>",
184+
"kind": "osdu:wks:work-product--WorkProduct:1.0.0",
185+
"data": {
186+
"name": "Sample Work Product",
187+
"description": "Description of the work product."
188+
}
189+
}
190+
]
191+
}
192+
```
193+
194+
2. **Search Work Product Components**: Use the following `cURL` command to retrieve the WPC metadata records:
195+
196+
```bash
197+
curl -X POST "https://<DNS>/api/search/v2/query" \
198+
-H "Authorization: Bearer <access_token>" \
199+
-H "data-partition-id: <data-partition-id>" \
200+
-H "Content-Type: application/json" \
201+
-d '{
202+
"kind": "osdu:wks:work-product-component--WellboreMarkerSet:1.0.0",
203+
"query": "id:\"<data-partition-id>:work-product-component--WellboreMarkerSet:feb22:1<randomIdWPC>\""
204+
}'
205+
```
206+
207+
**Sample Response:**
208+
```json
209+
{
210+
"results": [
211+
{
212+
"id": "<data-partition-id>:work-product-component--WellboreMarkerSet:feb22:1<randomIdWPC>",
213+
"kind": "osdu:wks:work-product-component--WellboreMarkerSet:1.0.0",
214+
"data": {
215+
"name": "Sample WPC",
216+
"description": "Description of the work product component."
217+
}
218+
}
219+
]
220+
}
221+
```
222+
223+
3. **Search for Dataset**: Use the following `cURL` command to retrieve the dataset metadata records:
224+
225+
```bash
226+
curl -X POST "https://<DNS>/api/search/v2/query" \
227+
-H "Authorization: Bearer <access_token>" \
228+
-H "data-partition-id: <data-partition-id>" \
229+
-H "Content-Type: application/json" \
230+
-d '{
231+
"kind": "osdu:wks:dataset--File.Generic:1.0.0",
232+
"query": "id:\"<data-partition-id>:dataset--File.Generic:feb22:1<randomIdDataset>\""
233+
}'
234+
```
235+
236+
**Sample Response:**
237+
```json
238+
{
239+
"results": [
240+
{
241+
"id": "<data-partition-id>:dataset--File.Generic:feb22:1<randomIdDataset>",
242+
"kind": "osdu:wks:dataset--File.Generic:1.0.0",
243+
"data": {
244+
"name": "Sample Dataset",
245+
"description": "Description of the dataset."
246+
}
247+
}
248+
]
249+
}
250+
```
251+
252+
4. **Search for Master data**: Use the following `cURL` command to retrieve the master metadata records:
253+
254+
```bash
255+
curl -X POST "https://<DNS>/api/search/v2/query" \
256+
-H "Authorization: Bearer <access_token>" \
257+
-H "data-partition-id: <data-partition-id>" \
258+
-H "Content-Type: application/json" \
259+
-d '{
260+
"kind": "osdu:wks:master-data--Well:1.0.0",
261+
"query": "id:\"<data-partition-id>:master-data--Well:1112-<randomIdMasterData>\""
262+
}'
263+
```
264+
265+
**Sample Response:**
266+
```json
267+
{
268+
"results": [
269+
{
270+
"id": "<data-partition-id>:master-data--Well:1112-<randomIdMasterData>",
271+
"kind": "osdu:wks:master-data--Well:1.0.0",
272+
"data": {
273+
"name": "Sample Well",
274+
"description": "Description of the well."
275+
}
276+
}
277+
]
278+
}
279+
```
280+
281+
5. **Search for Reference Data**: Use the following `cURL` command to retrieve the reference metadata records:
282+
283+
```bash
284+
curl -X POST "https://<DNS>/api/search/v2/query" \
285+
-H "Authorization: Bearer <access_token>" \
286+
-H "data-partition-id: <data-partition-id>" \
287+
-H "Content-Type: application/json" \
288+
-d '{
289+
"kind": "osdu:wks:reference-data--FacilityType:1.0.0",
290+
"query": "id:\"<data-partition-id>:reference-data--FacilityType:Well-<randomIdReferenceData>\""
291+
}'
292+
```
293+
294+
**Sample Response:**
295+
```json
296+
{
297+
"results": [
298+
{
299+
"id": "<data-partition-id>:reference-data--FacilityType:Well-<randomIdReferenceData>",
300+
"kind": "osdu:wks:reference-data--FacilityType:1.0.0",
301+
"data": {
302+
"name": "Sample Facility Type",
303+
"description": "Description of the facility type."
304+
}
305+
}
306+
]
307+
}
308+
```
102309

103310
## Next step
104311

0 commit comments

Comments
 (0)