pygeai 0.6.0b13__py3-none-any.whl → 0.6.1__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.
- pygeai/__init__.py +1 -2
- pygeai/_docs/source/content/api_reference/project.rst +392 -0
- pygeai/_docs/source/content/authentication.rst +130 -1
- pygeai/_docs/source/content/debugger.rst +327 -157
- pygeai/_docs/source/content/migration.rst +391 -7
- pygeai/_docs/source/pygeai.core.common.rst +8 -0
- pygeai/_docs/source/pygeai.tests.auth.rst +56 -0
- pygeai/_docs/source/pygeai.tests.cli.rst +8 -0
- pygeai/admin/clients.py +1 -3
- pygeai/analytics/clients.py +1 -1
- pygeai/assistant/clients.py +2 -7
- pygeai/assistant/data/clients.py +0 -8
- pygeai/assistant/data_analyst/clients.py +0 -2
- pygeai/assistant/managers.py +1 -1
- pygeai/assistant/rag/clients.py +0 -2
- pygeai/assistant/rag/mappers.py +9 -11
- pygeai/auth/clients.py +26 -7
- pygeai/auth/endpoints.py +2 -1
- pygeai/chat/clients.py +2 -2
- pygeai/chat/managers.py +1 -1
- pygeai/cli/commands/admin.py +13 -25
- pygeai/cli/commands/analytics.py +56 -88
- pygeai/cli/commands/assistant.py +84 -138
- pygeai/cli/commands/auth.py +23 -46
- pygeai/cli/commands/base.py +0 -1
- pygeai/cli/commands/chat.py +218 -209
- pygeai/cli/commands/common.py +5 -5
- pygeai/cli/commands/configuration.py +79 -29
- pygeai/cli/commands/docs.py +3 -4
- pygeai/cli/commands/embeddings.py +13 -19
- pygeai/cli/commands/evaluation.py +133 -344
- pygeai/cli/commands/feedback.py +7 -15
- pygeai/cli/commands/files.py +26 -53
- pygeai/cli/commands/gam.py +28 -69
- pygeai/cli/commands/lab/ai_lab.py +96 -142
- pygeai/cli/commands/lab/common.py +1 -1
- pygeai/cli/commands/lab/spec.py +12 -32
- pygeai/cli/commands/llm.py +9 -18
- pygeai/cli/commands/migrate.py +43 -99
- pygeai/cli/commands/organization.py +223 -196
- pygeai/cli/commands/rag.py +35 -58
- pygeai/cli/commands/rerank.py +21 -25
- pygeai/cli/commands/secrets.py +39 -67
- pygeai/cli/commands/usage_limits.py +50 -136
- pygeai/cli/commands/validators.py +1 -1
- pygeai/cli/geai.py +32 -3
- pygeai/cli/geai_proxy.py +6 -2
- pygeai/cli/install_man.py +1 -1
- pygeai/cli/parsers.py +1 -1
- pygeai/core/base/clients.py +90 -21
- pygeai/core/base/mappers.py +39 -55
- pygeai/core/base/session.py +134 -22
- pygeai/core/common/config.py +50 -13
- pygeai/core/common/constants.py +8 -0
- pygeai/core/common/exceptions.py +6 -0
- pygeai/core/embeddings/clients.py +0 -1
- pygeai/core/embeddings/managers.py +0 -1
- pygeai/core/feedback/clients.py +0 -2
- pygeai/core/feedback/models.py +1 -1
- pygeai/core/files/clients.py +0 -3
- pygeai/core/files/managers.py +1 -1
- pygeai/core/files/mappers.py +4 -5
- pygeai/core/llm/clients.py +0 -1
- pygeai/core/models.py +4 -4
- pygeai/core/plugins/clients.py +0 -3
- pygeai/core/plugins/models.py +2 -2
- pygeai/core/rerank/clients.py +0 -2
- pygeai/core/secrets/clients.py +0 -2
- pygeai/core/services/rest.py +80 -14
- pygeai/core/singleton.py +24 -0
- pygeai/dbg/__init__.py +2 -2
- pygeai/dbg/debugger.py +276 -38
- pygeai/evaluation/clients.py +2 -4
- pygeai/evaluation/dataset/clients.py +0 -1
- pygeai/evaluation/plan/clients.py +0 -2
- pygeai/evaluation/result/clients.py +0 -2
- pygeai/gam/clients.py +1 -3
- pygeai/health/clients.py +1 -3
- pygeai/lab/clients.py +0 -1
- pygeai/lab/managers.py +0 -1
- pygeai/lab/models.py +0 -1
- pygeai/lab/strategies/clients.py +1 -2
- pygeai/lab/tools/clients.py +2 -2
- pygeai/lab/tools/mappers.py +1 -1
- pygeai/migration/strategies.py +5 -6
- pygeai/migration/tools.py +1 -1
- pygeai/organization/clients.py +118 -12
- pygeai/organization/endpoints.py +1 -0
- pygeai/organization/limits/clients.py +4 -6
- pygeai/organization/limits/managers.py +1 -4
- pygeai/organization/managers.py +2 -2
- pygeai/proxy/config.py +1 -0
- pygeai/proxy/managers.py +6 -5
- pygeai/tests/admin/test_clients.py +11 -11
- pygeai/tests/assistants/rag/test_clients.py +1 -1
- pygeai/tests/assistants/rag/test_models.py +1 -2
- pygeai/tests/assistants/test_clients.py +1 -1
- pygeai/tests/assistants/test_managers.py +1 -3
- pygeai/tests/auth/test_cli_configuration.py +252 -0
- pygeai/tests/auth/test_client_initialization.py +411 -0
- pygeai/tests/auth/test_clients.py +29 -27
- pygeai/tests/auth/test_config_manager.py +305 -0
- pygeai/tests/auth/test_header_injection.py +294 -0
- pygeai/tests/auth/test_oauth.py +3 -1
- pygeai/tests/auth/test_session_logging.py +119 -0
- pygeai/tests/auth/test_session_validation.py +408 -0
- pygeai/tests/auth/test_singleton_reset.py +201 -0
- pygeai/tests/chat/test_clients.py +1 -1
- pygeai/tests/chat/test_iris.py +1 -1
- pygeai/tests/chat/test_ui.py +0 -2
- pygeai/tests/cli/commands/lab/test_ai_lab.py +1 -3
- pygeai/tests/cli/commands/lab/test_common.py +0 -1
- pygeai/tests/cli/commands/test_chat.py +1 -1
- pygeai/tests/cli/commands/test_common.py +0 -1
- pygeai/tests/cli/commands/test_embeddings.py +2 -2
- pygeai/tests/cli/commands/test_evaluation.py +1 -9
- pygeai/tests/cli/commands/test_llm.py +1 -1
- pygeai/tests/cli/commands/test_migrate.py +1 -1
- pygeai/tests/cli/commands/test_rerank.py +0 -1
- pygeai/tests/cli/commands/test_secrets.py +1 -1
- pygeai/tests/cli/commands/test_show_help.py +0 -1
- pygeai/tests/cli/commands/test_validators.py +0 -1
- pygeai/tests/cli/test_credentials_flag.py +312 -0
- pygeai/tests/cli/test_error_handler.py +0 -1
- pygeai/tests/core/base/test_mappers.py +2 -2
- pygeai/tests/core/base/test_models.py +4 -4
- pygeai/tests/core/common/test_config.py +2 -7
- pygeai/tests/core/common/test_decorators.py +0 -1
- pygeai/tests/core/embeddings/test_managers.py +1 -1
- pygeai/tests/core/feedback/test_clients.py +2 -2
- pygeai/tests/core/files/test_clients.py +6 -6
- pygeai/tests/core/files/test_models.py +0 -1
- pygeai/tests/core/files/test_responses.py +0 -1
- pygeai/tests/core/llm/test_clients.py +1 -1
- pygeai/tests/core/plugins/test_clients.py +4 -4
- pygeai/tests/core/rerank/test_mappers.py +1 -3
- pygeai/tests/core/secrets/test_clients.py +2 -3
- pygeai/tests/core/services/test_rest.py +10 -10
- pygeai/tests/core/utils/test_console.py +0 -1
- pygeai/tests/dbg/test_debugger.py +95 -8
- pygeai/tests/evaluation/dataset/test_clients.py +24 -27
- pygeai/tests/evaluation/plan/test_clients.py +16 -18
- pygeai/tests/evaluation/result/test_clients.py +4 -5
- pygeai/tests/health/test_clients.py +2 -2
- pygeai/tests/integration/lab/agents/test_create_agent.py +1 -3
- pygeai/tests/integration/lab/agents/test_get_agent.py +1 -1
- pygeai/tests/integration/lab/processes/test_create_process.py +2 -2
- pygeai/tests/integration/lab/processes/test_create_task.py +2 -3
- pygeai/tests/integration/lab/processes/test_delete_process.py +0 -1
- pygeai/tests/integration/lab/processes/test_get_process.py +2 -4
- pygeai/tests/integration/lab/processes/test_list_process_instances.py +1 -3
- pygeai/tests/integration/lab/processes/test_update_process.py +3 -9
- pygeai/tests/integration/lab/reasoning_strategies/test_update_reasoning_strategy.py +1 -2
- pygeai/tests/integration/lab/tools/test_delete_tool.py +1 -1
- pygeai/tests/integration/lab/tools/test_list_tools.py +1 -1
- pygeai/tests/integration/lab/tools/test_update_tool.py +1 -1
- pygeai/tests/lab/agents/test_clients.py +17 -17
- pygeai/tests/lab/processes/test_clients.py +67 -67
- pygeai/tests/lab/processes/test_mappers.py +23 -23
- pygeai/tests/lab/spec/test_loader.py +0 -2
- pygeai/tests/lab/spec/test_parsers.py +1 -2
- pygeai/tests/lab/strategies/test_clients.py +10 -10
- pygeai/tests/lab/test_managers.py +3 -5
- pygeai/tests/lab/test_mappers.py +1 -4
- pygeai/tests/lab/tools/test_clients.py +21 -21
- pygeai/tests/lab/tools/test_mappers.py +0 -1
- pygeai/tests/organization/limits/test_clients.py +33 -33
- pygeai/tests/organization/limits/test_managers.py +7 -7
- pygeai/tests/organization/test_clients.py +78 -60
- pygeai/tests/proxy/test_clients.py +1 -1
- pygeai/tests/proxy/test_integration.py +1 -4
- pygeai/tests/proxy/test_managers.py +1 -2
- pygeai/tests/proxy/test_servers.py +1 -2
- pygeai/tests/snippets/assistants/rag/delete_rag_assistant.py +0 -1
- pygeai/tests/snippets/assistants/rag/get_documents.py +0 -1
- pygeai/tests/snippets/assistants/rag/get_rag_assistant_data.py +0 -1
- pygeai/tests/snippets/chat/get_request_status.py +0 -1
- pygeai/tests/snippets/dbg/file_debugging.py +72 -0
- pygeai/tests/snippets/dbg/module_debugging.py +60 -0
- pygeai/tests/snippets/embeddings/cohere_example.py +2 -2
- pygeai/tests/snippets/embeddings/openai_base64_example.py +1 -1
- pygeai/tests/snippets/evaluation/dataset/complete_workflow_example.py +8 -8
- pygeai/tests/snippets/evaluation/plan/complete_workflow_example.py +5 -5
- pygeai/tests/snippets/evaluation/result/complete_workflow_example.py +3 -3
- pygeai/tests/snippets/lab/agentic_flow_example_1.py +1 -1
- pygeai/tests/snippets/lab/agentic_flow_example_2.py +3 -4
- pygeai/tests/snippets/lab/agents/create_agent_with_permissions.py +2 -2
- pygeai/tests/snippets/lab/agents/delete_agent.py +1 -2
- pygeai/tests/snippets/lab/agents/get_agent.py +1 -1
- pygeai/tests/snippets/lab/agents/get_agent_with_new_fields.py +10 -10
- pygeai/tests/snippets/lab/agents/get_sharing_link.py +0 -1
- pygeai/tests/snippets/lab/agents/list_agents.py +1 -1
- pygeai/tests/snippets/lab/agents/publish_agent_revision.py +0 -1
- pygeai/tests/snippets/lab/agents/update_agent_properties.py +1 -1
- pygeai/tests/snippets/lab/crud_ui.py +3 -5
- pygeai/tests/snippets/lab/processes/kbs/get_kb.py +0 -1
- pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +0 -1
- pygeai/tests/snippets/lab/processes/list_processes.py +1 -1
- pygeai/tests/snippets/lab/samples/summarize_files.py +0 -3
- pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +0 -1
- pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +1 -1
- pygeai/tests/snippets/lab/tools/get_tool.py +1 -1
- pygeai/tests/snippets/lab/tools/publish_tool_revision.py +0 -1
- pygeai/tests/snippets/lab/tools/set_parameters.py +1 -2
- pygeai/tests/snippets/lab/use_cases/c_code_fixer_agent_flow.py +2 -3
- pygeai/tests/snippets/lab/use_cases/file_summarizer_example_2.py +1 -1
- pygeai/tests/snippets/lab/use_cases/update_cli_expert.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_lab_expert.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_web_designer.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_web_reader.py +0 -1
- pygeai/tests/snippets/migrate/orchestrator_examples.py +1 -1
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/METADATA +32 -7
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/RECORD +217 -206
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/WHEEL +0 -0
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/entry_points.txt +0 -0
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/top_level.txt +0 -0
|
@@ -32,26 +32,16 @@ def list_datasets():
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
def create_dataset(option_list: list):
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
36
|
+
dataset_file = opts.get("dataset_file")
|
|
37
|
+
dataset_name = opts.get("dataset_name")
|
|
38
|
+
dataset_description = opts.get("dataset_description")
|
|
39
|
+
dataset_type = opts.get("dataset_type")
|
|
40
|
+
dataset_active_arg = opts.get("dataset_active")
|
|
41
|
+
dataset_active = get_boolean_value(dataset_active_arg) if dataset_active_arg else True
|
|
42
|
+
rows = []
|
|
41
43
|
|
|
42
44
|
for option_flag, option_arg in option_list:
|
|
43
|
-
if option_flag.name == "dataset_file":
|
|
44
|
-
dataset_file = option_arg
|
|
45
|
-
if option_flag.name == "dataset_name":
|
|
46
|
-
dataset_name = option_arg
|
|
47
|
-
if option_flag.name == "dataset_description":
|
|
48
|
-
dataset_description = option_arg
|
|
49
|
-
if option_flag.name == "dataset_type":
|
|
50
|
-
dataset_type = option_arg
|
|
51
|
-
if option_flag.name == "dataset_type":
|
|
52
|
-
dataset_type = option_arg
|
|
53
|
-
if option_flag.name == "dataset_active":
|
|
54
|
-
dataset_active = get_boolean_value(option_arg)
|
|
55
45
|
if option_flag.name == "row":
|
|
56
46
|
try:
|
|
57
47
|
row_json = json.loads(option_arg)
|
|
@@ -136,11 +126,8 @@ create_dataset_options = [
|
|
|
136
126
|
|
|
137
127
|
|
|
138
128
|
def get_dataset(option_list: list):
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
for option_flag, option_arg in option_list:
|
|
142
|
-
if option_flag.name == "dataset_id":
|
|
143
|
-
dataset_id = option_arg
|
|
129
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
130
|
+
dataset_id = opts.get("dataset_id")
|
|
144
131
|
|
|
145
132
|
if not dataset_id:
|
|
146
133
|
raise MissingRequirementException("Cannot retrieve dataset without specifying id.")
|
|
@@ -163,26 +150,16 @@ get_dataset_options = [
|
|
|
163
150
|
|
|
164
151
|
|
|
165
152
|
def update_dataset(option_list: list):
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
153
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
154
|
+
dataset_id = opts.get("dataset_id")
|
|
155
|
+
dataset_name = opts.get("dataset_name")
|
|
156
|
+
dataset_description = opts.get("dataset_description")
|
|
157
|
+
dataset_type = opts.get("dataset_type")
|
|
158
|
+
dataset_active_arg = opts.get("dataset_active")
|
|
159
|
+
dataset_active = get_boolean_value(dataset_active_arg) if dataset_active_arg else True
|
|
160
|
+
rows = []
|
|
172
161
|
|
|
173
162
|
for option_flag, option_arg in option_list:
|
|
174
|
-
if option_flag.name == "dataset_id":
|
|
175
|
-
dataset_id = option_arg
|
|
176
|
-
if option_flag.name == "dataset_name":
|
|
177
|
-
dataset_name = option_arg
|
|
178
|
-
if option_flag.name == "dataset_description":
|
|
179
|
-
dataset_description = option_arg
|
|
180
|
-
if option_flag.name == "dataset_type":
|
|
181
|
-
dataset_type = option_arg
|
|
182
|
-
if option_flag.name == "dataset_type":
|
|
183
|
-
dataset_type = option_arg
|
|
184
|
-
if option_flag.name == "dataset_active":
|
|
185
|
-
dataset_active = get_boolean_value(option_arg)
|
|
186
163
|
if option_flag.name == "row":
|
|
187
164
|
try:
|
|
188
165
|
row_json = json.loads(option_arg)
|
|
@@ -261,11 +238,8 @@ update_dataset_options = [
|
|
|
261
238
|
|
|
262
239
|
|
|
263
240
|
def delete_dataset(option_list: list):
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
for option_flag, option_arg in option_list:
|
|
267
|
-
if option_flag.name == "dataset_id":
|
|
268
|
-
dataset_id = option_arg
|
|
241
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
242
|
+
dataset_id = opts.get("dataset_id")
|
|
269
243
|
|
|
270
244
|
if not dataset_id:
|
|
271
245
|
raise MissingRequirementException("Cannot delete dataset without specifying id.")
|
|
@@ -288,12 +262,11 @@ delete_dataset_options = [
|
|
|
288
262
|
|
|
289
263
|
|
|
290
264
|
def create_dataset_row(option_list: list):
|
|
291
|
-
|
|
265
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
266
|
+
dataset_id = opts.get("dataset_id")
|
|
292
267
|
row = None
|
|
293
268
|
|
|
294
269
|
for option_flag, option_arg in option_list:
|
|
295
|
-
if option_flag.name == "dataset_id":
|
|
296
|
-
dataset_id = option_arg
|
|
297
270
|
if option_flag.name == "row":
|
|
298
271
|
try:
|
|
299
272
|
row_json = json.loads(option_arg)
|
|
@@ -343,11 +316,8 @@ create_dataset_row_options = [
|
|
|
343
316
|
|
|
344
317
|
|
|
345
318
|
def list_dataset_rows(option_list: list):
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
for option_flag, option_arg in option_list:
|
|
349
|
-
if option_flag.name == "dataset_id":
|
|
350
|
-
dataset_id = option_arg
|
|
319
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
320
|
+
dataset_id = opts.get("dataset_id")
|
|
351
321
|
|
|
352
322
|
if not dataset_id:
|
|
353
323
|
raise MissingRequirementException("Cannot list dataset rows without specifying id.")
|
|
@@ -370,14 +340,9 @@ list_dataset_rows_options = [
|
|
|
370
340
|
|
|
371
341
|
|
|
372
342
|
def get_dataset_row(option_list: list):
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
for option_flag, option_arg in option_list:
|
|
377
|
-
if option_flag.name == "dataset_id":
|
|
378
|
-
dataset_id = option_arg
|
|
379
|
-
if option_flag.name == "row_id":
|
|
380
|
-
row_id = option_arg
|
|
343
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
344
|
+
dataset_id = opts.get("dataset_id")
|
|
345
|
+
row_id = opts.get("row_id")
|
|
381
346
|
|
|
382
347
|
if not (dataset_id and row_id):
|
|
383
348
|
raise MissingRequirementException("Cannot get dataset row without specifying id of dataset and row.")
|
|
@@ -407,15 +372,12 @@ get_dataset_row_options = [
|
|
|
407
372
|
|
|
408
373
|
|
|
409
374
|
def update_dataset_row(option_list: list):
|
|
410
|
-
|
|
411
|
-
|
|
375
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
376
|
+
dataset_id = opts.get("dataset_id")
|
|
377
|
+
row_id = opts.get("row_id")
|
|
412
378
|
row = None
|
|
413
379
|
|
|
414
380
|
for option_flag, option_arg in option_list:
|
|
415
|
-
if option_flag.name == "dataset_id":
|
|
416
|
-
dataset_id = option_arg
|
|
417
|
-
if option_flag.name == "row_id":
|
|
418
|
-
row_id = option_arg
|
|
419
381
|
if option_flag.name == "row":
|
|
420
382
|
try:
|
|
421
383
|
row_json = json.loads(option_arg)
|
|
@@ -472,14 +434,9 @@ update_dataset_row_options = [
|
|
|
472
434
|
|
|
473
435
|
|
|
474
436
|
def delete_dataset_row(option_list: list):
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
for option_flag, option_arg in option_list:
|
|
479
|
-
if option_flag.name == "dataset_id":
|
|
480
|
-
dataset_id = option_arg
|
|
481
|
-
if option_flag.name == "row_id":
|
|
482
|
-
row_id = option_arg
|
|
437
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
438
|
+
dataset_id = opts.get("dataset_id")
|
|
439
|
+
row_id = opts.get("row_id")
|
|
483
440
|
|
|
484
441
|
if not (dataset_id and row_id):
|
|
485
442
|
raise MissingRequirementException("Cannot delete dataset row without specifying id of dataset and row.")
|
|
@@ -509,23 +466,12 @@ delete_dataset_row_options = [
|
|
|
509
466
|
|
|
510
467
|
|
|
511
468
|
def create_dataset_row_expected_source(option_list: list):
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
for option_flag, option_arg in option_list:
|
|
519
|
-
if option_flag.name == "dataset_id":
|
|
520
|
-
dataset_id = option_arg
|
|
521
|
-
if option_flag.name == "row_id":
|
|
522
|
-
row_id = option_arg
|
|
523
|
-
if option_flag.name == "name":
|
|
524
|
-
name = option_arg
|
|
525
|
-
if option_flag.name == "value":
|
|
526
|
-
value = option_arg
|
|
527
|
-
if option_flag.name == "extension":
|
|
528
|
-
extension = option_arg
|
|
469
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
470
|
+
dataset_id = opts.get("dataset_id")
|
|
471
|
+
row_id = opts.get("row_id")
|
|
472
|
+
name = opts.get("name")
|
|
473
|
+
value = opts.get("value")
|
|
474
|
+
extension = opts.get("extension")
|
|
529
475
|
|
|
530
476
|
if not (dataset_id and row_id):
|
|
531
477
|
raise MissingRequirementException("Cannot create dataset row expected source without specifying id of dataset and row.")
|
|
@@ -576,14 +522,9 @@ create_dataset_row_expected_source_options = [
|
|
|
576
522
|
|
|
577
523
|
|
|
578
524
|
def list_dataset_row_expected_sources(option_list: list):
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
for option_flag, option_arg in option_list:
|
|
583
|
-
if option_flag.name == "dataset_id":
|
|
584
|
-
dataset_id = option_arg
|
|
585
|
-
if option_flag.name == "row_id":
|
|
586
|
-
row_id = option_arg
|
|
525
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
526
|
+
dataset_id = opts.get("dataset_id")
|
|
527
|
+
row_id = opts.get("row_id")
|
|
587
528
|
|
|
588
529
|
if not (dataset_id and row_id):
|
|
589
530
|
raise MissingRequirementException("Cannot list dataset row expected sources without specifying id of dataset and row.")
|
|
@@ -613,17 +554,10 @@ list_dataset_row_expected_sources_options = [
|
|
|
613
554
|
|
|
614
555
|
|
|
615
556
|
def get_dataset_row_expected_source(option_list: list):
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
for option_flag, option_arg in option_list:
|
|
621
|
-
if option_flag.name == "dataset_id":
|
|
622
|
-
dataset_id = option_arg
|
|
623
|
-
if option_flag.name == "row_id":
|
|
624
|
-
row_id = option_arg
|
|
625
|
-
if option_flag.name == "expected_source_id":
|
|
626
|
-
expected_source_id = option_arg
|
|
557
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
558
|
+
dataset_id = opts.get("dataset_id")
|
|
559
|
+
row_id = opts.get("row_id")
|
|
560
|
+
expected_source_id = opts.get("expected_source_id")
|
|
627
561
|
|
|
628
562
|
if not (dataset_id and row_id and expected_source_id):
|
|
629
563
|
raise MissingRequirementException("Cannot get expected sources without specifying id of dataset, row and expected source.")
|
|
@@ -660,26 +594,13 @@ get_dataset_row_expected_source_options = [
|
|
|
660
594
|
|
|
661
595
|
|
|
662
596
|
def update_dataset_row_expected_source(option_list: list):
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
for option_flag, option_arg in option_list:
|
|
671
|
-
if option_flag.name == "dataset_id":
|
|
672
|
-
dataset_id = option_arg
|
|
673
|
-
if option_flag.name == "row_id":
|
|
674
|
-
row_id = option_arg
|
|
675
|
-
if option_flag.name == "expected_source_id":
|
|
676
|
-
expected_source_id = option_arg
|
|
677
|
-
if option_flag.name == "name":
|
|
678
|
-
name = option_arg
|
|
679
|
-
if option_flag.name == "value":
|
|
680
|
-
value = option_arg
|
|
681
|
-
if option_flag.name == "extension":
|
|
682
|
-
extension = option_arg
|
|
597
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
598
|
+
dataset_id = opts.get("dataset_id")
|
|
599
|
+
row_id = opts.get("row_id")
|
|
600
|
+
expected_source_id = opts.get("expected_source_id")
|
|
601
|
+
name = opts.get("name")
|
|
602
|
+
value = opts.get("value")
|
|
603
|
+
extension = opts.get("extension")
|
|
683
604
|
|
|
684
605
|
if not (dataset_id and row_id and expected_source_id):
|
|
685
606
|
raise MissingRequirementException("Cannot update expected sources without specifying id of dataset, row and expected source.")
|
|
@@ -738,17 +659,10 @@ update_dataset_row_expected_source_options = [
|
|
|
738
659
|
|
|
739
660
|
|
|
740
661
|
def delete_dataset_row_expected_source(option_list: list):
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
for option_flag, option_arg in option_list:
|
|
746
|
-
if option_flag.name == "dataset_id":
|
|
747
|
-
dataset_id = option_arg
|
|
748
|
-
if option_flag.name == "row_id":
|
|
749
|
-
row_id = option_arg
|
|
750
|
-
if option_flag.name == "expected_source_id":
|
|
751
|
-
expected_source_id = option_arg
|
|
662
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
663
|
+
dataset_id = opts.get("dataset_id")
|
|
664
|
+
row_id = opts.get("row_id")
|
|
665
|
+
expected_source_id = opts.get("expected_source_id")
|
|
752
666
|
|
|
753
667
|
if not (dataset_id and row_id and expected_source_id):
|
|
754
668
|
raise MissingRequirementException("Cannot delete expected sources without specifying id of dataset, row and expected source.")
|
|
@@ -785,26 +699,13 @@ delete_dataset_row_expected_source_options = [
|
|
|
785
699
|
|
|
786
700
|
|
|
787
701
|
def create_dataset_row_filter_variable(option_list: list):
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
for option_flag, option_arg in option_list:
|
|
796
|
-
if option_flag.name == "dataset_id":
|
|
797
|
-
dataset_id = option_arg
|
|
798
|
-
if option_flag.name == "row_id":
|
|
799
|
-
row_id = option_arg
|
|
800
|
-
if option_flag.name == "metadata_type":
|
|
801
|
-
metadata_type = option_arg
|
|
802
|
-
if option_flag.name == "key":
|
|
803
|
-
key = option_arg
|
|
804
|
-
if option_flag.name == "value":
|
|
805
|
-
value = option_arg
|
|
806
|
-
if option_flag.name == "operator":
|
|
807
|
-
operator = option_arg
|
|
702
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
703
|
+
dataset_id = opts.get("dataset_id")
|
|
704
|
+
row_id = opts.get("row_id")
|
|
705
|
+
metadata_type = opts.get("metadata_type")
|
|
706
|
+
key = opts.get("key")
|
|
707
|
+
value = opts.get("value")
|
|
708
|
+
operator = opts.get("operator")
|
|
808
709
|
|
|
809
710
|
if not (dataset_id and row_id):
|
|
810
711
|
raise MissingRequirementException("Cannot create dataset row filter variable without specifying id of dataset and row.")
|
|
@@ -862,14 +763,9 @@ create_dataset_row_filter_variable_options = [
|
|
|
862
763
|
|
|
863
764
|
|
|
864
765
|
def list_dataset_row_filter_variables(option_list: list):
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
for option_flag, option_arg in option_list:
|
|
869
|
-
if option_flag.name == "dataset_id":
|
|
870
|
-
dataset_id = option_arg
|
|
871
|
-
if option_flag.name == "row_id":
|
|
872
|
-
row_id = option_arg
|
|
766
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
767
|
+
dataset_id = opts.get("dataset_id")
|
|
768
|
+
row_id = opts.get("row_id")
|
|
873
769
|
|
|
874
770
|
if not (dataset_id and row_id):
|
|
875
771
|
raise MissingRequirementException("Cannot list dataset row filter variables without specifying id of dataset and row.")
|
|
@@ -899,17 +795,10 @@ list_dataset_row_filter_variables_options = [
|
|
|
899
795
|
|
|
900
796
|
|
|
901
797
|
def get_dataset_row_filter_variable(option_list: list):
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
for option_flag, option_arg in option_list:
|
|
907
|
-
if option_flag.name == "dataset_id":
|
|
908
|
-
dataset_id = option_arg
|
|
909
|
-
if option_flag.name == "row_id":
|
|
910
|
-
row_id = option_arg
|
|
911
|
-
if option_flag.name == "filter_variable_id":
|
|
912
|
-
filter_variable_id = option_arg
|
|
798
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
799
|
+
dataset_id = opts.get("dataset_id")
|
|
800
|
+
row_id = opts.get("row_id")
|
|
801
|
+
filter_variable_id = opts.get("filter_variable_id")
|
|
913
802
|
|
|
914
803
|
if not (dataset_id and row_id and filter_variable_id):
|
|
915
804
|
raise MissingRequirementException("Cannot get filter variables without specifying id of dataset, row and filter variable.")
|
|
@@ -946,29 +835,14 @@ get_dataset_row_filter_variable_options = [
|
|
|
946
835
|
|
|
947
836
|
|
|
948
837
|
def update_dataset_row_filter_variable(option_list: list):
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
for option_flag, option_arg in option_list:
|
|
958
|
-
if option_flag.name == "dataset_id":
|
|
959
|
-
dataset_id = option_arg
|
|
960
|
-
if option_flag.name == "row_id":
|
|
961
|
-
row_id = option_arg
|
|
962
|
-
if option_flag.name == "filter_variable_id":
|
|
963
|
-
filter_variable_id = option_arg
|
|
964
|
-
if option_flag.name == "metadata_type":
|
|
965
|
-
metadata_type = option_arg
|
|
966
|
-
if option_flag.name == "key":
|
|
967
|
-
key = option_arg
|
|
968
|
-
if option_flag.name == "value":
|
|
969
|
-
value = option_arg
|
|
970
|
-
if option_flag.name == "operator":
|
|
971
|
-
operator = option_arg
|
|
838
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
839
|
+
dataset_id = opts.get("dataset_id")
|
|
840
|
+
row_id = opts.get("row_id")
|
|
841
|
+
filter_variable_id = opts.get("filter_variable_id")
|
|
842
|
+
metadata_type = opts.get("metadata_type")
|
|
843
|
+
key = opts.get("key")
|
|
844
|
+
value = opts.get("value")
|
|
845
|
+
operator = opts.get("operator")
|
|
972
846
|
|
|
973
847
|
if not (dataset_id and row_id and filter_variable_id):
|
|
974
848
|
raise MissingRequirementException("Cannot update filter variables without specifying id of dataset, row and filter variable.")
|
|
@@ -1033,17 +907,10 @@ update_dataset_row_filter_variable_options = [
|
|
|
1033
907
|
|
|
1034
908
|
|
|
1035
909
|
def delete_dataset_row_filter_variable(option_list: list):
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
for option_flag, option_arg in option_list:
|
|
1041
|
-
if option_flag.name == "dataset_id":
|
|
1042
|
-
dataset_id = option_arg
|
|
1043
|
-
if option_flag.name == "row_id":
|
|
1044
|
-
row_id = option_arg
|
|
1045
|
-
if option_flag.name == "filter_variable_id":
|
|
1046
|
-
filter_variable_id = option_arg
|
|
910
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
911
|
+
dataset_id = opts.get("dataset_id")
|
|
912
|
+
row_id = opts.get("row_id")
|
|
913
|
+
filter_variable_id = opts.get("filter_variable_id")
|
|
1047
914
|
|
|
1048
915
|
if not (dataset_id and row_id and filter_variable_id):
|
|
1049
916
|
raise MissingRequirementException("Cannot delete filter variables without specifying id of dataset, row and filter variable.")
|
|
@@ -1080,14 +947,9 @@ delete_dataset_row_filter_variable_options = [
|
|
|
1080
947
|
|
|
1081
948
|
|
|
1082
949
|
def update_dataset_rows_file(option_list: list):
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
for option_flag, option_arg in option_list:
|
|
1087
|
-
if option_flag.name == "dataset_id":
|
|
1088
|
-
dataset_id = option_arg
|
|
1089
|
-
if option_flag.name == "dataset_rows_file":
|
|
1090
|
-
dataset_rows_file = option_arg
|
|
950
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
951
|
+
dataset_id = opts.get("dataset_id")
|
|
952
|
+
dataset_rows_file = opts.get("dataset_rows_file")
|
|
1091
953
|
|
|
1092
954
|
if not (dataset_id and dataset_rows_file):
|
|
1093
955
|
raise MissingRequirementException("Cannot upload dataset rows file without specifying id of dataset, rows file")
|
|
@@ -1128,30 +990,17 @@ def list_evaluation_plans():
|
|
|
1128
990
|
|
|
1129
991
|
|
|
1130
992
|
def create_evaluation_plan(option_list: list):
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
993
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
994
|
+
evaluation_plan_name = opts.get("evaluation_plan_name")
|
|
995
|
+
evaluation_plan_type = opts.get("evaluation_plan_type")
|
|
996
|
+
evaluation_plan_assistant_id = opts.get("evaluation_plan_assistant_id")
|
|
997
|
+
evaluation_plan_assistant_name = opts.get("evaluation_plan_assistant_name")
|
|
998
|
+
evaluation_plan_assistant_revision = opts.get("evaluation_plan_assistant_revision")
|
|
999
|
+
evaluation_plan_profile_name = opts.get("evaluation_plan_profile_name")
|
|
1000
|
+
dataset_id = opts.get("dataset_id")
|
|
1001
|
+
system_metrics = []
|
|
1139
1002
|
|
|
1140
1003
|
for option_flag, option_arg in option_list:
|
|
1141
|
-
if option_flag.name == "evaluation_plan_name":
|
|
1142
|
-
evaluation_plan_name = option_arg
|
|
1143
|
-
if option_flag.name == "evaluation_plan_type":
|
|
1144
|
-
evaluation_plan_type = option_arg
|
|
1145
|
-
if option_flag.name == "evaluation_plan_assistant_id":
|
|
1146
|
-
evaluation_plan_assistant_id = option_arg
|
|
1147
|
-
if option_flag.name == "evaluation_plan_assistant_name":
|
|
1148
|
-
evaluation_plan_assistant_name = option_arg
|
|
1149
|
-
if option_flag.name == "evaluation_plan_assistant_revision":
|
|
1150
|
-
evaluation_plan_assistant_revision = option_arg
|
|
1151
|
-
if option_flag.name == "evaluation_plan_profile_name":
|
|
1152
|
-
evaluation_plan_profile_name = option_arg
|
|
1153
|
-
if option_flag.name == "dataset_id":
|
|
1154
|
-
dataset_id = option_arg
|
|
1155
1004
|
if option_flag.name == "system_metrics":
|
|
1156
1005
|
try:
|
|
1157
1006
|
metrics_json = json.loads(option_arg)
|
|
@@ -1241,11 +1090,8 @@ create_evaluation_plan_options = [
|
|
|
1241
1090
|
|
|
1242
1091
|
|
|
1243
1092
|
def get_evaluation_plan(option_list: list):
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
for option_flag, option_arg in option_list:
|
|
1247
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1248
|
-
evaluation_plan_id = option_arg
|
|
1093
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1094
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1249
1095
|
|
|
1250
1096
|
if not evaluation_plan_id:
|
|
1251
1097
|
raise MissingRequirementException("Cannot get evaluation plan without specifying id")
|
|
@@ -1268,33 +1114,18 @@ get_evaluation_plan_options = [
|
|
|
1268
1114
|
|
|
1269
1115
|
|
|
1270
1116
|
def update_evaluation_plan(option_list: list):
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1117
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1118
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1119
|
+
evaluation_plan_name = opts.get("evaluation_plan_name")
|
|
1120
|
+
evaluation_plan_type = opts.get("evaluation_plan_type")
|
|
1121
|
+
evaluation_plan_assistant_id = opts.get("evaluation_plan_assistant_id")
|
|
1122
|
+
evaluation_plan_assistant_name = opts.get("evaluation_plan_assistant_name")
|
|
1123
|
+
evaluation_plan_assistant_revision = opts.get("evaluation_plan_assistant_revision")
|
|
1124
|
+
evaluation_plan_profile_name = opts.get("evaluation_plan_profile_name")
|
|
1125
|
+
dataset_id = opts.get("dataset_id")
|
|
1126
|
+
system_metrics = []
|
|
1280
1127
|
|
|
1281
1128
|
for option_flag, option_arg in option_list:
|
|
1282
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1283
|
-
evaluation_plan_id = option_arg
|
|
1284
|
-
if option_flag.name == "evaluation_plan_name":
|
|
1285
|
-
evaluation_plan_name = option_arg
|
|
1286
|
-
if option_flag.name == "evaluation_plan_type":
|
|
1287
|
-
evaluation_plan_type = option_arg
|
|
1288
|
-
if option_flag.name == "evaluation_plan_assistant_id":
|
|
1289
|
-
evaluation_plan_assistant_id = option_arg
|
|
1290
|
-
if option_flag.name == "evaluation_plan_assistant_name":
|
|
1291
|
-
evaluation_plan_assistant_name = option_arg
|
|
1292
|
-
if option_flag.name == "evaluation_plan_assistant_revision":
|
|
1293
|
-
evaluation_plan_assistant_revision = option_arg
|
|
1294
|
-
if option_flag.name == "evaluation_plan_profile_name":
|
|
1295
|
-
evaluation_plan_profile_name = option_arg
|
|
1296
|
-
if option_flag.name == "dataset_id":
|
|
1297
|
-
dataset_id = option_arg
|
|
1298
1129
|
if option_flag.name == "system_metrics":
|
|
1299
1130
|
try:
|
|
1300
1131
|
metrics_json = json.loads(option_arg)
|
|
@@ -1390,11 +1221,8 @@ update_evaluation_plan_options = [
|
|
|
1390
1221
|
|
|
1391
1222
|
|
|
1392
1223
|
def delete_evaluation_plan(option_list: list):
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
for option_flag, option_arg in option_list:
|
|
1396
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1397
|
-
evaluation_plan_id = option_arg
|
|
1224
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1225
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1398
1226
|
|
|
1399
1227
|
if not evaluation_plan_id:
|
|
1400
1228
|
raise MissingRequirementException("Cannot delete evaluation plan without specifying id")
|
|
@@ -1417,11 +1245,8 @@ delete_evaluation_plan_options = [
|
|
|
1417
1245
|
|
|
1418
1246
|
|
|
1419
1247
|
def list_evaluation_plan_system_metrics(option_list: list):
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
for option_flag, option_arg in option_list:
|
|
1423
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1424
|
-
evaluation_plan_id = option_arg
|
|
1248
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1249
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1425
1250
|
|
|
1426
1251
|
if not evaluation_plan_id:
|
|
1427
1252
|
raise MissingRequirementException("Cannot list evaluation plan's system metrics without specifying id")
|
|
@@ -1444,17 +1269,10 @@ list_evaluation_plan_system_metrics_options = [
|
|
|
1444
1269
|
|
|
1445
1270
|
|
|
1446
1271
|
def add_evaluation_plan_system_metric(option_list: list):
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
for option_flag, option_arg in option_list:
|
|
1452
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1453
|
-
evaluation_plan_id = option_arg
|
|
1454
|
-
if option_flag.name == "system_metric_id":
|
|
1455
|
-
system_metric_id = option_arg
|
|
1456
|
-
if option_flag.name == "system_metric_weight":
|
|
1457
|
-
system_metric_weight = option_arg
|
|
1272
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1273
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1274
|
+
system_metric_id = opts.get("system_metric_id")
|
|
1275
|
+
system_metric_weight = opts.get("system_metric_weight")
|
|
1458
1276
|
|
|
1459
1277
|
if not evaluation_plan_id:
|
|
1460
1278
|
raise MissingRequirementException("Cannot add evaluation plan's system metrics without specifying id")
|
|
@@ -1492,14 +1310,9 @@ add_evaluation_plan_system_metric_options = [
|
|
|
1492
1310
|
|
|
1493
1311
|
|
|
1494
1312
|
def get_evaluation_plan_system_metric(option_list: list):
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
for option_flag, option_arg in option_list:
|
|
1499
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1500
|
-
evaluation_plan_id = option_arg
|
|
1501
|
-
if option_flag.name == "system_metric_id":
|
|
1502
|
-
system_metric_id = option_arg
|
|
1313
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1314
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1315
|
+
system_metric_id = opts.get("system_metric_id")
|
|
1503
1316
|
|
|
1504
1317
|
if not (evaluation_plan_id and system_metric_id):
|
|
1505
1318
|
raise MissingRequirementException("Cannot retrieve evaluation plan's system metric without specifying both ids")
|
|
@@ -1529,17 +1342,10 @@ get_evaluation_plan_system_metric_options = [
|
|
|
1529
1342
|
|
|
1530
1343
|
|
|
1531
1344
|
def update_evaluation_plan_system_metric(option_list: list):
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
for option_flag, option_arg in option_list:
|
|
1537
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1538
|
-
evaluation_plan_id = option_arg
|
|
1539
|
-
if option_flag.name == "system_metric_id":
|
|
1540
|
-
system_metric_id = option_arg
|
|
1541
|
-
if option_flag.name == "system_metric_weight":
|
|
1542
|
-
system_metric_weight = option_arg
|
|
1345
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1346
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1347
|
+
system_metric_id = opts.get("system_metric_id")
|
|
1348
|
+
system_metric_weight = opts.get("system_metric_weight")
|
|
1543
1349
|
|
|
1544
1350
|
if not evaluation_plan_id:
|
|
1545
1351
|
raise MissingRequirementException("Cannot update evaluation plan's system metrics without specifying both ids and weight")
|
|
@@ -1577,14 +1383,9 @@ update_evaluation_plan_system_metric_options = [
|
|
|
1577
1383
|
|
|
1578
1384
|
|
|
1579
1385
|
def delete_evaluation_plan_system_metric(option_list: list):
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
for option_flag, option_arg in option_list:
|
|
1584
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1585
|
-
evaluation_plan_id = option_arg
|
|
1586
|
-
if option_flag.name == "system_metric_id":
|
|
1587
|
-
system_metric_id = option_arg
|
|
1386
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1387
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1388
|
+
system_metric_id = opts.get("system_metric_id")
|
|
1588
1389
|
|
|
1589
1390
|
if not (evaluation_plan_id and system_metric_id):
|
|
1590
1391
|
raise MissingRequirementException("Cannot delete evaluation plan's system metric without specifying both ids")
|
|
@@ -1620,11 +1421,8 @@ def list_system_metrics():
|
|
|
1620
1421
|
|
|
1621
1422
|
|
|
1622
1423
|
def get_system_metric(option_list: list):
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
for option_flag, option_arg in option_list:
|
|
1626
|
-
if option_flag.name == "system_metric_id":
|
|
1627
|
-
system_metric_id = option_arg
|
|
1424
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1425
|
+
system_metric_id = opts.get("system_metric_id")
|
|
1628
1426
|
|
|
1629
1427
|
if not system_metric_id:
|
|
1630
1428
|
raise MissingRequirementException("Cannot retrieve system metric without specifying id")
|
|
@@ -1647,11 +1445,8 @@ get_system_metric_options = [
|
|
|
1647
1445
|
|
|
1648
1446
|
|
|
1649
1447
|
def execute_evaluation_plan(option_list: list):
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
for option_flag, option_arg in option_list:
|
|
1653
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1654
|
-
evaluation_plan_id = option_arg
|
|
1448
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1449
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1655
1450
|
|
|
1656
1451
|
if not evaluation_plan_id:
|
|
1657
1452
|
raise MissingRequirementException("Cannot execute evaluation plan without specifying id")
|
|
@@ -1678,11 +1473,8 @@ execute_evaluation_plan_options = [
|
|
|
1678
1473
|
|
|
1679
1474
|
|
|
1680
1475
|
def list_evaluation_results(option_list: list):
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
for option_flag, option_arg in option_list:
|
|
1684
|
-
if option_flag.name == "evaluation_plan_id":
|
|
1685
|
-
evaluation_plan_id = option_arg
|
|
1476
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1477
|
+
evaluation_plan_id = opts.get("evaluation_plan_id")
|
|
1686
1478
|
|
|
1687
1479
|
if not evaluation_plan_id:
|
|
1688
1480
|
raise MissingRequirementException("Cannot list evaluation results without specifying id")
|
|
@@ -1705,11 +1497,8 @@ list_evaluation_results_options = [
|
|
|
1705
1497
|
|
|
1706
1498
|
|
|
1707
1499
|
def get_evaluation_result(option_list: list):
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
for option_flag, option_arg in option_list:
|
|
1711
|
-
if option_flag.name == "evaluation_result_id":
|
|
1712
|
-
evaluation_result_id = option_arg
|
|
1500
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
1501
|
+
evaluation_result_id = opts.get("evaluation_result_id")
|
|
1713
1502
|
|
|
1714
1503
|
if not evaluation_result_id:
|
|
1715
1504
|
raise MissingRequirementException("Cannot get evaluation results without specifying id")
|