OSDU™ Storage Service
Loading Data to OSDU Platform
Whether you are loading master or reference data into OSDU, the
general process is the same. First, you must create a request body
for master or reference data. This is a json object that includes a
data
key whose value is the instance of master or reference data
that you would like the loading service to create.
Example: Load a master data instance for a Well
In this example of loading master data for a Well, you will use this modified json from the open-test-data
dataset. Save the json as a file called record.json
, and place it in your working directory.
record.json
[
{
"id": "osdu:master-data--Well:1730-TEST",
"kind": "osdu:wks:master-data--Well:1.0.0",
"acl": {
"owners": [
"data.default.viewers@osdu.example.com"
],
"viewers": [
"data.default.owners@osdu.example.com"
]
},
"meta": [
{
"kind": "osdu",
"name": "m",
"persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"L\",\"type\":\"UM\"},\"type\":\"UAD\"}",
"unitOfMeasureID": "osdu:reference-data--UnitOfMeasure:m:",
"propertyNames": [
"VerticalMeasurements[].VerticalMeasurement"
]
}
],
"data": {
"Source": "TNO",
"NameAliases": [
{
"AliasName": "OVS-08-TEST",
"AliasNameTypeID": "osdu:reference-data--AliasNameType:Well:"
},
{
"AliasName": "1730-TEST",
"AliasNameTypeID": "osdu:reference-data--AliasNameType:UWI:"
}
],
"GeoContexts": [
{
"GeoPoliticalEntityID": "osdu:master-data--GeoPoliticalEntity:Netherlands_Country:",
"GeoTypeID": "osdu:reference-data--GeoPoliticalEntityType:Country:"
},
{
"GeoPoliticalEntityID": "osdu:master-data--GeoPoliticalEntity:Groningen_Province:",
"GeoTypeID": "osdu:reference-data--GeoPoliticalEntityType:Province:"
},
{
"GeoPoliticalEntityID": "osdu:master-data--GeoPoliticalEntity:G_Quadrant:",
"GeoTypeID": "osdu:reference-data--GeoPoliticalEntityType:Quadrant:"
}
],
"SpatialLocation": {
"Wgs84Coordinates": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
6.81926091,
53.29493769
]
},
"properties": {}
}
]
}
},
"FacilityTypeID": "osdu:reference-data--FacilityType:Well:",
"FacilityOperators": [
{
"FacilityOperatorOrganisationID": "osdu:master-data--Organisation:NAM:"
}
],
"OperatingEnvironmentID": "osdu:reference-data--OperatingEnvironment:On:",
"FacilityName": "OVS-08-TEST",
"FacilityStates": [
{
"FacilityStateTypeID": "osdu:reference-data--FacilityStateType:ShutIn:"
}
],
"FacilityEvents": [
{
"FacilityEventTypeID": "osdu:reference-data--FacilityEventType:Spud:",
"EffectiveDateTime": "1973-08-09T00:00:00"
},
{
"FacilityEventTypeID": "osdu:reference-data--FacilityEventType:TDReached:",
"EffectiveDateTime": "1973-09-01T00:00:00"
}
],
"DefaultVerticalMeasurementID": "RotaryTable",
"VerticalMeasurements": [
{
"VerticalMeasurementID": "RotaryTable",
"VerticalMeasurement": 5.42,
"VerticalMeasurementTypeID": "osdu:reference-data--VerticalMeasurementType:RotaryTable:",
"VerticalMeasurementPathID": "osdu:reference-data--VerticalMeasurementPath:Elevation:",
"VerticalCRSID": "osdu:reference-data--CoordinateReferenceSystem:5709:"
}
]
},
"legal": {
"legaltags": [
"osdu-public-usa-dataset"
],
"otherRelevantDataCountries": [
"US"
],
"status": "compliant"
}
}
]
Perform the following steps:
- Authenticate to obtain an OIDC access token that you can use to invoke data platform services within your Adoption Catalyst. You can either use a standard OAuth flow, or log into your Adoption Deployment Console and use the "Copy Token" feature accessible from your username at the upper right of the console.
- Invoke the following
curl
command to start the loading process:
# Configure your Deployment Parameters
# replace with your OIDC access token value
# you can copy it to clipboard from Adoption Catalyst Console
# if so, strip the leading "bearer ", as commands below assume token only
export ACCESS_TOKEN="<access_token_value>"
# replace with URL for your 47Lining Adoption Catalyst, including https://
export ADOPTION_CATALYST_URL=<value>
curl \
-H 'authorization: Bearer '"$ACCESS_TOKEN"'' \
-H "Content-Type:application/json" \
-H "data-partition-id:osdu" \
-T record.json \
$ADOPTION_CATALYST_URL/api/storage/v2/records
Upon successful execution the OSDU Loading Service will return a json object response similar to:
{
"recordCount":1,"recordIds":["osdu:master-data--Well:1730-TEST"],"skippedRecordIds":[],"recordIdVersions":["osdu:master-data--Well:1730-TEST:1646263389966773"]
}
OSDU Forum Community References: Storage Documentation