Commit b4f9cd4d authored by Luc Yriarte's avatar Luc Yriarte Committed by Sumra Zafar
Browse files

Slb code push

parent 443c2891
......@@ -55,7 +55,6 @@ Wellbore Data Management Services (WDMS) Open Subsurface Data Universe (OSDU) is
- osdu-core-lib-python-azure
- Client libraries for OSDU data ecosystem services
- osdu-data-ecosystem-entitlements
- osdu-data-ecosystem-search
- osdu-data-ecosystem-storage
......@@ -83,17 +82,13 @@ Wellbore Data Management Services (WDMS) Open Subsurface Data Universe (OSDU) is
source env/bin/activate
```
3. Create pip.ini (Windows) or pip.conf (MacOS and Linux) file inside the `env` directory. This allows us to set a global index url which can download packages/libraries needed from the AzDO artifacts. There are several ways to add this extra index url:
- It is also possible to use [--extra-index-url](https://pip.pypa.io/en/stable/reference/pip_install/#install-extra-index-url) parameter to specify it on the pip install cmd inline
4. Install dependencies
5. Install dependencies
```bash
pip install -r requirements.txt
```
5. Run the service
6. Run the service
```bash
# Run the service which will default to http://127.0.0.1:8080
......@@ -106,10 +101,10 @@ Wellbore Data Management Services (WDMS) Open Subsurface Data Universe (OSDU) is
If host is `127.0.0.1` or `localhost`, the dev_mode is automatically set to True.
The only significant change if dev_mode is on, is that configuration errors at startup are logged but don’t prevent the service to run, and allow to override some implementations.
The hosts for the entitlements, search and storage services have to be provided as environment variables, or on the command line.
The hosts for the search and storage services have to be provided as environment variables, or on the command line.
```bash
python main.py -e SERVICE_HOST_ENTITLEMENTS https://api.example.com/entitlements -e SERVICE_HOST_STORAGE https://api.example.com/storage -e SERVICE_HOST_SEARCH https://api.example.com/search
python main.py -e SERVICE_HOST_STORAGE https://api.example.com/storage -e SERVICE_HOST_SEARCH https://api.example.com/search
```
### Connect and Run Endpoints
......@@ -146,7 +141,6 @@ python main.py -e SERVICE_HOST_ENTITLEMENTS https://api.example.com/entitlements
- The following environment variables are required when the cloud provider is set to GCP:
- OS_WELLBORE_DDMS_DATA_PROJECT_ID: GCP Data Tenant ID
- OS_WELLBORE_DDMS_DATA_PROJECT_CREDENTIALS: path to the key file of the SA to access the data tenant
- SERVICE_HOST_ENTITLEMENTS: The Entitlements Service host
- SERVICE_HOST_SEARCH: The Search Service host
- SERVICE_HOST_STORAGE: The Storage Service host
......@@ -154,14 +148,12 @@ python main.py -e SERVICE_HOST_ENTITLEMENTS https://api.example.com/entitlements
python main.py -e CLOUD_PROVIDER gcp \
-e OS_WELLBORE_DDMS_DATA_PROJECT_ID projectid \
-e OS_WELLBORE_DDMS_DATA_PROJECT_CREDENTIALS pathtokeyfile \
-e SERVICE_HOST_ENTITLEMENTS entitlement_host \
-e SERVICE_HOST_SEARCH search_host \
-e SERVICE_HOST_STORAGE storage_host
```
- The following environment variables are required when the cloud provider is set to Azure:
- AZ_AI_INSTRUMENTATION_KEY: Azure Application Insights instrumentation key
- SERVICE_HOST_ENTITLEMENTS: The Entitlements Service host
- SERVICE_HOST_SEARCH: The Search Service host
- SERVICE_HOST_STORAGE: The Storage Service host
- SERVICE_HOST_PARTITION: The Partition Service internal host
......@@ -171,7 +163,6 @@ python main.py -e SERVICE_HOST_ENTITLEMENTS https://api.example.com/entitlements
```bash
python main.py -e CLOUD_PROVIDER az \
-e AZ_AI_INSTRUMENTATION_KEY instrumentationkey \
-e SERVICE_HOST_ENTITLEMENTS entitlement_host \
-e SERVICE_HOST_SEARCH search_host \
-e SERVICE_HOST_STORAGE storage_host \
-e SERVICE_HOST_PARTITION partition_host \
......@@ -267,17 +258,12 @@ Then access app on `http://127.0.0.1:<LOCAL_PORT>/api/os-wellbore-ddms/docs`
#### Build Image
A Personal Access Token (PAT) is required to pull all the python packages.
```bash
# Set PIP_EXTRA_URL
PIP_EXTRA_URL=https://community.opengroup.org/groups/osdu/platform/domain-data-mgmt-services/wellbore/-/packages
# Set IMAGE_TAG
IMAGE_TAG="os-wellbore-ddms:dev"
# Build Image
docker build -t=$IMAGE_TAG --rm . -f ./build/Dockerfile --build-arg PIP_EXTRA_URL=$PIP_EXTRA_URL --build-arg PIP_WHEEL_DIR=python-packages
docker build -t=$IMAGE_TAG --rm . -f ./build/dockerfile --build-arg PIP_WHEEL_DIR=python-packages
```
#### Run Image
......
......@@ -18,7 +18,7 @@
],
"log": {
"dataType": "number",
"dimension": 20,
"dimension": 1,
"family": "Gamma Ray",
"familyType": "Gamma Ray",
"format": "float32",
......
[{
"acl": {
"viewers": [
"data.default.viewers@{{datapartitionid}}.{{domain}}"
],
"owners": [
"data.default.owners@{{datapartitionid}}.{{domain}}"
]
},
"data": {
"Curves": [
{
"CurveID": "GR_ID",
"Mnemonic": "GR",
"CurveUnit": "{{datapartitionid}}:reference-data--UnitOfMeasure:m:",
"LogCurveFamilyID": "{{datapartitionid}}:reference-data--LogCurveFamily:GammaRay:"
},
{
"CurveID": "POR_ID",
"Mnemonic": "NPOR",
"CurveUnit": "{{datapartitionid}}:reference-data--UnitOfMeasure:m:",
"LogCurveFamilyID": "{{datapartitionid}}:reference-data--LogCurveFamily:NeutronPorosity:"
},
{
"CurveID": "Bulk Density",
"Mnemonic": "RHOB",
"CurveUnit": "{{datapartitionid}}:reference-data--UnitOfMeasure:m:",
"LogCurveFamilyID": "{{datapartitionid}}:reference-data--LogCurveFamily:BulkDensity:"
}
],
"WellboreId": "{{datapartitionid}}:master-data--Wellbore:{{wellboreId}}:",
"CreationDateTime": "2013-03-22T11:16:03Z",
"VerticalMeasurement": {
"VerticalMeasurement": 2680.5,
"VerticalMeasurementPathID": "{{datapartitionid}}:reference-data--VerticalMeasurementPath:MD:",
"VerticalMeasurementUnitOfMeasureID": "{{datapartitionid}}:reference-data--UnitOfMeasure:ft:"
},
"TopMeasuredDepth": 12345.6,
"BottomMeasuredDepth": 13856.25,
"Name": "{{welllogName}}",
"ExtensionProperties": {
"step": {
"unitKey": "ft",
"value": 0.1
},
"dateModified": "2013-03-22T11:16:03Z"
}
},
"id": "{{datapartitionid}}:work-product-component--WellLog:{{welllogId}}",
"kind": "osdu:wks:work-product-component--WellLog:1.0.0",
"legal": {
"legaltags": [
"{{legaltags}}"
],
"otherRelevantDataCountries": [
"US",
"FR"
]
},
"meta": [{
"kind": "Unit",
"name": "ft",
"persistableReference": "{\"scaleOffset\":{\"scale\":0.3048,\"offset\":0.0},\"symbol\":\"ft\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}",
"propertyNames": [
"stop.value",
"elevationReference.elevationFromMsl.value",
"start.value",
"step.value",
"reference.unitKey"
],
"propertyValues": [
"ft"
]
}, {
"kind": "DateTime",
"name": "datetime",
"persistableReference": "{\"format\":\"yyyy-MM-ddTHH:mm:ssZ\",\"timeZone\":\"UTC\",\"type\":\"DTM\"}",
"propertyNames": [
"dateModified",
"dateCreated"
]
}
]
}
]
\ No newline at end of file
[
{
"acl": {
"viewers": [
"data.default.viewers@{{datapartitionid}}.{{domain}}"
],
"owners": [
"data.default.owners@{{datapartitionid}}.{{domain}}"
]
},
"data": {
"name": "{{wellName}}",
"ExtensionProperties": {
"UWI": "20-000-00000-00"
}
},
"id": "{{datapartitionid}}:master-data--Well:{{wellId}}",
"kind": "osdu:wks:master-data--Well:1.0.0",
"legal": {
"legaltags": [
"{{legaltags}}"
],
"otherRelevantDataCountries": [
"FR",
"US"
],
"status": "compliant"
}
}
]
\ No newline at end of file
[{
"acl": {
"viewers": [
"data.default.viewers@{{datapartitionid}}.{{domain}}"
],
"owners": [
"data.default.owners@{{datapartitionid}}.{{domain}}"
]
},
"id": "{{datapartitionid}}:master-data--Wellbore:{{wellboreId}}",
"kind": "osdu:wks:master-data--Wellbore:1.0.0",
"legal": {
"legaltags": [
"{{legaltags}}"
],
"otherRelevantDataCountries": [
"FR", "US"
]
},
"data": {
"ExtensionProperties": {
"airGap": {
"unitKey": "ft",
"value": 35.0
},
"country": "United States of America",
"operator": "Francois Vinyes",
"uwi": "33-089-00300-00-01",
"wellboreType": "bypass"
},
"Wgs84Coordinates": {
"features": [{
"geometry": {
"coordinates": [
[
-103.2380248,
46.8925081,
5301.0
],
[
-103.2380248,
46.8925081,
2801.0
],
[
-103.2378748,
46.892608100000004,
301.0
],
[
-103.23742477750001,
46.89270811,
-2199.0
],
[
-103.23667470999663,
46.892808120001,
-4699.0
],
[
-103.2356245974865,
46.892908130002,
-7199.0
]
],
"type": "LineString"
},
"properties": {
"name": "Newton 2-31-Lat-1"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
},
"name": "{{wellboreName}}",
"WellID": "{{datapartitionid}}:master-data--Well:{{wellId}}:"
},
"meta": [{
"kind": "Unit",
"name": "Measure depth default unit",
"persistableReference": "persistableReference",
"propertyNames": ["symbol"],
"propertyValues": ["ft"]
}
]
}
]
\ No newline at end of file
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from fastapi import APIRouter, Depends, Response, status
from fastapi import APIRouter, Depends, Response, status, Body
from app.clients.storage_service_client import get_storage_record_service
from odes_storage.models import (
......@@ -24,6 +24,7 @@ from app.model.osdu_model import Well
from app.routers.conf import REQUIRED_ROLES_READ, REQUIRED_ROLES_WRITE
from app.utils import Context
from app.utils import get_ctx
from app.utils import load_schema_example
from app.model.model_utils import to_record, from_record
......@@ -135,7 +136,7 @@ async def get_osdu_well_version(
},
)
async def post_well_osdu(
wells: List[Well], ctx: Context = Depends(get_ctx)
wells: List[Well] = Body(..., example= load_schema_example("well_v3.json")), ctx: Context = Depends(get_ctx)
) -> CreateUpdateRecordsResponse:
storage_client = await get_storage_record_service(ctx)
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from fastapi import APIRouter, Depends, status, Response
from fastapi import APIRouter, Depends, status, Response, Body
from app.clients.storage_service_client import get_storage_record_service
......@@ -25,6 +25,7 @@ from app.model.osdu_model import Wellbore
from app.routers.conf import REQUIRED_ROLES_READ, REQUIRED_ROLES_WRITE
from app.utils import Context
from app.utils import get_ctx
from app.utils import load_schema_example
from app.model.model_utils import to_record, from_record
......@@ -136,7 +137,7 @@ async def get_osdu_wellbore_version(
},
)
async def post_wellbore_osdu(
wellbores: List[Wellbore], ctx: Context = Depends(get_ctx)
wellbores: List[Wellbore] = Body(..., example= load_schema_example("wellbore_v3.json")), ctx: Context = Depends(get_ctx)
) -> CreateUpdateRecordsResponse:
storage_client = await get_storage_record_service(ctx)
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from fastapi import APIRouter, Depends, Response, status
from fastapi import APIRouter, Depends, Response, status, Body
from app.clients.storage_service_client import get_storage_record_service
......@@ -25,6 +25,7 @@ from app.model.osdu_model import WellLog
from app.routers.conf import REQUIRED_ROLES_READ, REQUIRED_ROLES_WRITE
from app.utils import Context
from app.utils import get_ctx
from app.utils import load_schema_example
from app.model.model_utils import to_record, from_record
......@@ -136,7 +137,7 @@ async def get_osdu_welllog_version(
},
)
async def post_welllog_osdu(
welllogs: List[WellLog], ctx: Context = Depends(get_ctx)
welllogs: List[WellLog]= Body(..., example= load_schema_example("wellLog_v3.json")), ctx: Context = Depends(get_ctx)
) -> CreateUpdateRecordsResponse:
storage_client = await get_storage_record_service(ctx)
......
......@@ -14,8 +14,7 @@
from typing import List
from fastapi import APIRouter, Depends
from odes_search.models import Point
from odes_search.models import Point, CursorQueryResponse
from app.routers.conf import REQUIRED_ROLES_READ
from app.utils import Context
import app.routers.search.search as search
......@@ -35,7 +34,8 @@ def get_ctx() -> Context:
@router.post('/fastquery/wellbores', summary="Query with cursor",
description="""Get all Wellbores IDs object. <p>The wellbore kind is
*:wks:wellbore:* returns all records IDs IDs directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ))
*:wks:wellbore:* returns all records IDs IDs directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_wellbores(body: search.SearchQuery = None, ctx: Context = Depends(get_ctx)):
return await search.basic_query_request(query_type, wellbore_kind, ctx, body.query)
......@@ -44,7 +44,8 @@ async def fastquery_wellbores(body: search.SearchQuery = None, ctx: Context = De
description="""Get all Wellbores IDs IDs objects in a specific area. <p>The specific area will be define by a circle
based on its center coordinates (lat, lon) and radius (meters) </p>
<p>The wellbore kind is *:wks:wellbore:* returns all records IDs IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_wellbores_bydistance(latitude: float, longitude: float, distance: int, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
spatial_filter = search.query_spatial_filter_builder("bydistance", latitude1=latitude, longitude1=longitude,
......@@ -56,7 +57,8 @@ async def fastquery_wellbores_bydistance(latitude: float, longitude: float, dist
description="""Get all Wellbores IDs objects in a specific area. <p>The specific area will be define by a square
based on its top left coordinates (lat, lon) and its bottom right coordinates (log, lat) </p>
<p>The wellbore kind is *:wks:wellbore:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_wellbores_byboundingbox(latitude_top_left: float, longitude_top_left: float,
latitude_bottom_right: float, longitude_bottom_right: float,
body: search.SearchQuery = None, ctx: Context = Depends(get_ctx)):
......@@ -71,7 +73,8 @@ async def fastquery_wellbores_byboundingbox(latitude_top_left: float, longitude_
description="""Get all Wellbores IDs objects in a specific area. <p>The specific area will be define by a
polygon based on each of its coordinates (lat, lon) with a minimum of three</p>
<p>The wellbore kind is *:wks:wellbore:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_wellbores_bygeopolygon(points: List[Point], query: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
spatial_filter = search.query_spatial_filter_builder("bygeopolygon", points=points)
......@@ -83,7 +86,8 @@ async def fastquery_wellbores_bygeopolygon(points: List[Point], query: search.Se
description="""Get all LogSets IDs objects using its relationship Wellbore ID. <p>All LogSets linked to this
specific ID will be returned</p>
<p>The LogSet kind is *:wks:logSet:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logsets_bywellbore(wellbore_id: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
query = search.added_query(wellbore_id, "wellbore", body.query)
......@@ -95,7 +99,8 @@ async def fastquery_logsets_bywellbore(wellbore_id: str, body: search.SearchQuer
description="""Get all LogSets IDs objects using a specific attribute of Wellbores. <p>All LogSets linked to Wellbores
with this specific attribute will be returned</p>
<p>The LogSet kind is *:wks:logSet:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logsets_bywellboreattribute(wellbore_attribute: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
return await search.query_request_with_specific_attribute(query_type, wellbore_attribute, wellbore_kind,
......@@ -105,7 +110,8 @@ async def fastquery_logsets_bywellboreattribute(wellbore_attribute: str, body: s
@router.post('/fastquery/logs', summary='Query with cursor, gets logs',
description="""Get all Logs object. <p>The Logs kind is
*:wks:log:* returns all records IDs directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ))
*:wks:log:* returns all records IDs directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logs(body: search.SearchQuery = None, ctx: Context = Depends(get_ctx)):
return await search.basic_query_request(query_type, log_kind, ctx, body.query)
......@@ -114,7 +120,8 @@ async def fastquery_logs(body: search.SearchQuery = None, ctx: Context = Depends
description="""Get all Logs IDs objects using its relationship Wellbore ID. <p>All Logs linked to this
specific ID will be returned</p>
<p>The Log kind is *:wks:log:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logs_bywellbore(wellbore_id: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
query = search.added_query(wellbore_id, "wellbore", body.query)
......@@ -126,7 +133,8 @@ async def fastquery_logs_bywellbore(wellbore_id: str, body: search.SearchQuery =
description="""Get all Logs IDs objects using a specific attribute of Wellbores. <p>All Logs linked to Wellbores
with this specific attribute will be returned</p>
<p>The Log kind is *:wks:log:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logs_bywellboreattribute(wellbore_attribute: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
return await search.query_request_with_specific_attribute(query_type, wellbore_attribute, wellbore_kind, log_kind,
......@@ -138,7 +146,8 @@ async def fastquery_logs_bywellboreattribute(wellbore_attribute: str, body: sear
description="""Get all Logs IDs objects using its relationship Logset ID. <p>All Logs linked to this
specific ID will be returned</p>
<p>The Log kind is *:wks:log:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logs_bylogset(logset_id: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
query = search.added_query(logset_id, "logSet", body.query)
......@@ -150,7 +159,8 @@ async def fastquery_logs_bylogset(logset_id: str, body: search.SearchQuery = Non
description="""Get all Logs IDs objects using a specific attribute of LogSets. <p>All Logs linked to LogSets
with this specific attribute will be returned</p>
<p>The Log kind is *:wks:log:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_logs_bylogsetattribute(logset_attribute: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
return await search.query_request_with_specific_attribute(query_type, logset_attribute, logSet_kind, log_kind,
......@@ -162,7 +172,9 @@ async def fastquery_logs_bylogsetattribute(logset_attribute: str, body: search.S
summary='Query with cursor, search markers IDs by wellbore ID',
description="""Get all Markers IDs objects using its relationship Wellbore ID. <p>All Markers linked to this
specific ID will be returned</p>
<p>The Marker kind is *:wks:marker:* returns all records IDs directly based on existing schemas</p>""")
<p>The Marker kind is *:wks:marker:* returns all records IDs directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def fastquery_markers_bywellbore(wellbore_id: str, body: search.SearchQuery = None,
ctx: Context = Depends(get_ctx)):
query = search.added_query(wellbore_id, "wellbore", body.query)
......
......@@ -160,7 +160,7 @@ def added_query(id: str, data_type: str, query: str = None):
return query
@router.post('/query', summary='Query', description="{}".format(REQUIRED_ROLES_READ))
@router.post('/query', summary='Query', description="{}".format(REQUIRED_ROLES_READ), response_model=QueryResponse)
async def query(query_request: QueryRequest,
ctx: Context = Depends(get_ctx)) -> QueryResponse:
client = await get_search_service(ctx)
......@@ -168,7 +168,7 @@ async def query(query_request: QueryRequest,
query_request=query_request)
@router.post('/query_with_cursor', summary='Query with cursor', description="{}".format(REQUIRED_ROLES_READ))
@router.post('/query_with_cursor', summary='Query with cursor', description="{}".format(REQUIRED_ROLES_READ), response_model=CursorQueryResponse)
async def query_with_cursor(query_request: QueryRequest,
ctx: Context = Depends(get_ctx)):
client = await get_search_service(ctx)
......@@ -180,7 +180,8 @@ async def query_with_cursor(query_request: QueryRequest,
@router.post('/query/wellbores', summary='Query with cursor',
description="""Get all Wellbores object. <p>The wellbore kind is
*:wks:wellbore:* returns all records directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ))
*:wks:wellbore:* returns all records directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_wellbores(body: SearchQuery = None, ctx: Context = Depends(get_ctx)):
return await basic_query_request_with_cursor(query_type, wellbore_kind, ctx, body.query)
......@@ -189,7 +190,8 @@ async def query_wellbores(body: SearchQuery = None, ctx: Context = Depends(get_c
description="""Get all Wellbores object in a specific area. <p>The specific area will be define by a circle
based on its center coordinates (lat, lon) and radius (meters) </p>
<p>The wellbore kind is *:wks:wellbore:* returns all records directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_wellbores_bydistance(latitude: float, longitude: float, distance: int, body: SearchQuery = None,
ctx: Context = Depends(get_ctx)):
spatial_filter = query_spatial_filter_builder("bydistance", latitude1=latitude, longitude1=longitude,
......@@ -201,7 +203,8 @@ async def query_wellbores_bydistance(latitude: float, longitude: float, distance
description="""Get all Wellbores object in a specific area. <p>The specific area will be define by a square
based on its top left coordinates (lat, lon) and its bottom right coordinates (log, lat) </p>
<p>The wellbore kind is *:wks:wellbore:* returns all records directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_wellbores_byboundingbox(latitude_top_left: float, longitude_top_left: float,
latitude_bottom_right: float, longitude_bottom_right: float,
body: SearchQuery = None, ctx: Context = Depends(get_ctx)):
......@@ -215,7 +218,8 @@ async def query_wellbores_byboundingbox(latitude_top_left: float, longitude_top_
description="""Get all Wellbores object in a specific area. <p>The specific area will be define by a
polygon based on each of its coordinates (lat, lon) with a minimum of three</p>
<p>The wellbore kind is *:wks:wellbore:* returns all records directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_wellbores_bygeopolygon(points: List[Point], query: SearchQuery = None,
ctx: Context = Depends(get_ctx)):
spatial_filter = query_spatial_filter_builder("bygeopolygon", points=points)
......@@ -226,7 +230,8 @@ async def query_wellbores_bygeopolygon(points: List[Point], query: SearchQuery =
description="""Get all LogSets object using its relationship Wellbore ID. <p>All LogSets linked to this
specific ID will be returned</p>
<p>The LogSet kind is *:wks:logSet:* returns all records directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_logsets_bywellbore(wellboreId: str, body: SearchQuery = None,
ctx: Context = Depends(get_ctx)):
query = added_query(wellboreId, "wellbore", body.query)
......@@ -238,7 +243,8 @@ async def query_logsets_bywellbore(wellboreId: str, body: SearchQuery = None,
description="""Get all LogSets object using a specific attribute of Wellbores. <p>All LogSets linked to Wellbores
with this specific attribute will be returned</p>
<p>The LogSet kind is *:wks:logSet:* returns all records directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_logsets_bywellboreattribute(wellboreAttribute: str, body: SearchQuery = None,
ctx: Context = Depends(get_ctx)):
return await query_request_with_specific_attribute(query_type, wellboreAttribute, wellbore_kind, logSet_kind,
......@@ -248,7 +254,8 @@ async def query_logsets_bywellboreattribute(wellboreAttribute: str, body: Search
@router.post('/query/logs', summary='Query with cursor, gets logs',
description="""Get all Logs object. <p>The Logs kind is
*:wks:log:* returns all records directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ))
*:wks:log:* returns all records directly based on existing schemas</p>{}""".format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_logs(body: SearchQuery = None, ctx: Context = Depends(get_ctx)):
return await basic_query_request_with_cursor(query_type, log_kind, ctx, body.query)
......@@ -257,7 +264,8 @@ async def query_logs(body: SearchQuery = None, ctx: Context = Depends(get_ctx)):
description="""Get all Logs object using its relationship Wellbore ID. <p>All Logs linked to this
specific ID will be returned</p>
<p>The Log kind is *:wks:log:* returns all records directly based on existing schemas</p>{}"""
.format(REQUIRED_ROLES_READ))
.format(REQUIRED_ROLES_READ),
response_model=CursorQueryResponse)
async def query_logs_bywellbore(wellboreId: str, body: SearchQuery = None,
ctx: Context = Depends(get_ctx)):
query = added_query(wellboreId, "wellbore", body.query)
......@@ -269,7 +277,8 @@ async def query_logs_bywellbore(wellboreId: str, body: SearchQuery = None,