osducli 0.0.47__py3-none-any.whl → 0.0.49__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.
Files changed (142) hide show
  1. osducli/VERSION +1 -1
  2. osducli/commands/config/consts.py +1 -0
  3. osducli/commands/config/update.py +10 -0
  4. osducli/commands/storage/add.py +0 -2
  5. osducli/commands/wbdutil/__init__.py +13 -0
  6. osducli/commands/wbdutil/_const.py +16 -0
  7. osducli/commands/wbdutil/config_file.py +57 -0
  8. osducli/commands/wbdutil/download.py +40 -0
  9. osducli/commands/wbdutil/ingest/__init__.py +13 -0
  10. osducli/commands/wbdutil/ingest/data.py +39 -0
  11. osducli/commands/wbdutil/ingest/wellbore.py +39 -0
  12. osducli/commands/wbdutil/list/__init__.py +13 -0
  13. osducli/commands/wbdutil/list/curves.py +38 -0
  14. osducli/commands/wbdutil/list/wellbore.py +38 -0
  15. osducli/commands/wbdutil/list/welllog.py +38 -0
  16. osducli/commands/wbdutil/parse/__init__.py +13 -0
  17. osducli/commands/wbdutil/parse/convert.py +37 -0
  18. osducli/commands/wbdutil/parse/print.py +27 -0
  19. osducli/commands/wbdutil/search.py +36 -0
  20. osducli/commands/wbdutil/update.py +37 -0
  21. osducli/commands/wellbore_ddms/_const.py +9 -0
  22. osducli/commands/wellbore_ddms/log_recognition/__init__.py +13 -0
  23. osducli/commands/wellbore_ddms/log_recognition/family.py +37 -0
  24. osducli/commands/wellbore_ddms/log_recognition/upload_catalog.py +40 -0
  25. osducli/commands/wellbore_ddms/ppfgdataset/__init__.py +13 -0
  26. osducli/commands/wellbore_ddms/ppfgdataset/add.py +42 -0
  27. osducli/commands/wellbore_ddms/ppfgdataset/data/__init__.py +13 -0
  28. osducli/commands/wellbore_ddms/ppfgdataset/data/add.py +40 -0
  29. osducli/commands/wellbore_ddms/ppfgdataset/data/get.py +44 -0
  30. osducli/commands/wellbore_ddms/ppfgdataset/delete.py +35 -0
  31. osducli/commands/wellbore_ddms/ppfgdataset/get.py +35 -0
  32. osducli/commands/wellbore_ddms/ppfgdataset/session/__init__.py +13 -0
  33. osducli/commands/wellbore_ddms/ppfgdataset/session/create.py +35 -0
  34. osducli/commands/wellbore_ddms/ppfgdataset/session/get.py +36 -0
  35. osducli/commands/wellbore_ddms/ppfgdataset/session/list.py +35 -0
  36. osducli/commands/wellbore_ddms/ppfgdataset/session/send.py +41 -0
  37. osducli/commands/wellbore_ddms/ppfgdataset/session/update.py +37 -0
  38. osducli/commands/wellbore_ddms/ppfgdataset/version/__init__.py +13 -0
  39. osducli/commands/wellbore_ddms/ppfgdataset/version/data/__init__.py +13 -0
  40. osducli/commands/wellbore_ddms/ppfgdataset/version/data/get.py +45 -0
  41. osducli/commands/wellbore_ddms/ppfgdataset/version/get.py +36 -0
  42. osducli/commands/wellbore_ddms/ppfgdataset/version/list.py +35 -0
  43. osducli/commands/wellbore_ddms/trajectory/__init__.py +13 -0
  44. osducli/commands/wellbore_ddms/trajectory/add.py +42 -0
  45. osducli/commands/wellbore_ddms/trajectory/data/__init__.py +13 -0
  46. osducli/commands/wellbore_ddms/trajectory/data/add.py +40 -0
  47. osducli/commands/wellbore_ddms/trajectory/data/get.py +44 -0
  48. osducli/commands/wellbore_ddms/trajectory/delete.py +35 -0
  49. osducli/commands/wellbore_ddms/trajectory/get.py +35 -0
  50. osducli/commands/wellbore_ddms/trajectory/session/__init__.py +13 -0
  51. osducli/commands/wellbore_ddms/trajectory/session/create.py +35 -0
  52. osducli/commands/wellbore_ddms/trajectory/session/get.py +36 -0
  53. osducli/commands/wellbore_ddms/trajectory/session/list.py +35 -0
  54. osducli/commands/wellbore_ddms/trajectory/session/send.py +41 -0
  55. osducli/commands/wellbore_ddms/trajectory/session/update.py +37 -0
  56. osducli/commands/wellbore_ddms/trajectory/version/__init__.py +13 -0
  57. osducli/commands/wellbore_ddms/trajectory/version/data/__init__.py +13 -0
  58. osducli/commands/wellbore_ddms/trajectory/version/data/get.py +45 -0
  59. osducli/commands/wellbore_ddms/trajectory/version/get.py +36 -0
  60. osducli/commands/wellbore_ddms/trajectory/version/list.py +35 -0
  61. osducli/commands/wellbore_ddms/well/__init__.py +13 -0
  62. osducli/commands/wellbore_ddms/well/add.py +42 -0
  63. osducli/commands/wellbore_ddms/well/delete.py +35 -0
  64. osducli/commands/wellbore_ddms/well/get.py +35 -0
  65. osducli/commands/wellbore_ddms/well/version/__init__.py +13 -0
  66. osducli/commands/wellbore_ddms/well/version/get.py +36 -0
  67. osducli/commands/wellbore_ddms/well/version/list.py +35 -0
  68. osducli/commands/wellbore_ddms/well_log/add.py +4 -4
  69. osducli/commands/wellbore_ddms/well_log/data/__init__.py +1 -1
  70. osducli/commands/wellbore_ddms/well_log/data/add.py +5 -5
  71. osducli/commands/wellbore_ddms/well_log/data/get.py +5 -5
  72. osducli/commands/wellbore_ddms/well_log/data/statistics.py +36 -0
  73. osducli/commands/wellbore_ddms/well_log/delete.py +35 -0
  74. osducli/commands/wellbore_ddms/well_log/get.py +5 -5
  75. osducli/commands/wellbore_ddms/well_log/session/__init__.py +13 -0
  76. osducli/commands/wellbore_ddms/well_log/session/create.py +35 -0
  77. osducli/commands/wellbore_ddms/well_log/session/get.py +36 -0
  78. osducli/commands/wellbore_ddms/well_log/session/list.py +35 -0
  79. osducli/commands/wellbore_ddms/well_log/session/send.py +41 -0
  80. osducli/commands/wellbore_ddms/well_log/session/update.py +37 -0
  81. osducli/commands/wellbore_ddms/well_log/version/__init__.py +13 -0
  82. osducli/commands/wellbore_ddms/well_log/version/data/__init__.py +13 -0
  83. osducli/commands/wellbore_ddms/well_log/version/data/get.py +45 -0
  84. osducli/commands/wellbore_ddms/well_log/version/data/statistics.py +37 -0
  85. osducli/commands/wellbore_ddms/well_log/version/data/update_stats.py +36 -0
  86. osducli/commands/wellbore_ddms/well_log/version/get.py +36 -0
  87. osducli/commands/wellbore_ddms/well_log/version/list.py +35 -0
  88. osducli/commands/wellbore_ddms/wellbore/__init__.py +13 -0
  89. osducli/commands/wellbore_ddms/wellbore/add.py +42 -0
  90. osducli/commands/wellbore_ddms/wellbore/delete.py +35 -0
  91. osducli/commands/wellbore_ddms/wellbore/get.py +35 -0
  92. osducli/commands/wellbore_ddms/wellbore/version/__init__.py +13 -0
  93. osducli/commands/wellbore_ddms/wellbore/version/get.py +36 -0
  94. osducli/commands/wellbore_ddms/wellbore/version/list.py +35 -0
  95. osducli/commands/wellbore_ddms/wellbore_intervalset/__init__.py +13 -0
  96. osducli/commands/wellbore_ddms/wellbore_intervalset/add.py +44 -0
  97. osducli/commands/wellbore_ddms/wellbore_intervalset/delete.py +37 -0
  98. osducli/commands/wellbore_ddms/wellbore_intervalset/get.py +37 -0
  99. osducli/commands/wellbore_ddms/wellbore_intervalset/version/__init__.py +13 -0
  100. osducli/commands/wellbore_ddms/wellbore_intervalset/version/get.py +38 -0
  101. osducli/commands/wellbore_ddms/wellbore_intervalset/version/list.py +37 -0
  102. osducli/commands/wellbore_ddms/wellbore_markerset/__init__.py +13 -0
  103. osducli/commands/wellbore_ddms/wellbore_markerset/add.py +42 -0
  104. osducli/commands/wellbore_ddms/wellbore_markerset/delete.py +35 -0
  105. osducli/commands/wellbore_ddms/wellbore_markerset/get.py +35 -0
  106. osducli/commands/wellbore_ddms/wellbore_markerset/version/__init__.py +13 -0
  107. osducli/commands/wellbore_ddms/wellbore_markerset/version/get.py +36 -0
  108. osducli/commands/wellbore_ddms/wellbore_markerset/version/list.py +35 -0
  109. osducli/commands/wellbore_ddms/welllog_acquisition/__init__.py +13 -0
  110. osducli/commands/wellbore_ddms/welllog_acquisition/add.py +42 -0
  111. osducli/commands/wellbore_ddms/welllog_acquisition/delete.py +35 -0
  112. osducli/commands/wellbore_ddms/welllog_acquisition/get.py +35 -0
  113. osducli/commands/wellbore_ddms/welllog_acquisition/version/__init__.py +13 -0
  114. osducli/commands/wellbore_ddms/welllog_acquisition/version/get.py +36 -0
  115. osducli/commands/wellbore_ddms/welllog_acquisition/version/list.py +35 -0
  116. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/__init__.py +13 -0
  117. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/add.py +44 -0
  118. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/data/__init__.py +13 -0
  119. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/data/add.py +42 -0
  120. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/data/get.py +46 -0
  121. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/delete.py +37 -0
  122. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/get.py +37 -0
  123. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/__init__.py +13 -0
  124. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/create.py +37 -0
  125. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/get.py +38 -0
  126. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/list.py +37 -0
  127. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/send.py +43 -0
  128. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/session/update.py +39 -0
  129. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/__init__.py +13 -0
  130. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/data/__init__.py +13 -0
  131. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/data/get.py +47 -0
  132. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/get.py +38 -0
  133. osducli/commands/wellbore_ddms/wellpressure_test_raw_measurement/version/list.py +37 -0
  134. osducli/config.py +1 -0
  135. osducli/wbddms_client.py +160 -27
  136. {osducli-0.0.47.dist-info → osducli-0.0.49.dist-info}/METADATA +15 -8
  137. osducli-0.0.49.dist-info/RECORD +242 -0
  138. osducli-0.0.47.dist-info/RECORD +0 -119
  139. {osducli-0.0.47.dist-info → osducli-0.0.49.dist-info}/WHEEL +0 -0
  140. {osducli-0.0.47.dist-info → osducli-0.0.49.dist-info}/entry_points.txt +0 -0
  141. {osducli-0.0.47.dist-info → osducli-0.0.49.dist-info}/licenses/LICENSE.md +0 -0
  142. {osducli-0.0.47.dist-info → osducli-0.0.49.dist-info}/top_level.txt +0 -0
