Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Loading
Wellbore DDMS Data Loader
Commits
75154da6
Commit
75154da6
authored
May 09, 2022
by
Ritika Kaushal
Browse files
added property for csp prefix for services
parent
18a4e5fa
Pipeline
#107460
failed with stages
in 2 minutes and 2 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/example_opendes_configuration.json
View file @
75154da6
{
"base_url"
:
"https://osdu-ship.msft-osdu-test.org"
,
"csp_base_url_prefix"
:
"no"
,
"data_partition_id"
:
"opendes"
,
"csp_prefix_wellbore_service"
:
"osdu-wellbore"
,
"csp_prefix_search_service"
:
"osdu-search"
,
"data_partition_id"
:
"opendes"
,
"legal"
:
{
"legaltags"
:
[
"opendes-public-usa-dataset-7643990"
],
"otherRelevantDataCountries"
:
[
"US"
],
...
...
src/wbdutil/commands/ingest.py
View file @
75154da6
...
...
@@ -30,7 +30,7 @@ def wellbore(
config
=
Configuration
(
LocalFileLoader
(),
config_path
)
las_parser
=
LasParser
(
LocalFileLoader
())
client
=
OsduClient
(
config
.
base_url
,
token
,
config
.
data_partition_id
,
config
.
csp_base_url_prefix
)
client
=
OsduClient
(
config
.
base_url
,
token
,
config
.
data_partition_id
,
config
.
csp_base_url_prefix
,
config
.
csp_prefix_wellbore_service
,
config
.
csp_prefix_search_service
)
service
=
WellBoreService
(
client
,
WellLogService
(
client
))
failed_ingests
=
[]
...
...
src/wbdutil/common/configuration.py
View file @
75154da6
...
...
@@ -80,3 +80,21 @@ class Configuration:
rtype: str
"""
return
self
.
_config
.
get
(
"csp_base_url_prefix"
)
@
property
def
csp_prefix_wellbore_service
(
self
)
->
str
:
"""
Gets the csp_prefix_wellbore_service.
return: the csp prefix for wellbore search
rtype: str
"""
return
self
.
_config
.
get
(
"csp_prefix_wellbore_service"
)
@
property
def
csp_prefix_search_service
(
self
)
->
str
:
"""
Gets the csp_prefix_ search service.
return: the csp prefix for search service
rtype: str
"""
return
self
.
_config
.
get
(
"csp_prefix_search_service"
)
src/wbdutil/wrapper/osdu_client.py
View file @
75154da6
...
...
@@ -26,7 +26,7 @@ class DataLoaderWebResponseError(Exception):
class
OsduClient
:
def
__init__
(
self
,
base_url
:
str
,
access_token
:
str
,
data_partition_id
:
str
,
csp_base_url_prefix
:
str
)
->
None
:
def
__init__
(
self
,
base_url
:
str
,
access_token
:
str
,
data_partition_id
:
str
,
csp_base_url_prefix
:
str
,
csp_prefix_wellbore_service
:
str
,
csp_prefix_search_service
:
str
)
->
None
:
"""
Create a new instance of a OsduClient
...
...
@@ -38,6 +38,9 @@ class OsduClient:
self
.
_base_url
=
base_url
self
.
_data_partition_id
=
data_partition_id
self
.
_csp_base_url_prefix
=
csp_base_url_prefix
self
.
_csp_prefix_wellbore_service
=
csp_prefix_wellbore_service
self
.
_csp_prefix_search_service
=
csp_prefix_search_service
def
_create_headers
(
self
)
->
Dict
[
str
,
str
]:
"""
Create a new set of auth headers for OSDU
...
...
@@ -207,8 +210,8 @@ class OsduClient:
def
_get_base_url
(
self
,
service_name
:
str
)
->
str
:
if
self
.
_csp_base_url_prefix
==
"yes"
:
if
service_name
==
"wellbore"
:
return
f
"
{
self
.
_base_url
}
/
osdu-wellbore
"
return
f
"
{
self
.
_base_url
}
/
{
self
.
_csp_prefix_wellbore_service
}
"
if
service_name
==
"search"
:
return
f
"
{
self
.
_base_url
}
/
osdu-search
"
return
f
"
{
self
.
_base_url
}
/
{
self
.
_csp_prefix_search_service
}
"
else
:
return
self
.
_base_url
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment