Skip to content

Commit d4c87f8

Browse files
author
Preeti Singh
committed
fixing pds
1 parent 0041c65 commit d4c87f8

File tree

1 file changed

+275
-67
lines changed

1 file changed

+275
-67
lines changed

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

Lines changed: 275 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -20,85 +20,293 @@ 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+
* Generate the service principal access token to call the Seismic 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

3235
* 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).
3336
* For this tutorial, you need the following parameters:
3437

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.|
38+
| Parameter | Value to use | Example | Where to find this value |
39+
|----|----|----|----|
40+
| `DNS` | URI | `<instance>.energy.azure.com` | Find this value on the overview page of the Azure Data Manager for Energy instance. |
41+
| `data-partition-id` | Data partitions | `<data-partition-id>` | Find this value on the Data Partitions section within the Azure Data Manager for Energy instance. |
42+
| `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.|
4443

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

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.
46+
### Set up your environment
47+
48+
Ensure you have `cURL` installed on your system. You will use it to make API calls.
49+
50+
## Ingest sample manifests by using `cURL`
51+
52+
To ingest sample manifests into the Azure Data Manager for Energy instance, complete the following steps:
53+
54+
1. **Create a Legal Tag**: Use the following `cURL` command to create a legal tag that will be added to the manifest data for data compliance purposes:
55+
56+
```bash
57+
curl -X POST "https://<DNS>/api/legal/v1/legaltags" \
58+
-H "Authorization: Bearer <access_token>" \
59+
-H "Content-Type: application/json" \
60+
-H "data-partition-id: <data-partition-id>" \
61+
-d '{
62+
"name": "<tagName>",
63+
"description": "Legal Tag added for Well",
64+
"properties": {
65+
"contractId": "123456",
66+
"countryOfOrigin": ["US", "CA"],
67+
"dataType": "Third Party Data",
68+
"exportClassification": "EAR99",
69+
"originator": "Schlumberger",
70+
"personalData": "No Personal Data",
71+
"securityClassification": "Private",
72+
"expirationDate": "2025-12-25"
73+
}
74+
}'
75+
```
76+
77+
**Sample Response:**
78+
```json
79+
{
80+
"name": "abcd",
81+
"description": "Legal Tag added for Well",
82+
"properties": {
83+
"contractId": "123456",
84+
"countryOfOrigin": ["US", "CA"],
85+
"dataType": "Third Party Data",
86+
"exportClassification": "EAR99",
87+
"originator": "Schlumberger",
88+
"personalData": "No Personal Data",
89+
"securityClassification": "Private",
90+
"expirationDate": "2025-12-25"
91+
}
92+
}
93+
```
94+
95+
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:
96+
97+
```bash
98+
curl -X POST "https://<DNS>/api/workflow/v1/workflow/Osdu_ingest/workflowRun" \
99+
-H "Authorization: Bearer <access_token>" \
100+
-H "data-partition-id: <data-partition-id>" \
101+
-H "Content-Type: application/json" \
102+
-d '{
103+
"executionContext": {
104+
"Payload": {
105+
"AppKey": "test-app",
106+
"data-partition-id": "<data-partition-id>"
107+
},
108+
"manifest": {
109+
"kind": "osdu:wks:Manifest:1.0.0",
110+
"ReferenceData": [
111+
{
112+
"id": "osdu:wks:reference-data--FacilityType:1.0.0",
113+
"name": "FacilityType",
114+
"description": "Reference data for facility types"
115+
}
116+
],
117+
"MasterData": [
118+
{
119+
"id": "osdu:wks:master-data--Well:1.0.0",
120+
"name": "Well",
121+
"description": "Master data for wells"
122+
}
123+
],
124+
"Data": {
125+
"kind": "osdu:wks:dataset--File.Generic:1.0.0",
126+
"name": "Sample Dataset",
127+
"description": "Dataset for testing purposes"
128+
}
129+
}
130+
}
131+
}'
132+
```
133+
134+
**Sample Response:**
135+
```json
136+
{
137+
"workflowId": "Osdu_ingest",
138+
"runId":"5d6c4e37-ab53-4c5e-9c27-49dd77895377",
139+
"status": "In Progress",
140+
"message": "Workflow started successfully."
141+
}
142+
```
143+
Save the `runId` from the response for use as run_id in the next steps.
144+
145+
3. **Get Manifest Ingestion Workflow status**: Use the following `cURL` command to check the workflow status (replace `<run_id>` with the workflow run ID):
146+
147+
```bash
148+
curl -X GET "https://<DNS>/api/workflow/v1/workflow/Osdu_ingest/workflowRun/<run_id>" \
149+
-H "Authorization: Bearer <access_token>" \
150+
-H "data-partition-id: <data-partition-id>" \
151+
```
152+
153+
**Sample Response:**
154+
```json
155+
{
156+
"workflowId": "Osdu_ingest",
157+
"runId":"5d6c4e37-ab53-4c5e-9c27-49dd77895377",
158+
"status": "finished"
159+
}
160+
```
161+
162+
## Search for ingested data by using `cURL`
163+
164+
To search for storage metadata records created during the manifest ingestion, complete the following steps:
165+
166+
1. **Search Work Products**: Use the following `cURL` command to retrieve the work product metadata records:
167+
168+
```bash
169+
curl -X POST "https://<DNS>/api/search/v2/query" \
170+
-H "Authorization: Bearer <access_token>" \
171+
-H "data-partition-id: <data-partition-id>" \
172+
-H "Content-Type: application/json" \
173+
-d '{
174+
"kind": "osdu:wks:work-product--WorkProduct:1.0.0",
175+
"query": "id:\"<data-partition-id>:work-product--WorkProduct:feb22:1<randomIdWP>\""
176+
}'
177+
```
178+
179+
**Sample Response:**
180+
```json
181+
{
182+
"results": [
183+
{
184+
"id": "<data-partition-id>:work-product--WorkProduct:feb22:1<randomIdWP>",
185+
"kind": "osdu:wks:work-product--WorkProduct:1.0.0",
186+
"data": {
187+
"name": "Sample Work Product",
188+
"description": "Description of the work product."
189+
}
190+
}
191+
]
192+
}
193+
```
194+
195+
2. **Search Work Product Components**: Use the following `cURL` command to retrieve the WPC metadata records:
196+
197+
```bash
198+
curl -X POST "https://<DNS>/api/search/v2/query" \
199+
-H "Authorization: Bearer <access_token>" \
200+
-H "data-partition-id: <data-partition-id>" \
201+
-H "Content-Type: application/json" \
202+
-d '{
203+
"kind": "osdu:wks:work-product-component--WellboreMarkerSet:1.0.0",
204+
"query": "id:\"<data-partition-id>:work-product-component--WellboreMarkerSet:feb22:1<randomIdWPC>\""
205+
}'
206+
```
207+
208+
**Sample Response:**
209+
```json
210+
{
211+
"results": [
212+
{
213+
"id": "<data-partition-id>:work-product-component--WellboreMarkerSet:feb22:1<randomIdWPC>",
214+
"kind": "osdu:wks:work-product-component--WellboreMarkerSet:1.0.0",
215+
"data": {
216+
"name": "Sample WPC",
217+
"description": "Description of the work product component."
218+
}
219+
}
220+
]
221+
}
222+
```
223+
224+
3. **Search for Dataset**: Use the following `cURL` command to retrieve the dataset metadata records:
225+
226+
```bash
227+
curl -X POST "https://<DNS>/api/search/v2/query" \
228+
-H "Authorization: Bearer <access_token>" \
229+
-H "data-partition-id: <data-partition-id>" \
230+
-H "Content-Type: application/json" \
231+
-d '{
232+
"kind": "osdu:wks:dataset--File.Generic:1.0.0",
233+
"query": "id:\"<data-partition-id>:dataset--File.Generic:feb22:1<randomIdDataset>\""
234+
}'
235+
```
236+
237+
**Sample Response:**
238+
```json
239+
{
240+
"results": [
241+
{
242+
"id": "<data-partition-id>:dataset--File.Generic:feb22:1<randomIdDataset>",
243+
"kind": "osdu:wks:dataset--File.Generic:1.0.0",
244+
"data": {
245+
"name": "Sample Dataset",
246+
"description": "Description of the dataset."
247+
}
248+
}
249+
]
250+
}
251+
```
252+
253+
4. **Search for Master data**: Use the following `cURL` command to retrieve the master metadata records:
254+
255+
```bash
256+
curl -X POST "https://<DNS>/api/search/v2/query" \
257+
-H "Authorization: Bearer <access_token>" \
258+
-H "data-partition-id: <data-partition-id>" \
259+
-H "Content-Type: application/json" \
260+
-d '{
261+
"kind": "osdu:wks:master-data--Well:1.0.0",
262+
"query": "id:\"<data-partition-id>:master-data--Well:1112-<randomIdMasterData>\""
263+
}'
264+
```
265+
266+
**Sample Response:**
267+
```json
268+
{
269+
"results": [
270+
{
271+
"id": "<data-partition-id>:master-data--Well:1112-<randomIdMasterData>",
272+
"kind": "osdu:wks:master-data--Well:1.0.0",
273+
"data": {
274+
"name": "Sample Well",
275+
"description": "Description of the well."
276+
}
277+
}
278+
]
279+
}
280+
```
281+
282+
5. **Search for Reference Data**: Use the following `cURL` command to retrieve the reference metadata records:
283+
284+
```bash
285+
curl -X POST "https://<DNS>/api/search/v2/query" \
286+
-H "Authorization: Bearer <access_token>" \
287+
-H "data-partition-id: <data-partition-id>" \
288+
-H "Content-Type: application/json" \
289+
-d '{
290+
"kind": "osdu:wks:reference-data--FacilityType:1.0.0",
291+
"query": "id:\"<data-partition-id>:reference-data--FacilityType:Well-<randomIdReferenceData>\""
292+
}'
293+
```
294+
295+
**Sample Response:**
296+
```json
297+
{
298+
"results": [
299+
{
300+
"id": "<data-partition-id>:reference-data--FacilityType:Well-<randomIdReferenceData>",
301+
"kind": "osdu:wks:reference-data--FacilityType:1.0.0",
302+
"data": {
303+
"name": "Sample Facility Type",
304+
"description": "Description of the facility type."
305+
}
306+
}
307+
]
308+
}
309+
```
102310

103311
## Next step
104312

0 commit comments

Comments
 (0)