@@ -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("-c", "--commit", "_com", is_flag=True, help="Commit or abandon", required=False)
27
+ @handle_cli_exceptions
28
+ @command_with_output()
29
+ def _click_command(state: State, _id: str, _ses: str, _com: bool):
30
+ return update_session(state, _id, _ses, _com)
31
+
32
+
33
+ def update_session(state: State, record_id: str, session_id: str, commit: bool):
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, commit)
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()
osducli/config.py CHANGED
@@ -44,6 +44,7 @@ CONFIG_WELLBORE_DDMS_URL = "wellbore_ddms_url"
44
44
 
45
45
  CONFIG_DATA_PARTITION_ID = "data_partition_id"
46
46
  CONFIG_LEGAL_TAG = "legal_tag"
47
+ CONFIG_OTHER_RELEVANT_DATA_COUNTRIES = "other_relevant_data_countries"
47
48
  CONFIG_ACL_VIEWER = "acl_viewer"
48
49
  CONFIG_ACL_OWNER = "acl_owner"
49
50
 
osducli/wbddms_client.py CHANGED
@@ -27,32 +27,165 @@ class WellboreDdmsClient(BaseClient):
27
27
  """
28
28
  Client for interacting with Wellbore DDMS
29
29
  """
30
+
30
31
  def __init__(
31
- self,
32
- wellbore_ddms_url: str = None,
33
- config_manager: BaseConfigManager = None,
34
- provider: str = None,
35
- data_partition_id: str = None,
36
- token_refresher: TokenRefresher = None,
37
- user_id: str = None
32
+ self,
33
+ wellbore_ddms_url: str = None,
34
+ config_manager: BaseConfigManager = None,
35
+ provider: str = None,
36
+ data_partition_id: str = None,
37
+ token_refresher: TokenRefresher = None,
38
+ user_id: str = None,
38
39
  ):
