Tutorial: Use Reservoir DDMS websocket API endpoints
Use Reservoir Domain Data Management Services (DDMS) APIs in PowerShell to work with reservoir data in an Azure Data Manager for Energy resource.
In this tutorial, you learn how to use a Reservoir DDMS websocket endpoint to:
- Create the data space.
- Get the data space.
- Ingest an EPC file.
- Access the ingested data.
- Delete the dataspace.
For more information about DDMS, see DDMS concepts.
Prerequisites
- Azure Data Manager for Energy resource created in your Azure subscription
- Docker desktop client should be running on your system
Configuration
To connect to a remote server via WSS, you need an ETP SSL enabled client. Download a prebuild SSL client from the OSDU GitLab docker container registry.
export SSLCLIENT_IMAGE=community.opengroup.org:5555/osdu/platform/domain-data-mgmt-services/reservoir/open-etp-server/open-etp-sslclient-main docker pull ${SSLCLIENT_IMAGE} docker tag ${SSLCLIENT_IMAGE} open-etp:ssl-client
Follow How to generate auth token to create a valid auth token. This token is used to authenticate the calls to server.
Set the following variables:
$RDDMS_URL='<adme_dns>/api/reservoir-ddms-etp/v2/' $PARTITION='<data_partition_name>' $TOKEN='<access_token>'
Using the websocket endpoints
Create the data space:
docker run -it --rm open-etp:ssl-client openETPServer space -S wss://${RDDMS_URL} --new -s <data_space_name> --data-partition-id ${PARTITION} --auth bearer --jwt-token ${TOKEN}
Get the data space:
docker run -it --rm open-etp:ssl-client openETPServer space -S wss://${RDDMS_URL} -l --data-partition-id ${PARTITION} --auth bearer --jwt-token ${TOKEN}
Ingest an EPC file:
docker run -it --rm -v <path_to_directory_containing_epc_file>:/data open-etp:ssl-client openETPServer space -S wss://${RDDMS_URL} -s <dataspace_name> --import-epc ./data/<epc_file_name> --data-partition-id ${PARTITION} --auth bearer --jwt-token ${TOKEN}
Access the ingested data:
docker run -it --rm open-etp:ssl-client openETPServer space -S wss://${RDDMS_URL} -s <dataspace_name> --stats --data-partition-id ${PARTITION} --auth bearer --jwt-token ${TOKEN}
Delete the dataspace:
docker run -it --rm open-etp:ssl-client openETPServer space --delete -S wss://${RDDMS_URL} -s <dataspace_name> --data-partition-id ${PARTITION} --auth bearer --jwt-token ${TOKEN}