Skip to content

Commit 4c26b39

Browse files
Update tutorial-reservoir-ddms-apis.md
1 parent ef5cee6 commit 4c26b39

File tree

1 file changed

+232
-12
lines changed

1 file changed

+232
-12
lines changed

articles/energy-data-services/tutorial-reservoir-ddms-apis.md

Lines changed: 232 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ ms.date: 02/12/2025
1515

1616
In this article, you learn how to read data from Reservoir DDMS REST APIs with curl commands.
1717

18-
> [!IMPORTANT]
19-
> In the current release, only Reservoir DDMS read APIs are supported.
20-
2118
## Prerequisites
2219

2320
- Create an Azure Data Manager for Energy resource. See [How to create Azure Data Manager for Energy resource](quickstart-create-microsoft-energy-data-services-instance.md).
@@ -43,6 +40,218 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
4340
"commitTime": "unknown"
4441
}
4542
```
43+
1. Run the following curl command to create new dataspace.
44+
```bash
45+
curl --request POST \
46+
--url https://<adme_url>/api/reservoir-ddms/v2/dataspaces \
47+
--header 'Authorization: Bearer <access-token>' \
48+
--header 'Content-Type: application/json' \
49+
--header 'data-partition-id: <data-partition-id>' \
50+
--data '[
51+
{
52+
"DataspaceId": "<dataspace_name>",
53+
"Path": "<dataspace_name>",
54+
"CustomData": {
55+
"legaltags": ["<legal_tag_name>"],
56+
"otherRelevantDataCountries": ["<country_code1>","country_code2"],
57+
"viewers": [ "data.default.viewers@<data-partition-id>.dataservices.energy" ],
58+
"owners": [ "data.default.owners@<data-partition-id>.dataservices.energy"]
59+
}
60+
}
61+
]'
62+
```
63+
**Sample Response:**
64+
```json
65+
[
66+
"eml:///dataspace('<dataspace_name>')"
67+
]
68+
```
69+
1. Run the following curl command to start a transaction.
70+
```bash
71+
curl --request POST \
72+
--url https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<encoded_dataspace_id>/transactions \
73+
--header 'Authorization: Bearer <access-token>' \
74+
--header 'data-partition-id: <data-partition-id>'
75+
```
76+
**Sample Response:**
77+
```bash
78+
3f71e12a-7b05-41c1-851d-2c59498832d4
79+
```
80+
**Example of encoded dataspace id:**
81+
```bash
82+
Dataspace name: "demo/RestWrite"
83+
Encoded dataspace name: "demo%2FRestWrite"
84+
```
85+
86+
1. Run the following curl command to add resources using transaction id.
87+
```bash
88+
curl --request PUT \
89+
--url 'https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<encoded_dataspace_id>/resources?transactionId=<transaction_id>' \
90+
--header 'Authorization: Bearer <access-token>' \
91+
--header 'Content-Type: application/json' \
92+
--header 'data-partition-id: <data-partition-id>' \
93+
--data '[
94+
{
95+
"Citation": {
96+
"Title": "CustomTestCrs",
97+
"Originator": "dalsaab",
98+
"Creation": "2021-09-02T07:57:28.000Z",
99+
"Format": "Paradigm SKUA-GOCAD 22 Alpha 1 Build:20210830-0200 (id: origin/master|56050|1fb1cf919c2|20210827-1108) for Linux_x64_2.17_gcc91",
100+
"Editor": "dalsaab",
101+
"LastUpdate": "2021-09-06T13:30:24.000Z"
102+
},
103+
"YOffset": 6470000,
104+
"ZOffset": 0,
105+
"ArealRotation": {
106+
"_": 0,
107+
"$type": "eml20.PlaneAngleMeasure",
108+
"Uom": "rad"
109+
},
110+
"ProjectedAxisOrder": "easting northing",
111+
"ProjectedUom": "m",
112+
"VerticalUom": "m",
113+
"XOffset": 420000,
114+
"ZIncreasingDownward": true,
115+
"VerticalCrs": {
116+
"EpsgCode": 6230,
117+
"$type": "eml20.VerticalCrsEpsgCode"
118+
},
119+
"ProjectedCrs": {
120+
"EpsgCode": 23031,
121+
"$type": "eml20.ProjectedCrsEpsgCode"
122+
},
123+
"$type": "resqml20.obj_LocalDepth3dCrs",
124+
"SchemaVersion": "2.0",
125+
"Uuid": "7c7d7987-b7b9-4215-9014-cb7d6fb62173"
126+
},
127+
{
128+
"Citation": {
129+
"$type": "eml20.Citation",
130+
"Title": "Hdf Proxy",
131+
"Originator": "Mathieu",
132+
"Creation": "2014-09-09T15:33:25Z",
133+
"Format": "[F2I-CONSULTING:resqml2CppApi]"
134+
},
135+
"MimeType": "application/x-hdf5",
136+
"$type": "eml20.obj_EpcExternalPartReference",
137+
"SchemaVersion": "2.0.0.20140822",
138+
"Uuid": "68f2a7d4-f7c1-4a75-95e9-3c6a7029fb23"
139+
},
140+
{
141+
"Citation": {
142+
"Title": "Pointset 1",
143+
"Originator": "user1",
144+
"Creation": "2019-01-08T13:41:25.000Z",
145+
"Format": "Paradigm SKUA-GOCAD 22 Alpha 1 Build:20210830-0200 (id: origin/master|56050|1fb1cf919c2|20210827-1108) for Linux_x64_2.17_gcc91",
146+
"$type": "eml20.Citation"
147+
},
148+
"ExtraMetadata": [
149+
{
150+
"Name": "pdgm/dx/resqml/creatorGroup",
151+
"Value": "Interpreters",
152+
"$type": "resqml20.NameValuePair"
153+
}
154+
],
155+
"NodePatch": [
156+
{
157+
"PatchIndex": 0,
158+
"Count": 6,
159+
"Geometry": {
160+
"$type": "resqml20.PointGeometry",
161+
"LocalCrs": {
162+
"$type": "eml20.DataObjectReference",
163+
"ContentType": "application/x-resqml+xml;version=2.0;type=obj_LocalDepth3dCrs",
164+
"Title": "CustomTestCrs",
165+
"UUID": "7c7d7987-b7b9-4215-9014-cb7d6fb62173"
166+
},
167+
"Points": {
168+
"$type": "resqml20.Point3dHdf5Array",
169+
"Coordinates": {
170+
"$type": "eml20.Hdf5Dataset",
171+
"PathInHdfFile": "/RESQML/5d27775e-5c7f-4786-a048-9a303fa1165a/points_patch0",
172+
"HdfProxy": {
173+
"$type": "eml20.DataObjectReference",
174+
"ContentType": "application/x-resqml+xml;version=2.0;type=obj_EpcExternalPartReference",
175+
"UUID": "68f2a7d4-f7c1-4a75-95e9-3c6a7029fb23",
176+
"DescriptionString": "Hdf Proxy",
177+
"VersionString": "1410276805"
178+
}
179+
}
180+
}
181+
}
182+
}
183+
],
184+
"$type": "resqml20.obj_PointSetRepresentation",
185+
"SchemaVersion": "2.0.0.20140822",
186+
"Uuid": "5d27775e-5c7f-4786-a048-9a303fa1165a"
187+
}
188+
]'
189+
```
190+
**Sample Response:**
191+
```json
192+
true
193+
```
194+
1. Run the following curl command to add arrays using transaction id.
195+
```bash
196+
curl --request PUT \
197+
--url 'https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<encoded_dataspace_id>/resources/arrays?transactionId=<transaction_id>' \
198+
--header 'Authorization: Bearer <access-token>' \
199+
--header 'Content-Type: application/json' \
200+
--header 'data-partition-id: <data-partition-id>' \
201+
--data '[
202+
{
203+
"ContainerType": "eml20.obj_EpcExternalPartReference",
204+
"ContainerUuid": "68f2a7d4-f7c1-4a75-95e9-3c6a7029fb23",
205+
"PathInResource": "/RESQML/5d27775e-5c7f-4786-a048-9a303fa1165a/points_patch0",
206+
"Dimensions": [
207+
3,
208+
6
209+
],
210+
"PreferredSubarrayDimensions": [
211+
3,
212+
1
213+
],
214+
"Data": [
215+
0,0,0,
216+
1,0,0,
217+
0,1,2,
218+
1,1,2,
219+
1,0,2,
220+
1,1,1
221+
],
222+
"ArrayType": "Float32Array"
223+
}
224+
]'
225+
```
226+
**Sample Response:**
227+
```json
228+
[
229+
true
230+
]
231+
```
232+
1. Run the following curl command to commit a transaction.
233+
```bash
234+
curl --request PUT \
235+
--url https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<encoded_dataspace_id>/transactions/<transaction_id> \
236+
--header 'Authorization: Bearer <access-token>' \
237+
--header 'data-partition-id: <data-partition-id>'
238+
```
239+
**Sample Response:**
240+
```json
241+
true
242+
```
243+
1. Run the following curl command to rollback a transaction.
244+
```bash
245+
curl --request DELETE \
246+
--url https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<encoded_dataspace_id>/transactions/<transaction_id> \
247+
--header 'Authorization: Bearer <access-token>' \
248+
--header 'data-partition-id: <data-partition-id>'
249+
```
250+
**Sample Response:**
251+
```json
252+
true
253+
```
254+
46255
1. Run the following curl command to list all the dataspaces.
47256

48257
```bash
@@ -82,7 +291,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
82291
```bash
83292
curl --request GET \
84293
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources \
85-
--header 'Authorization: Bearer ey......' \
294+
--header 'Authorization: Bearer <access-token>' \
86295
--header 'data-partition-id: dp1'
87296
```
88297

@@ -152,7 +361,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
152361
```bash
153362
curl --request GET \
154363
--url https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<dataspace_name>/resources/all \
155-
--header 'Authorization: Bearer bearer' \
364+
--header 'Authorization: Bearer <access-token>' \
156365
--header 'data-partition-id: <data-partition-id>'
157366
```
158367
**Sample Response**
@@ -201,7 +410,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
201410
```bash
202411
curl --request GET \
203412
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources/resqml20.obj_Grid2dRepresentation \
204-
--header 'Authorization: Bearer ey........' \
413+
--header 'Authorization: Bearer <access-token>' \
205414
--header 'data-partition-id: dp1'
206415
```
207416
**Sample Response**
@@ -252,7 +461,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
252461
```bash
253462
curl --request GET \
254463
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources/resqml20.obj_Grid2dRepresentation/07cb9ebb-299f-469b-9792-e76633a72b89 \
255-
--header 'Authorization: Bearer ey.....' \
464+
--header 'Authorization: Bearer <access-token>' \
256465
--header 'data-partition-id: dp1'
257466
```
258467
**Sample Response**
@@ -354,7 +563,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
354563
```bash
355564
curl --request GET \
356565
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources/resqml20.obj_Grid2dRepresentation/07cb9ebb-299f-469b-9792-e76633a72b89/arrays \
357-
--header 'Authorization: Bearer ey........' \
566+
--header 'Authorization: Bearer <access-token>' \
358567
--header 'data-partition-id: dp1'
359568
```
360569
**Sample Response**
@@ -391,7 +600,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
391600
```bash
392601
curl --request GET \
393602
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources/resqml20.obj_Grid2dRepresentation/07cb9ebb-299f-469b-9792-e76633a72b89/arrays/RESQML%2F07cb9ebb-299f-469b-9792-e76633a72b89%2Fpoints_patch0 \
394-
--header 'Authorization: Bearer ey........' \
603+
--header 'Authorization: Bearer <access-token>' \
395604
--header 'data-partition-id: dp1'
396605
```
397606
**Sample Response**
@@ -435,7 +644,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
435644
```bash
436645
curl --request GET \
437646
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources/resqml20.obj_Grid2dRepresentation/07cb9ebb-299f-469b-9792-e76633a72b89/sources \
438-
--header 'Authorization: Bearer ey........' \
647+
--header 'Authorization: Bearer <access-token>' \
439648
--header 'data-partition-id: dp1'
440649
```
441650
**Sample Response**
@@ -483,7 +692,7 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
483692
```bash
484693
curl --request GET \
485694
--url https://admetest.energy.azure.com/api/reservoir-ddms/v2/dataspaces/demo%2FVolve/resources/resqml20.obj_Grid2dRepresentation/07cb9ebb-299f-469b-9792-e76633a72b89/targets \
486-
--header 'Authorization: Bearer ey........' \
695+
--header 'Authorization: Bearer <access-token>' \
487696
--header 'data-partition-id: dp1'
488697
```
489698
**Sample Response**
@@ -517,6 +726,17 @@ In this article, you learn how to read data from Reservoir DDMS REST APIs with c
517726
}
518727
]
519728
```
729+
1. Run the following curl command to delete a dataspace.
730+
```bash
731+
curl --request DELETE \
732+
--url https://<adme_url>/api/reservoir-ddms/v2/dataspaces/<encoded_dataspace_id> \
733+
--header 'Authorization: Bearer <access-token>' \
734+
--header 'data-partition-id: <data-partition-id>'
735+
```
736+
**Sample Response:**
737+
```bash
738+
739+
```
520740

521741
## Related content
522-
[Tutorial: Use Reservoir DDMS websocket API endpoints](tutorial-reservoir-ddms-websocket.md)
742+
[Tutorial: Use Reservoir DDMS websocket API endpoints](tutorial-reservoir-ddms-websocket.md)

0 commit comments

Comments
 (0)