osducli 0.0.48__py3-none-any.whl → 0.0.50__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osducli/VERSION +1 -1
- osducli/commands/wbdutil/config_file.py +19 -2
- osducli/commands/wbdutil/download.py +6 -4
- osducli/commands/wbdutil/ingest/data.py +4 -2
- osducli/commands/wbdutil/ingest/wellbore.py +4 -2
- osducli/commands/wbdutil/list/curves.py +1 -1
- osducli/commands/wbdutil/parse/convert.py +4 -2
- osducli/commands/wellbore_ddms/_const.py +9 -0
- osducli/commands/wellbore_ddms/log_recognition/__init__.py +13 -0
- osducli/commands/wellbore_ddms/log_recognition/family.py +37 -0
- osducli/commands/wellbore_ddms/log_recognition/upload_catalog.py +40 -0
- osducli/commands/wellbore_ddms/ppfgdataset/__init__.py +13 -0
- osducli/commands/wellbore_ddms/ppfgdataset/add.py +42 -0
- osducli/commands/wellbore_ddms/ppfgdataset/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/ppfgdataset/data/add.py +40 -0
- osducli/commands/wellbore_ddms/ppfgdataset/data/get.py +44 -0
- osducli/commands/wellbore_ddms/ppfgdataset/delete.py +35 -0
- osducli/commands/wellbore_ddms/ppfgdataset/get.py +35 -0
- osducli/commands/wellbore_ddms/ppfgdataset/session/__init__.py +13 -0
- osducli/commands/wellbore_ddms/ppfgdataset/session/create.py +35 -0
- osducli/commands/wellbore_ddms/ppfgdataset/session/get.py +36 -0
- osducli/commands/wellbore_ddms/ppfgdataset/session/list.py +35 -0
- osducli/commands/wellbore_ddms/ppfgdataset/session/send.py +41 -0
- osducli/commands/wellbore_ddms/ppfgdataset/session/update.py +37 -0
- osducli/commands/wellbore_ddms/ppfgdataset/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/ppfgdataset/version/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/ppfgdataset/version/data/get.py +45 -0
- osducli/commands/wellbore_ddms/ppfgdataset/version/get.py +36 -0
- osducli/commands/wellbore_ddms/ppfgdataset/version/list.py +35 -0
- osducli/commands/wellbore_ddms/trajectory/__init__.py +13 -0
- osducli/commands/wellbore_ddms/trajectory/add.py +42 -0
- osducli/commands/wellbore_ddms/trajectory/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/trajectory/data/add.py +40 -0
- osducli/commands/wellbore_ddms/trajectory/data/get.py +44 -0
- osducli/commands/wellbore_ddms/trajectory/delete.py +35 -0
- osducli/commands/wellbore_ddms/trajectory/get.py +35 -0
- osducli/commands/wellbore_ddms/trajectory/session/__init__.py +13 -0
- osducli/commands/wellbore_ddms/trajectory/session/create.py +35 -0
- osducli/commands/wellbore_ddms/trajectory/session/get.py +36 -0
- osducli/commands/wellbore_ddms/trajectory/session/list.py +35 -0
- osducli/commands/wellbore_ddms/trajectory/session/send.py +41 -0
- osducli/commands/wellbore_ddms/trajectory/session/update.py +37 -0
- osducli/commands/wellbore_ddms/trajectory/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/trajectory/version/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/trajectory/version/data/get.py +45 -0
- osducli/commands/wellbore_ddms/trajectory/version/get.py +36 -0
- osducli/commands/wellbore_ddms/trajectory/version/list.py +35 -0
- osducli/commands/wellbore_ddms/well/__init__.py +13 -0
- osducli/commands/wellbore_ddms/well/add.py +42 -0
- osducli/commands/wellbore_ddms/well/delete.py +35 -0
- osducli/commands/wellbore_ddms/well/get.py +35 -0
- osducli/commands/wellbore_ddms/well/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/well/version/get.py +36 -0
- osducli/commands/wellbore_ddms/well/version/list.py +35 -0
- osducli/commands/wellbore_ddms/well_log/add.py +4 -4
- osducli/commands/wellbore_ddms/well_log/data/__init__.py +1 -1
- osducli/commands/wellbore_ddms/well_log/data/add.py +5 -5
- osducli/commands/wellbore_ddms/well_log/data/get.py +5 -5
- osducli/commands/wellbore_ddms/well_log/data/statistics.py +36 -0
- osducli/commands/wellbore_ddms/well_log/delete.py +35 -0
- osducli/commands/wellbore_ddms/well_log/get.py +5 -5
- osducli/commands/wellbore_ddms/well_log/session/__init__.py +13 -0
- osducli/commands/wellbore_ddms/well_log/session/create.py +35 -0
- osducli/commands/wellbore_ddms/well_log/session/get.py +36 -0
- osducli/commands/wellbore_ddms/well_log/session/list.py +35 -0
- osducli/commands/wellbore_ddms/well_log/session/send.py +41 -0
- osducli/commands/wellbore_ddms/well_log/session/update.py +37 -0
- osducli/commands/wellbore_ddms/well_log/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/well_log/version/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/well_log/version/data/get.py +45 -0
- osducli/commands/wellbore_ddms/well_log/version/data/statistics.py +37 -0
- osducli/commands/wellbore_ddms/well_log/version/data/update_stats.py +36 -0
- osducli/commands/wellbore_ddms/well_log/version/get.py +36 -0
- osducli/commands/wellbore_ddms/well_log/version/list.py +35 -0
- osducli/commands/wellbore_ddms/wellbore/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellbore/add.py +42 -0
- osducli/commands/wellbore_ddms/wellbore/delete.py +35 -0
- osducli/commands/wellbore_ddms/wellbore/get.py +35 -0
- osducli/commands/wellbore_ddms/wellbore/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellbore/version/get.py +36 -0
- osducli/commands/wellbore_ddms/wellbore/version/list.py +35 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/add.py +44 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/delete.py +37 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/get.py +37 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/version/get.py +38 -0
- osducli/commands/wellbore_ddms/wellbore_intervalset/version/list.py +37 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/add.py +42 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/delete.py +35 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/get.py +35 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/version/get.py +36 -0
- osducli/commands/wellbore_ddms/wellbore_markerset/version/list.py +35 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/__init__.py +13 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/add.py +42 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/delete.py +35 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/get.py +35 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/version/get.py +36 -0
- osducli/commands/wellbore_ddms/welllog_acquisition/version/list.py +35 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/add.py +44 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/data/add.py +42 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/data/get.py +46 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/delete.py +37 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/get.py +37 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/create.py +37 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/get.py +38 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/list.py +37 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/send.py +43 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/update.py +39 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/data/__init__.py +13 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/data/get.py +47 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/get.py +38 -0
- osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/list.py +37 -0
- osducli/wbddms_client.py +160 -27
- {osducli-0.0.48.dist-info → osducli-0.0.50.dist-info}/METADATA +10 -1
- osducli-0.0.50.dist-info/RECORD +242 -0
- osducli-0.0.48.dist-info/RECORD +0 -135
- {osducli-0.0.48.dist-info → osducli-0.0.50.dist-info}/WHEEL +0 -0
- {osducli-0.0.48.dist-info → osducli-0.0.50.dist-info}/entry_points.txt +0 -0
- {osducli-0.0.48.dist-info → osducli-0.0.50.dist-info}/licenses/LICENSE.md +0 -0
- {osducli-0.0.48.dist-info → osducli-0.0.50.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement add data command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Add Wellpressure Test Raw Measurement data")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to add data to", required=True)
|
|
25
|
+
@click.option("-f", "--file", "_file", help="Wellpressure Test Raw Measurement data file to add", required=True)
|
|
26
|
+
@handle_cli_exceptions
|
|
27
|
+
@command_with_output("recordIds")
|
|
28
|
+
def _click_command(state: State, _id: str, _file: str):
|
|
29
|
+
return add_data(state, _id, _file)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def add_data(state: State, record_id: str, data_file: str):
|
|
33
|
+
"""Wellpressure Test Raw Measurement add data"""
|
|
34
|
+
client = CliOsduClient(state.config)
|
|
35
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
36
|
+
|
|
37
|
+
with open(data_file, 'rb') as file:
|
|
38
|
+
file_data = file.read()
|
|
39
|
+
|
|
40
|
+
response = wellbore_client.create_wbddms_data(record_id, file_data)
|
|
41
|
+
client.check_status_code(response)
|
|
42
|
+
return response.json()
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement get data command"""
|
|
13
|
+
import os
|
|
14
|
+
|
|
15
|
+
import click
|
|
16
|
+
|
|
17
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
18
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
19
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
20
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# click entry point
|
|
25
|
+
@click.command(cls=CustomClickCommand, help="Get Wellpressure Test Raw Measurement data by id")
|
|
26
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
27
|
+
@click.option("-f", "--file", "_file", help="File to save Wellpressure Test Raw Measurement data", required=True)
|
|
28
|
+
@handle_cli_exceptions
|
|
29
|
+
@command_with_output()
|
|
30
|
+
def _click_command(state: State, _id: str, _file: str):
|
|
31
|
+
return get_data(state, _id, _file)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def get_data(state: State, record_id: str, out_file: str):
|
|
35
|
+
"""Get Wellpressure Test Raw Measurement data by id"""
|
|
36
|
+
client = CliOsduClient(state.config)
|
|
37
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
38
|
+
response = wellbore_client.get_wbddms_data(record_id)
|
|
39
|
+
client.check_status_code(response)
|
|
40
|
+
|
|
41
|
+
with open(out_file, 'wb') as file:
|
|
42
|
+
file.write(response.content)
|
|
43
|
+
|
|
44
|
+
filename = os.path.abspath(file.name)
|
|
45
|
+
print("File created: ", filename)
|
|
46
|
+
return filename
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement delete record command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Delete record from wellbore ddms by id. The API performs a soft delete.")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to delete", required=True)
|
|
25
|
+
@handle_cli_exceptions
|
|
26
|
+
@command_with_output()
|
|
27
|
+
def _click_command(state: State, _id: str):
|
|
28
|
+
return delete_record(state, _id)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def delete_record(state: State, record_id: str):
|
|
32
|
+
"""Delete record from wellbore ddms by id. The API performs a soft delete."""
|
|
33
|
+
client = CliOsduClient(state.config)
|
|
34
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
35
|
+
response = wellbore_client.delete_wbddms_record(record_id)
|
|
36
|
+
client.check_status_code(response)
|
|
37
|
+
return response.json()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement get record command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Get Wellpressure Test Raw Measurement record by id")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
25
|
+
@handle_cli_exceptions
|
|
26
|
+
@command_with_output()
|
|
27
|
+
def _click_command(state: State, _id: str):
|
|
28
|
+
return get_record(state, _id)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def get_record(state: State, record_id: str):
|
|
32
|
+
"""Get Wellpressure Test Raw Measurement record by id"""
|
|
33
|
+
client = CliOsduClient(state.config)
|
|
34
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
35
|
+
response = wellbore_client.get_wbddms_record(record_id)
|
|
36
|
+
client.check_status_code(response)
|
|
37
|
+
return response.json()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
"""Wellbore DDMS Wellpressure Test Raw Measurement session commands"""
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement create session command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Create a new session on the given Wellpressure Test Raw Measurement")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
25
|
+
@handle_cli_exceptions
|
|
26
|
+
@command_with_output()
|
|
27
|
+
def _click_command(state: State, _id: str):
|
|
28
|
+
return create_session(state, _id)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def create_session(state: State, record_id: str):
|
|
32
|
+
"""Create a new session on the given Wellpressure Test Raw Measurement"""
|
|
33
|
+
client = CliOsduClient(state.config)
|
|
34
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
35
|
+
response = wellbore_client.create_wbddms_session(record_id)
|
|
36
|
+
client.check_status_code(response)
|
|
37
|
+
return response.json()
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement get session command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Get Wellpressure Test Raw Measurement session")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
25
|
+
@click.option("-s", "--session", "_ses", help="Wellpressure Test Raw Measurement session id to search for", required=True)
|
|
26
|
+
@handle_cli_exceptions
|
|
27
|
+
@command_with_output()
|
|
28
|
+
def _click_command(state: State, _id: str, _ses: str):
|
|
29
|
+
return get_session(state, _id, _ses)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_session(state: State, record_id: str, session_id: str):
|
|
33
|
+
"""Get Wellpressure Test Raw Measurement session"""
|
|
34
|
+
client = CliOsduClient(state.config)
|
|
35
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
36
|
+
response = wellbore_client.get_wbddms_session(record_id, session_id)
|
|
37
|
+
client.check_status_code(response)
|
|
38
|
+
return response.json()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement list session command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="List session of the given Wellpressure Test Raw Measurement")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
25
|
+
@handle_cli_exceptions
|
|
26
|
+
@command_with_output()
|
|
27
|
+
def _click_command(state: State, _id: str):
|
|
28
|
+
return get_versions(state, _id)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def get_versions(state: State, record_id: str):
|
|
32
|
+
"""List session of the given Wellpressure Test Raw Measurement"""
|
|
33
|
+
client = CliOsduClient(state.config)
|
|
34
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
35
|
+
response = wellbore_client.list_wbddms_session(record_id)
|
|
36
|
+
client.check_status_code(response)
|
|
37
|
+
return response.json()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement send data chunk command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Send a data chunk within a session")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to append chunk", required=True)
|
|
25
|
+
@click.option("-s", "--session", "_ses", help="Wellpressure Test Raw Measurement session id to append chunk", required=True)
|
|
26
|
+
@click.option("-f", "--file", "_file", help="Wellpressure Test Raw Measurement chunk file to append", required=True)
|
|
27
|
+
@handle_cli_exceptions
|
|
28
|
+
@command_with_output()
|
|
29
|
+
def _click_command(state: State, _id: str, _ses: str, _file: str):
|
|
30
|
+
return send_chunk(state, _id, _ses, _file)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def send_chunk(state: State, record_id: str, session_id: str, data_file: str):
|
|
34
|
+
"""Send a data chunk within a session"""
|
|
35
|
+
client = CliOsduClient(state.config)
|
|
36
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
37
|
+
|
|
38
|
+
with open(data_file, 'rb') as file:
|
|
39
|
+
file_data = file.read()
|
|
40
|
+
|
|
41
|
+
response = wellbore_client.add_wbddms_data_chunk(record_id, session_id, file_data)
|
|
42
|
+
client.check_status_code(response)
|
|
43
|
+
return response.json()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement update session command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Update a session, either commit or abandon")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to update", required=True)
|
|
25
|
+
@click.option("-s", "--session", "_ses", help="Wellpressure Test Raw Measurement session id to update", required=True)
|
|
26
|
+
@click.option("-a", "--abandon", "_aba", is_flag=True, help="Abandon session. Will commit session if flag is omitted", required=False)
|
|
27
|
+
@handle_cli_exceptions
|
|
28
|
+
@command_with_output()
|
|
29
|
+
def _click_command(state: State, _id: str, _ses: str, _aba: bool):
|
|
30
|
+
return update_session(state, _id, _ses, _aba)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def update_session(state: State, record_id: str, session_id: str, abandon: bool = False):
|
|
34
|
+
"""Update a session, either commit or abandon"""
|
|
35
|
+
client = CliOsduClient(state.config)
|
|
36
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
37
|
+
response = wellbore_client.update_wbddms_session(record_id, session_id, abandon)
|
|
38
|
+
client.check_status_code(response)
|
|
39
|
+
return response.json()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
"""Wellbore DDMS Wellpressure Test Raw Measurement version commands"""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
|
|
13
|
+
"""Wellbore DDMS Wellpressure Test Raw Measurement version data commands"""
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement get version data command"""
|
|
13
|
+
import os
|
|
14
|
+
|
|
15
|
+
import click
|
|
16
|
+
|
|
17
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
18
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
19
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
20
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# click entry point
|
|
25
|
+
@click.command(cls=CustomClickCommand, help="Get Wellpressure Test Raw Measurement data by id and version")
|
|
26
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
27
|
+
@click.option("-v", "--version", "_ver", help="Wellpressure Test Raw Measurement version to search for", required=True)
|
|
28
|
+
@click.option("-f", "--file", "_file", help="File to save Wellpressure Test Raw Measurement data", required=True)
|
|
29
|
+
@handle_cli_exceptions
|
|
30
|
+
@command_with_output()
|
|
31
|
+
def _click_command(state: State, _id: str, _ver: str, _file: str):
|
|
32
|
+
return get_data(state, _id, _ver, _file)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_data(state: State, record_id: str, version_id: str, out_file: str):
|
|
36
|
+
"""Get Wellpressure Test Raw Measurement data by id and version"""
|
|
37
|
+
client = CliOsduClient(state.config)
|
|
38
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
39
|
+
response = wellbore_client.get_wbddms_version_data(record_id, version_id)
|
|
40
|
+
client.check_status_code(response)
|
|
41
|
+
|
|
42
|
+
with open(out_file, 'wb') as file:
|
|
43
|
+
file.write(response.content)
|
|
44
|
+
|
|
45
|
+
filename = os.path.abspath(file.name)
|
|
46
|
+
print("File created: ", filename)
|
|
47
|
+
return filename
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement get record version command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="Get Wellpressure Test Raw Measurement record by id and version")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
25
|
+
@click.option("-v", "--version", "_ver", help="Wellpressure Test Raw Measurement version to search for", required=True)
|
|
26
|
+
@handle_cli_exceptions
|
|
27
|
+
@command_with_output()
|
|
28
|
+
def _click_command(state: State, _id: str, _ver: str):
|
|
29
|
+
return get_record(state, _id, _ver)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_record(state: State, record_id: str, version_id: str):
|
|
33
|
+
"""Get Wellpressure Test Raw Measurement record by id and version"""
|
|
34
|
+
client = CliOsduClient(state.config)
|
|
35
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
36
|
+
response = wellbore_client.get_wbddms_record_version(record_id, version_id)
|
|
37
|
+
client.check_status_code(response)
|
|
38
|
+
return response.json()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
# you may not use this file except in compliance with the License.
|
|
3
|
+
# You may obtain a copy of the License at
|
|
4
|
+
#
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
#
|
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
# See the License for the specific language governing permissions and
|
|
11
|
+
# limitations under the License.
|
|
12
|
+
"""Wellpressure Test Raw Measurement get record versions command"""
|
|
13
|
+
import click
|
|
14
|
+
|
|
15
|
+
from osducli.click_cli import CustomClickCommand, State, command_with_output
|
|
16
|
+
from osducli.cliclient import CliOsduClient, handle_cli_exceptions
|
|
17
|
+
from osducli.commands.wellbore_ddms._const import (
|
|
18
|
+
WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# click entry point
|
|
23
|
+
@click.command(cls=CustomClickCommand, help="List Wellpressure Test Raw Measurement record versions by id")
|
|
24
|
+
@click.option("-id", "--id", "_id", help="Wellpressure Test Raw Measurement id to search for", required=True)
|
|
25
|
+
@handle_cli_exceptions
|
|
26
|
+
@command_with_output()
|
|
27
|
+
def _click_command(state: State, _id: str):
|
|
28
|
+
return get_versions(state, _id)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def get_versions(state: State, record_id: str):
|
|
32
|
+
"""Get Wellpressure Test Raw Measurement record versions by id"""
|
|
33
|
+
client = CliOsduClient(state.config)
|
|
34
|
+
wellbore_client = client.get_wellbore_ddms_client(url_extra_path=WELLBORE_DDMS_WELLPRESSURE_TEST_RAW_MEASUREMENT_PATH)
|
|
35
|
+
response = wellbore_client.get_wbddms_record_versions(record_id)
|
|
36
|
+
client.check_status_code(response)
|
|
37
|
+
return response.json()
|