39
- super().__init__(config_manager, provider, data_partition_id, token_refresher, logger, user_id)
40
- self.wellbore_ddms_url = wellbore_ddms_url or self.config_manager.get('environment', 'wellbore_ddms_url')
41
-
42
- def get_well_log(self, record_id: str = None) -> requests.Response:
43
- """Get wellLog record from wellbore ddms by id"""
44
- return self.make_request(method=HttpMethod.GET, url=f'{self.wellbore_ddms_url}/{record_id}')
45
-
46
- def create_well_log(self, record_data_list: str = None) -> requests.Response:
47
- """Create wellLog record with wellbore ddms"""
48
- return self.make_request(method=HttpMethod.POST, url=self.wellbore_ddms_url, data=record_data_list)
49
-
50
- def get_well_log_data(self, record_id: str) -> requests.Response:
51
- """Get wellLog composite parquet from wellbore ddms"""
52
- return self.make_request(method=HttpMethod.GET, url=f'{self.wellbore_ddms_url}/{record_id}/data')
53
-
54
- def create_well_log_data(self, record_id: str, data: str = '') -> requests.Response:
55
- """Create wellLog composite parquet with wellbore ddms"""
56
- additional_header = {'Content-Type': 'application/x-parquet'}
57
- return self.make_request(method=HttpMethod.POST, url=f'{self.wellbore_ddms_url}/{record_id}/data',
58
- add_headers=additional_header, data=data)
40
+ super().__init__(
41
+ config_manager,
42
+ provider,
43
+ data_partition_id,
44
+ token_refresher,
45
+ logger,
46
+ user_id,
47
+ )
48
+ self.wellbore_ddms_url = wellbore_ddms_url or self.config_manager.get(
49
+ "environment", "wellbore_ddms_url"
50
+ )
51
+
52
+ def get_wbddms_record(self, record_id: str = None) -> requests.Response:
53
+ """Get record from wellbore ddms by id"""
54
+ return self.make_request(
55
+ method=HttpMethod.GET, url=f"{self.wellbore_ddms_url}/{record_id}"
56
+ )
57
+
58
+ def get_wbddms_record_versions(self, record_id: str = None) -> requests.Response:
59
+ """Get all versions of the record from wellbore ddms by id"""
60
+ return self.make_request(
61
+ method=HttpMethod.GET, url=f"{self.wellbore_ddms_url}/{record_id}/versions"
62
+ )
63
+
64
+ def get_wbddms_record_version(
65
+ self, record_id: str = None, version: str = None
66
+ ) -> requests.Response:
67
+ """Get given version of the record from wellbore ddms by id"""
68
+ return self.make_request(
69
+ method=HttpMethod.GET,
70
+ url=f"{self.wellbore_ddms_url}/{record_id}/versions/{version}",
71
+ )
72
+
73
+ def delete_wbddms_record(self, record_id: str = None) -> requests.Response:
74
+ """Delete record from wellbore ddms by id. The API performs a soft delete."""
75
+ return self.make_request(
76
+ method=HttpMethod.DELETE, url=f"{self.wellbore_ddms_url}/{record_id}"
77
+ )
78
+
79
+ def create_wbddms_record(self, record_data_list: str = None) -> requests.Response:
80
+ """Create record with wellbore ddms"""
81
+ return self.make_request(
82
+ method=HttpMethod.POST, url=self.wellbore_ddms_url, data=record_data_list
83
+ )
84
+
85
+ def get_wbddms_data(self, record_id: str) -> requests.Response:
86
+ """Get parquet from wellbore ddms"""
87
+ return self.make_request(
88
+ method=HttpMethod.GET, url=f"{self.wellbore_ddms_url}/{record_id}/data"
89
+ )
90
+
91
+ def create_wbddms_data(self, record_id: str, data: bytes = "") -> requests.Response:
92
+ """Writes data as a whole bulk, creates a new version"""
93
+ additional_header = {"Content-Type": "application/x-parquet"}
94
+ return self.make_request(
95
+ method=HttpMethod.POST,
96
+ url=f"{self.wellbore_ddms_url}/{record_id}/data",
97
+ add_headers=additional_header,
98
+ data=data,
99
+ )
100
+
101
+ def get_wbddms_data_statistics(self, record_id: str, curves: str) -> requests.Response:
102
+ """Get statistics of records data"""
103
+ return self.make_request(
104
+ method=HttpMethod.GET,
105
+ url=f"{self.wellbore_ddms_url}/{record_id}/data/statistics",
106
+ params={"curves": curves}
107
+ )
108
+
109
+ def list_wbddms_session(self, record_id: str) -> requests.Response:
110
+ """List session of the given record"""
111
+ return self.make_request(
112
+ method=HttpMethod.GET,
113
+ url=f"{self.wellbore_ddms_url}/{record_id}/sessions")
114
+
115
+ def create_wbddms_session(self, record_id: str) -> requests.Response:
116
+ """Create a new session on the given record for writing bulk data"""
117
+ return self.make_request(
118
+ method=HttpMethod.POST,
119
+ url=f"{self.wellbore_ddms_url}/{record_id}/sessions"
120
+ )
121
+
122
+ def get_wbddms_session(self, record_id: str, session_id: str) -> requests.Response:
123
+ """Get session"""
124
+ return self.make_request(
125
+ method=HttpMethod.GET,
126
+ url=f"{self.wellbore_ddms_url}/{record_id}/sessions/{session_id}"
127
+ )
128
+
129
+ def update_wbddms_session(self, record_id: str, session_id: str, commit: bool = True) -> requests.Response:
130
+ """Update a session, either commit or abandon"""
131
+ data = '{"state": ' + ('commit' if commit else 'abandon') + '}'
132
+ return self.make_request(
133
+ method=HttpMethod.PATCH,
134
+ url=f"{self.wellbore_ddms_url}/{record_id}/sessions/{session_id}",
135
+ data=data
136
+ )
137
+
138
+ def add_wbddms_data_chunk(self, record_id: str, session_id: str, data_chunk: bytes) -> requests.Response:
139
+ """Send a data chunk. Session must be completed/commited once all chunks are sent"""
140
+ additional_header = {"Content-Type": "application/x-parquet"}
141
+ return self.make_request(
142
+ method=HttpMethod.POST,
143
+ url=f"{self.wellbore_ddms_url}/{record_id}/sessions/{session_id}/data",
144
+ add_headers=additional_header,
145
+ data=data_chunk
146
+ )
147
+
148
+ def get_wbddms_version_data(self, record_id: str, version: str) -> requests.Response:
149
+ """Get data of the specified version"""
150
+ additional_header = {"Content-Type": "application/x-parquet"}
151
+ return self.make_request(
152
+ method=HttpMethod.GET,
153
+ url=f"{self.wellbore_ddms_url}/{record_id}/versions/{version}/data",
154
+ add_headers = additional_header
155
+ )
156
+
157
+ def get_wbddms_version_statistics(self, record_id: str, version: str, curves: str) -> requests.Response:
158
+ """Get statistics of records data for selected version"""
159
+ return self.make_request(
160
+ method=HttpMethod.GET,
161
+ url=f"{self.wellbore_ddms_url}/{record_id}/versions/{version}/data/statistics",
162
+ params={"curves": curves}
163
+ )
164
+
165
+ def compute_wbddms_version_statistics(self, record_id: str, version: str) -> requests.Response:
166
+ """Trigger computations of records data statistics for selected version"""
167
+ return self.make_request(
168
+ method=HttpMethod.POST,
169
+ url=f"{self.wellbore_ddms_url}/{record_id}/versions/{version}/data/statistics"
170
+ )
171
+
172
+ def get_log_recognition_family(self, schema: str) -> requests.Response:
173
+ """Find the most probable family and unit using family assignment rule based catalogs.
174
+ User defined catalog will have the priority."""
175
+ return self.make_request(
176
+ method=HttpMethod.POST,
177
+ url=f"{self.wellbore_ddms_url}/family",
178
+ data=schema
179
+ )
180
+
181
+ def upload_log_recognition_catalog(self, catalog: str) -> requests.Response:
182
+ """Upload user-defined catalog with family assignment rules.
183
+ If there is an existing catalog, it will be replaced.
184
+ It takes maximum of 5 mins to replace the existing catalog.
185
+ Hence, any call to retrieve the family should be made after 5 mins of uploading the catalog.
186
+ Required roles: 'users.datalake.editors' or 'users.datalake.admins"""
187
+ return self.make_request(
188
+ method=HttpMethod.PUT,
189
+ url=f"{self.wellbore_ddms_url}/upload-catalog",
190
+ data=catalog
191
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osducli
3
- Version: 0.0.47
3
+ Version: 0.0.49
4
4
  Summary: OSDU command line
5
5
  Author-email: Equinor ASA <mhew@equinor.com>
6
6
  License-Expression: Apache-2.0
@@ -20,6 +20,7 @@ Requires-Dist: osdu-api[common]==1.0.3
20
20
  Requires-Dist: requests
21
21
  Requires-Dist: tabulate
22
22
  Requires-Dist: packaging
23
+ Requires-Dist: wbdutil==0.1.1
23
24
  Requires-Dist: msal
24
25
  Requires-Dist: msal-extensions
25
26
  Requires-Dist: azure-identity
@@ -49,13 +50,6 @@ OSDU Command Line Interface
49
50
 
50
51
  Command-line interface for interacting with OSDU.
51
52
 
52
- NOTE: With version 0.0.45 and earlier the pip install command may need extra parameter since a dependency is not available from pypi.org:
53
-
54
- .. code-block:: bash
55
-
56
- pip install osducli --extra-index-url=https://community.opengroup.org/api/v4/projects/148/packages/pypi/simple
57
-
58
-
59
53
  Usage
60
54
  =====
61
55
 
@@ -81,6 +75,19 @@ For more information, specify the `-h` flag:
81
75
  Change Log
82
76
  ==========
83
77
 
78
+ 0.0.49
79
+ ------
80
+ - Added commands for Wellbore DDMS API
81
+ - Custom mappings for wbdutil commands
82
+
83
+ 0.0.48
84
+ ------
85
+ - Added commands for wbdutil (Wellbore DDMS Data Loader)
86
+
87
+ 0.0.47
88
+ ------
89
+ - Maintenance release
90
+
84
91
  0.0.46
85
92
  ------
86
93
  - Simpler install command without extra-index-url