Py4HEAppE 1.0.0__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.
- __init__.py +1 -0
- py4heappe/__init__.py +1 -0
- py4heappe/cli/__init__.py +1 -0
- py4heappe/cli/auth.py +153 -0
- py4heappe/cli/command_template.py +370 -0
- py4heappe/cli/configuration.py +65 -0
- py4heappe/cli/information.py +163 -0
- py4heappe/cli/job_management.py +211 -0
- py4heappe/cli/report.py +173 -0
- py4heappe/core/__init__.py +167 -0
- py4heappe/core/api/__init__.py +12 -0
- py4heappe/core/api/cluster_information_api.py +308 -0
- py4heappe/core/api/data_transfer_api.py +405 -0
- py4heappe/core/api/file_transfer_api.py +498 -0
- py4heappe/core/api/job_management_api.py +866 -0
- py4heappe/core/api/job_reporting_api.py +692 -0
- py4heappe/core/api/management_api.py +2540 -0
- py4heappe/core/api/user_and_limitation_management_api.py +676 -0
- py4heappe/core/api_client.py +632 -0
- py4heappe/core/base/__init__.py +1 -0
- py4heappe/core/base/exceptions.py +41 -0
- py4heappe/core/base/logger.py +11 -0
- py4heappe/core/base/utils.py +43 -0
- py4heappe/core/configuration.py +247 -0
- py4heappe/core/models/__init__.py +155 -0
- py4heappe/core/models/adaptor_user.py +398 -0
- py4heappe/core/models/adaptor_user_group.py +268 -0
- py4heappe/core/models/adaptor_user_role.py +242 -0
- py4heappe/core/models/adaptor_user_role_ext.py +138 -0
- py4heappe/core/models/adaptor_user_role_type.py +95 -0
- py4heappe/core/models/adaptor_user_type.py +91 -0
- py4heappe/core/models/adaptor_user_user_group_role.py +320 -0
- py4heappe/core/models/allocated_nodes_ips_model.py +136 -0
- py4heappe/core/models/authenticate_lexis_token_model.py +110 -0
- py4heappe/core/models/authenticate_user_digital_signature_model.py +110 -0
- py4heappe/core/models/authenticate_user_open_id_model.py +110 -0
- py4heappe/core/models/authenticate_user_open_id_open_stack_model.py +136 -0
- py4heappe/core/models/authenticate_user_password_model.py +110 -0
- py4heappe/core/models/authentication_credentials.py +110 -0
- py4heappe/core/models/bad_request_result.py +110 -0
- py4heappe/core/models/cancel_job_model.py +136 -0
- py4heappe/core/models/cluster.py +478 -0
- py4heappe/core/models/cluster_authentication_credentials.py +375 -0
- py4heappe/core/models/cluster_authentication_credentials_auth_type.py +97 -0
- py4heappe/core/models/cluster_connection_protocol.py +91 -0
- py4heappe/core/models/cluster_detailed_report_ext.py +214 -0
- py4heappe/core/models/cluster_ext.py +188 -0
- py4heappe/core/models/cluster_init_report_ext.py +136 -0
- py4heappe/core/models/cluster_node_type.py +528 -0
- py4heappe/core/models/cluster_node_type_detailed_report_ext.py +240 -0
- py4heappe/core/models/cluster_node_type_ext.py +292 -0
- py4heappe/core/models/cluster_node_type_for_task_ext.py +188 -0
- py4heappe/core/models/cluster_node_type_report_ext.py +214 -0
- py4heappe/core/models/cluster_node_type_requested_group.py +136 -0
- py4heappe/core/models/cluster_node_type_resource_usage_ext.py +292 -0
- py4heappe/core/models/cluster_node_usage_ext.py +318 -0
- py4heappe/core/models/cluster_project.py +347 -0
- py4heappe/core/models/cluster_project_credential.py +294 -0
- py4heappe/core/models/cluster_proxy_connection.py +243 -0
- py4heappe/core/models/cluster_proxy_connection_ext.py +214 -0
- py4heappe/core/models/cluster_report_ext.py +215 -0
- py4heappe/core/models/command_template.py +557 -0
- py4heappe/core/models/command_template_ext.py +240 -0
- py4heappe/core/models/command_template_parameter.py +347 -0
- py4heappe/core/models/command_template_parameter_ext.py +136 -0
- py4heappe/core/models/command_template_parameter_value_ext.py +136 -0
- py4heappe/core/models/contact.py +269 -0
- py4heappe/core/models/copy_job_data_from_temp_model.py +162 -0
- py4heappe/core/models/copy_job_data_to_temp_model.py +162 -0
- py4heappe/core/models/create_command_inner_template_parameter_model.py +162 -0
- py4heappe/core/models/create_command_template_from_generic_model.py +292 -0
- py4heappe/core/models/create_command_template_model.py +318 -0
- py4heappe/core/models/create_command_template_parameter_model.py +214 -0
- py4heappe/core/models/create_job_by_project_model.py +136 -0
- py4heappe/core/models/create_project_assignment_to_cluster_model.py +188 -0
- py4heappe/core/models/create_project_model.py +318 -0
- py4heappe/core/models/create_secure_shell_key_model.py +162 -0
- py4heappe/core/models/create_secure_shell_key_model_obsolete.py +188 -0
- py4heappe/core/models/current_cluster_node_usage_model.py +136 -0
- py4heappe/core/models/current_info_for_job_model.py +136 -0
- py4heappe/core/models/data_transfer_method_ext.py +188 -0
- py4heappe/core/models/delete_job_model.py +136 -0
- py4heappe/core/models/deployment_type_ext.py +91 -0
- py4heappe/core/models/digital_signature_credentials_ext.py +162 -0
- py4heappe/core/models/download_file_from_cluster_model.py +162 -0
- py4heappe/core/models/download_parts_of_job_files_from_cluster_model.py +162 -0
- py4heappe/core/models/end_data_transfer_model.py +136 -0
- py4heappe/core/models/end_file_transfer_model.py +162 -0
- py4heappe/core/models/environment_variable_ext.py +136 -0
- py4heappe/core/models/extended_command_template_ext.py +370 -0
- py4heappe/core/models/extended_command_template_parameter_ext.py +188 -0
- py4heappe/core/models/extended_project_info_ext.py +318 -0
- py4heappe/core/models/file_information_ext.py +136 -0
- py4heappe/core/models/file_transfer_cipher_type.py +94 -0
- py4heappe/core/models/file_transfer_cipher_type_ext.py +93 -0
- py4heappe/core/models/file_transfer_key_credentials_ext.py +240 -0
- py4heappe/core/models/file_transfer_method.py +294 -0
- py4heappe/core/models/file_transfer_method_ext.py +240 -0
- py4heappe/core/models/file_transfer_protocol.py +91 -0
- py4heappe/core/models/file_transfer_protocol_ext.py +91 -0
- py4heappe/core/models/get_command_template_parameters_name_model.py +188 -0
- py4heappe/core/models/get_current_usage_and_limitations_for_current_user_model.py +110 -0
- py4heappe/core/models/get_data_transfer_method_model.py +188 -0
- py4heappe/core/models/get_file_transfer_method_model.py +136 -0
- py4heappe/core/models/http_get_to_job_node_model.py +241 -0
- py4heappe/core/models/http_header_ext.py +136 -0
- py4heappe/core/models/http_post_to_job_node_model.py +267 -0
- py4heappe/core/models/initialize_cluster_script_directory_model.py +162 -0
- py4heappe/core/models/instance_information_ext.py +344 -0
- py4heappe/core/models/job_detailed_report_ext.py +318 -0
- py4heappe/core/models/job_file_content_ext.py +214 -0
- py4heappe/core/models/job_report_ext.py +188 -0
- py4heappe/core/models/job_specification_by_project_ext.py +448 -0
- py4heappe/core/models/job_specification_ext.py +448 -0
- py4heappe/core/models/job_state_aggregation_report_ext.py +162 -0
- py4heappe/core/models/job_state_ext.py +96 -0
- py4heappe/core/models/lexis_credentials_ext.py +137 -0
- py4heappe/core/models/list_changed_files_for_job_model.py +136 -0
- py4heappe/core/models/list_jobs_for_current_user_model.py +110 -0
- py4heappe/core/models/modify_command_template_from_generic_model.py +292 -0
- py4heappe/core/models/modify_command_template_model.py +292 -0
- py4heappe/core/models/modify_command_template_parameter_model.py +214 -0
- py4heappe/core/models/modify_project_assignment_to_cluster_model.py +188 -0
- py4heappe/core/models/modify_project_model.py +292 -0
- py4heappe/core/models/node_used_cores_and_limitation_ext.py +110 -0
- py4heappe/core/models/open_id_credentials_ext.py +137 -0
- py4heappe/core/models/open_stack_application_credentials_ext.py +136 -0
- py4heappe/core/models/password_credentials_ext.py +136 -0
- py4heappe/core/models/problem_details.py +89 -0
- py4heappe/core/models/project.py +482 -0
- py4heappe/core/models/project_contact.py +215 -0
- py4heappe/core/models/project_detailed_report_ext.py +292 -0
- py4heappe/core/models/project_ext.py +266 -0
- py4heappe/core/models/project_for_task_ext.py +214 -0
- py4heappe/core/models/project_list_report_ext.py +214 -0
- py4heappe/core/models/project_reference_ext.py +137 -0
- py4heappe/core/models/project_report_ext.py +240 -0
- py4heappe/core/models/project_resource_usage_ext.py +266 -0
- py4heappe/core/models/proxy_type.py +91 -0
- py4heappe/core/models/proxy_type_ext.py +91 -0
- py4heappe/core/models/public_key_ext.py +188 -0
- py4heappe/core/models/recreate_secure_shell_key_model.py +214 -0
- py4heappe/core/models/regenerate_secure_shell_key_model.py +188 -0
- py4heappe/core/models/regenerate_secure_shell_key_model_obsolete.py +188 -0
- py4heappe/core/models/remove_command_template_model.py +136 -0
- py4heappe/core/models/remove_command_template_parameter_model.py +136 -0
- py4heappe/core/models/remove_project_assignment_to_cluster_model.py +162 -0
- py4heappe/core/models/remove_project_model.py +136 -0
- py4heappe/core/models/remove_secure_shell_key_model.py +162 -0
- py4heappe/core/models/remove_secure_shell_key_model_obsolete.py +162 -0
- py4heappe/core/models/resource_allocation_type_ext.py +91 -0
- py4heappe/core/models/resource_limitation_ext.py +136 -0
- py4heappe/core/models/resource_usage_ext.py +163 -0
- py4heappe/core/models/scheduler_type.py +92 -0
- py4heappe/core/models/ssh_key_user_credentials_model.py +136 -0
- py4heappe/core/models/submit_job_model.py +136 -0
- py4heappe/core/models/submitted_job_info_ext.py +318 -0
- py4heappe/core/models/submitted_task_info_ext.py +370 -0
- py4heappe/core/models/synchronizable_files_ext.py +92 -0
- py4heappe/core/models/task_detailed_report_ext.py +318 -0
- py4heappe/core/models/task_file_offset_ext.py +162 -0
- py4heappe/core/models/task_paralization_parameter_ext.py +162 -0
- py4heappe/core/models/task_priority_ext.py +97 -0
- py4heappe/core/models/task_report_ext.py +266 -0
- py4heappe/core/models/task_specification_ext.py +682 -0
- py4heappe/core/models/task_state_ext.py +95 -0
- py4heappe/core/models/test_cluster_access_for_account_model.py +162 -0
- py4heappe/core/models/test_cluster_access_for_account_model_obsolete.py +162 -0
- py4heappe/core/models/unauthorized_result.py +110 -0
- py4heappe/core/models/usage_type.py +90 -0
- py4heappe/core/models/usage_type_ext.py +90 -0
- py4heappe/core/models/user_group_detailed_report_ext.py +240 -0
- py4heappe/core/models/user_group_list_report_ext.py +240 -0
- py4heappe/core/models/user_group_report_ext.py +240 -0
- py4heappe/core/models/version_information_ext.py +162 -0
- py4heappe/core/rest.py +311 -0
- py4heappe-1.0.0.dist-info/METADATA +147 -0
- py4heappe-1.0.0.dist-info/RECORD +183 -0
- py4heappe-1.0.0.dist-info/WHEEL +5 -0
- py4heappe-1.0.0.dist-info/entry_points.txt +2 -0
- py4heappe-1.0.0.dist-info/licenses/LICENSE +20 -0
- py4heappe-1.0.0.dist-info/top_level.txt +3 -0
- py4heappe_cli.py +22 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import platform
|
|
3
|
+
import subprocess
|
|
4
|
+
|
|
5
|
+
from py4heappe.core.base import exceptions
|
|
6
|
+
from py4heappe.core.base.logger import logger
|
|
7
|
+
|
|
8
|
+
def print_and_log(message: str):
|
|
9
|
+
print(message)
|
|
10
|
+
logger.info(message)
|
|
11
|
+
|
|
12
|
+
def get_user_shell_for_platform():
|
|
13
|
+
current_platform=platform.system()
|
|
14
|
+
if current_platform == "Linux" or current_platform == "Darwin":
|
|
15
|
+
# Use bash for Linux and macOS (Darwin is the name for macOS)
|
|
16
|
+
return "bash"
|
|
17
|
+
elif current_platform == "Windows":
|
|
18
|
+
return "powershell"
|
|
19
|
+
else:
|
|
20
|
+
raise exceptions.Py4HEAppEInternalException(f"Unsupported platform: {current_platform}") from None
|
|
21
|
+
|
|
22
|
+
def store_session(sessionCode: str):
|
|
23
|
+
try:
|
|
24
|
+
if sessionCode is None:
|
|
25
|
+
raise exceptions.Py4HEAppEInternalException("Problem occurs with authentication to HEAppE instance.") from None
|
|
26
|
+
|
|
27
|
+
environment_snapshot: dict = os.environ
|
|
28
|
+
environment_snapshot.update({"sessionCode": sessionCode})
|
|
29
|
+
subprocess.call(get_user_shell_for_platform(), env=environment_snapshot)
|
|
30
|
+
|
|
31
|
+
except exceptions.Py4HEAppEInternalException as exception:
|
|
32
|
+
raise exceptions.Py4HEAppEInternalException(exception.message) from None
|
|
33
|
+
|
|
34
|
+
except Exception:
|
|
35
|
+
raise exceptions.Py4HEAppEInternalException("Problem occurs during storing HEAppE sessionCode into variable.") from None
|
|
36
|
+
|
|
37
|
+
def load_stored_session():
|
|
38
|
+
sessionCode: str = os.environ.get("sessionCode")
|
|
39
|
+
|
|
40
|
+
if sessionCode is None:
|
|
41
|
+
raise exceptions.Py4HEAppEInternalException("Session for HEAppE instance does not exist! You have to authenticate to HEAppE instance.") from None
|
|
42
|
+
|
|
43
|
+
return sessionCode
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
HEAppE Web API
|
|
5
|
+
|
|
6
|
+
HEAppE middleware API v4.2.1 # noqa: E501
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: v4.2.1
|
|
9
|
+
Contact: support.heappe@it4i.cz
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import absolute_import
|
|
14
|
+
|
|
15
|
+
import copy
|
|
16
|
+
import logging
|
|
17
|
+
import multiprocessing
|
|
18
|
+
import sys
|
|
19
|
+
import urllib3
|
|
20
|
+
|
|
21
|
+
import six
|
|
22
|
+
from six.moves import http_client as httplib
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class TypeWithDefault(type):
|
|
26
|
+
def __init__(cls, name, bases, dct):
|
|
27
|
+
super(TypeWithDefault, cls).__init__(name, bases, dct)
|
|
28
|
+
cls._default = None
|
|
29
|
+
|
|
30
|
+
def __call__(cls):
|
|
31
|
+
if cls._default is None:
|
|
32
|
+
cls._default = type.__call__(cls)
|
|
33
|
+
return copy.copy(cls._default)
|
|
34
|
+
|
|
35
|
+
def set_default(cls, default):
|
|
36
|
+
cls._default = copy.copy(default)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|
40
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
41
|
+
|
|
42
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
43
|
+
Do not edit the class manually.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(self):
|
|
47
|
+
"""Constructor"""
|
|
48
|
+
# Default Base url
|
|
49
|
+
self.host = "https://heappe.it4i.cz/development"
|
|
50
|
+
# Temp file folder for downloading files
|
|
51
|
+
self.temp_folder_path = None
|
|
52
|
+
|
|
53
|
+
# Authentication Settings
|
|
54
|
+
# dict to store API key(s)
|
|
55
|
+
self.api_key = {}
|
|
56
|
+
# dict to store API prefix (e.g. Bearer)
|
|
57
|
+
self.api_key_prefix = {}
|
|
58
|
+
# function to refresh API key if expired
|
|
59
|
+
self.refresh_api_key_hook = None
|
|
60
|
+
# Username for HTTP basic authentication
|
|
61
|
+
self.username = ""
|
|
62
|
+
# Password for HTTP basic authentication
|
|
63
|
+
self.password = ""
|
|
64
|
+
# Logging Settings
|
|
65
|
+
self.logger = {}
|
|
66
|
+
self.logger["package_logger"] = logging.getLogger("heappeac_v4")
|
|
67
|
+
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
|
68
|
+
# Log format
|
|
69
|
+
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
|
70
|
+
# Log stream handler
|
|
71
|
+
self.logger_stream_handler = None
|
|
72
|
+
# Log file handler
|
|
73
|
+
self.logger_file_handler = None
|
|
74
|
+
# Debug file location
|
|
75
|
+
self.logger_file = None
|
|
76
|
+
# Debug switch
|
|
77
|
+
self.debug = False
|
|
78
|
+
|
|
79
|
+
# SSL/TLS verification
|
|
80
|
+
# Set this to false to skip verifying SSL certificate when calling API
|
|
81
|
+
# from https server.
|
|
82
|
+
self.verify_ssl = True
|
|
83
|
+
# Set this to customize the certificate file to verify the peer.
|
|
84
|
+
self.ssl_ca_cert = None
|
|
85
|
+
# client certificate file
|
|
86
|
+
self.cert_file = None
|
|
87
|
+
# client key file
|
|
88
|
+
self.key_file = None
|
|
89
|
+
# Set this to True/False to enable/disable SSL hostname verification.
|
|
90
|
+
self.assert_hostname = None
|
|
91
|
+
|
|
92
|
+
# urllib3 connection pool's maximum number of connections saved
|
|
93
|
+
# per pool. urllib3 uses 1 connection as default value, but this is
|
|
94
|
+
# not the best value when you are making a lot of possibly parallel
|
|
95
|
+
# requests to the same host, which is often the case here.
|
|
96
|
+
# cpu_count * 5 is used as default value to increase performance.
|
|
97
|
+
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
|
98
|
+
|
|
99
|
+
# Proxy URL
|
|
100
|
+
self.proxy = None
|
|
101
|
+
# Safe chars for path_param
|
|
102
|
+
self.safe_chars_for_path_param = ''
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def logger_file(self):
|
|
106
|
+
"""The logger file.
|
|
107
|
+
|
|
108
|
+
If the logger_file is None, then add stream handler and remove file
|
|
109
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
110
|
+
|
|
111
|
+
:param value: The logger_file path.
|
|
112
|
+
:type: str
|
|
113
|
+
"""
|
|
114
|
+
return self.__logger_file
|
|
115
|
+
|
|
116
|
+
@logger_file.setter
|
|
117
|
+
def logger_file(self, value):
|
|
118
|
+
"""The logger file.
|
|
119
|
+
|
|
120
|
+
If the logger_file is None, then add stream handler and remove file
|
|
121
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
122
|
+
|
|
123
|
+
:param value: The logger_file path.
|
|
124
|
+
:type: str
|
|
125
|
+
"""
|
|
126
|
+
self.__logger_file = value
|
|
127
|
+
if self.__logger_file:
|
|
128
|
+
# If set logging file,
|
|
129
|
+
# then add file handler and remove stream handler.
|
|
130
|
+
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
|
131
|
+
self.logger_file_handler.setFormatter(self.logger_formatter)
|
|
132
|
+
for _, logger in six.iteritems(self.logger):
|
|
133
|
+
logger.addHandler(self.logger_file_handler)
|
|
134
|
+
if self.logger_stream_handler:
|
|
135
|
+
logger.removeHandler(self.logger_stream_handler)
|
|
136
|
+
else:
|
|
137
|
+
# If not set logging file,
|
|
138
|
+
# then add stream handler and remove file handler.
|
|
139
|
+
self.logger_stream_handler = logging.StreamHandler()
|
|
140
|
+
self.logger_stream_handler.setFormatter(self.logger_formatter)
|
|
141
|
+
for _, logger in six.iteritems(self.logger):
|
|
142
|
+
logger.addHandler(self.logger_stream_handler)
|
|
143
|
+
if self.logger_file_handler:
|
|
144
|
+
logger.removeHandler(self.logger_file_handler)
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def debug(self):
|
|
148
|
+
"""Debug status
|
|
149
|
+
|
|
150
|
+
:param value: The debug status, True or False.
|
|
151
|
+
:type: bool
|
|
152
|
+
"""
|
|
153
|
+
return self.__debug
|
|
154
|
+
|
|
155
|
+
@debug.setter
|
|
156
|
+
def debug(self, value):
|
|
157
|
+
"""Debug status
|
|
158
|
+
|
|
159
|
+
:param value: The debug status, True or False.
|
|
160
|
+
:type: bool
|
|
161
|
+
"""
|
|
162
|
+
self.__debug = value
|
|
163
|
+
if self.__debug:
|
|
164
|
+
# if debug status is True, turn on debug logging
|
|
165
|
+
for _, logger in six.iteritems(self.logger):
|
|
166
|
+
logger.setLevel(logging.DEBUG)
|
|
167
|
+
# turn on httplib debug
|
|
168
|
+
httplib.HTTPConnection.debuglevel = 1
|
|
169
|
+
else:
|
|
170
|
+
# if debug status is False, turn off debug logging,
|
|
171
|
+
# setting log level to default `logging.WARNING`
|
|
172
|
+
for _, logger in six.iteritems(self.logger):
|
|
173
|
+
logger.setLevel(logging.WARNING)
|
|
174
|
+
# turn off httplib debug
|
|
175
|
+
httplib.HTTPConnection.debuglevel = 0
|
|
176
|
+
|
|
177
|
+
@property
|
|
178
|
+
def logger_format(self):
|
|
179
|
+
"""The logger format.
|
|
180
|
+
|
|
181
|
+
The logger_formatter will be updated when sets logger_format.
|
|
182
|
+
|
|
183
|
+
:param value: The format string.
|
|
184
|
+
:type: str
|
|
185
|
+
"""
|
|
186
|
+
return self.__logger_format
|
|
187
|
+
|
|
188
|
+
@logger_format.setter
|
|
189
|
+
def logger_format(self, value):
|
|
190
|
+
"""The logger format.
|
|
191
|
+
|
|
192
|
+
The logger_formatter will be updated when sets logger_format.
|
|
193
|
+
|
|
194
|
+
:param value: The format string.
|
|
195
|
+
:type: str
|
|
196
|
+
"""
|
|
197
|
+
self.__logger_format = value
|
|
198
|
+
self.logger_formatter = logging.Formatter(self.__logger_format)
|
|
199
|
+
|
|
200
|
+
def get_api_key_with_prefix(self, identifier):
|
|
201
|
+
"""Gets API key (with prefix if set).
|
|
202
|
+
|
|
203
|
+
:param identifier: The identifier of apiKey.
|
|
204
|
+
:return: The token for api key authentication.
|
|
205
|
+
"""
|
|
206
|
+
if self.refresh_api_key_hook:
|
|
207
|
+
self.refresh_api_key_hook(self)
|
|
208
|
+
|
|
209
|
+
key = self.api_key.get(identifier)
|
|
210
|
+
if key:
|
|
211
|
+
prefix = self.api_key_prefix.get(identifier)
|
|
212
|
+
if prefix:
|
|
213
|
+
return "%s %s" % (prefix, key)
|
|
214
|
+
else:
|
|
215
|
+
return key
|
|
216
|
+
|
|
217
|
+
def get_basic_auth_token(self):
|
|
218
|
+
"""Gets HTTP basic authentication header (string).
|
|
219
|
+
|
|
220
|
+
:return: The token for basic HTTP authentication.
|
|
221
|
+
"""
|
|
222
|
+
token = ""
|
|
223
|
+
if self.username or self.password:
|
|
224
|
+
token = urllib3.util.make_headers(
|
|
225
|
+
basic_auth=self.username + ':' + self.password
|
|
226
|
+
).get('authorization')
|
|
227
|
+
return token
|
|
228
|
+
|
|
229
|
+
def auth_settings(self):
|
|
230
|
+
"""Gets Auth Settings dict for api client.
|
|
231
|
+
|
|
232
|
+
:return: The Auth Settings information dict.
|
|
233
|
+
"""
|
|
234
|
+
return {
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
def to_debug_report(self):
|
|
238
|
+
"""Gets the essential information for debugging.
|
|
239
|
+
|
|
240
|
+
:return: The report for debugging.
|
|
241
|
+
"""
|
|
242
|
+
return "Python SDK Debug Report:\n"\
|
|
243
|
+
"OS: {env}\n"\
|
|
244
|
+
"Python Version: {pyversion}\n"\
|
|
245
|
+
"Version of the API: v4.2.1\n"\
|
|
246
|
+
"SDK Package Version: 1.0.0".\
|
|
247
|
+
format(env=sys.platform, pyversion=sys.version)
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
HEAppE Web API
|
|
6
|
+
|
|
7
|
+
HEAppE middleware API v4.2.1 # noqa: E501
|
|
8
|
+
|
|
9
|
+
OpenAPI spec version: v4.2.1
|
|
10
|
+
Contact: support.heappe@it4i.cz
|
|
11
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import absolute_import
|
|
15
|
+
|
|
16
|
+
# import models into model package
|
|
17
|
+
from py4heappe.core.models.adaptor_user import AdaptorUser
|
|
18
|
+
from py4heappe.core.models.adaptor_user_group import AdaptorUserGroup
|
|
19
|
+
from py4heappe.core.models.adaptor_user_role import AdaptorUserRole
|
|
20
|
+
from py4heappe.core.models.adaptor_user_role_ext import AdaptorUserRoleExt
|
|
21
|
+
from py4heappe.core.models.adaptor_user_role_type import AdaptorUserRoleType
|
|
22
|
+
from py4heappe.core.models.adaptor_user_type import AdaptorUserType
|
|
23
|
+
from py4heappe.core.models.adaptor_user_user_group_role import AdaptorUserUserGroupRole
|
|
24
|
+
from py4heappe.core.models.authenticate_lexis_token_model import AuthenticateLexisTokenModel
|
|
25
|
+
from py4heappe.core.models.authenticate_user_digital_signature_model import AuthenticateUserDigitalSignatureModel
|
|
26
|
+
from py4heappe.core.models.authenticate_user_open_id_model import AuthenticateUserOpenIdModel
|
|
27
|
+
from py4heappe.core.models.authenticate_user_open_id_open_stack_model import AuthenticateUserOpenIdOpenStackModel
|
|
28
|
+
from py4heappe.core.models.authenticate_user_password_model import AuthenticateUserPasswordModel
|
|
29
|
+
from py4heappe.core.models.authentication_credentials import AuthenticationCredentials
|
|
30
|
+
from py4heappe.core.models.bad_request_result import BadRequestResult
|
|
31
|
+
from py4heappe.core.models.cancel_job_model import CancelJobModel
|
|
32
|
+
from py4heappe.core.models.cluster import Cluster
|
|
33
|
+
from py4heappe.core.models.cluster_authentication_credentials import ClusterAuthenticationCredentials
|
|
34
|
+
from py4heappe.core.models.cluster_authentication_credentials_auth_type import ClusterAuthenticationCredentialsAuthType
|
|
35
|
+
from py4heappe.core.models.cluster_connection_protocol import ClusterConnectionProtocol
|
|
36
|
+
from py4heappe.core.models.cluster_detailed_report_ext import ClusterDetailedReportExt
|
|
37
|
+
from py4heappe.core.models.cluster_ext import ClusterExt
|
|
38
|
+
from py4heappe.core.models.cluster_init_report_ext import ClusterInitReportExt
|
|
39
|
+
from py4heappe.core.models.cluster_node_type import ClusterNodeType
|
|
40
|
+
from py4heappe.core.models.cluster_node_type_detailed_report_ext import ClusterNodeTypeDetailedReportExt
|
|
41
|
+
from py4heappe.core.models.cluster_node_type_ext import ClusterNodeTypeExt
|
|
42
|
+
from py4heappe.core.models.cluster_node_type_for_task_ext import ClusterNodeTypeForTaskExt
|
|
43
|
+
from py4heappe.core.models.cluster_node_type_report_ext import ClusterNodeTypeReportExt
|
|
44
|
+
from py4heappe.core.models.cluster_node_type_requested_group import ClusterNodeTypeRequestedGroup
|
|
45
|
+
from py4heappe.core.models.cluster_node_type_resource_usage_ext import ClusterNodeTypeResourceUsageExt
|
|
46
|
+
from py4heappe.core.models.cluster_node_usage_ext import ClusterNodeUsageExt
|
|
47
|
+
from py4heappe.core.models.cluster_project import ClusterProject
|
|
48
|
+
from py4heappe.core.models.cluster_project_credential import ClusterProjectCredential
|
|
49
|
+
from py4heappe.core.models.cluster_proxy_connection import ClusterProxyConnection
|
|
50
|
+
from py4heappe.core.models.cluster_proxy_connection_ext import ClusterProxyConnectionExt
|
|
51
|
+
from py4heappe.core.models.cluster_report_ext import ClusterReportExt
|
|
52
|
+
from py4heappe.core.models.command_template import CommandTemplate
|
|
53
|
+
from py4heappe.core.models.command_template_ext import CommandTemplateExt
|
|
54
|
+
from py4heappe.core.models.command_template_parameter import CommandTemplateParameter
|
|
55
|
+
from py4heappe.core.models.command_template_parameter_ext import CommandTemplateParameterExt
|
|
56
|
+
from py4heappe.core.models.command_template_parameter_value_ext import CommandTemplateParameterValueExt
|
|
57
|
+
from py4heappe.core.models.contact import Contact
|
|
58
|
+
from py4heappe.core.models.copy_job_data_from_temp_model import CopyJobDataFromTempModel
|
|
59
|
+
from py4heappe.core.models.copy_job_data_to_temp_model import CopyJobDataToTempModel
|
|
60
|
+
from py4heappe.core.models.create_command_inner_template_parameter_model import CreateCommandInnerTemplateParameterModel
|
|
61
|
+
from py4heappe.core.models.create_command_template_from_generic_model import CreateCommandTemplateFromGenericModel
|
|
62
|
+
from py4heappe.core.models.create_command_template_model import CreateCommandTemplateModel
|
|
63
|
+
from py4heappe.core.models.create_command_template_parameter_model import CreateCommandTemplateParameterModel
|
|
64
|
+
from py4heappe.core.models.create_job_by_project_model import CreateJobByProjectModel
|
|
65
|
+
from py4heappe.core.models.create_project_assignment_to_cluster_model import CreateProjectAssignmentToClusterModel
|
|
66
|
+
from py4heappe.core.models.create_project_model import CreateProjectModel
|
|
67
|
+
from py4heappe.core.models.create_secure_shell_key_model import CreateSecureShellKeyModel
|
|
68
|
+
from py4heappe.core.models.create_secure_shell_key_model_obsolete import CreateSecureShellKeyModelObsolete
|
|
69
|
+
from py4heappe.core.models.data_transfer_method_ext import DataTransferMethodExt
|
|
70
|
+
from py4heappe.core.models.delete_job_model import DeleteJobModel
|
|
71
|
+
from py4heappe.core.models.deployment_type_ext import DeploymentTypeExt
|
|
72
|
+
from py4heappe.core.models.digital_signature_credentials_ext import DigitalSignatureCredentialsExt
|
|
73
|
+
from py4heappe.core.models.download_file_from_cluster_model import DownloadFileFromClusterModel
|
|
74
|
+
from py4heappe.core.models.download_parts_of_job_files_from_cluster_model import DownloadPartsOfJobFilesFromClusterModel
|
|
75
|
+
from py4heappe.core.models.end_data_transfer_model import EndDataTransferModel
|
|
76
|
+
from py4heappe.core.models.end_file_transfer_model import EndFileTransferModel
|
|
77
|
+
from py4heappe.core.models.environment_variable_ext import EnvironmentVariableExt
|
|
78
|
+
from py4heappe.core.models.extended_command_template_ext import ExtendedCommandTemplateExt
|
|
79
|
+
from py4heappe.core.models.extended_command_template_parameter_ext import ExtendedCommandTemplateParameterExt
|
|
80
|
+
from py4heappe.core.models.extended_project_info_ext import ExtendedProjectInfoExt
|
|
81
|
+
from py4heappe.core.models.file_information_ext import FileInformationExt
|
|
82
|
+
from py4heappe.core.models.file_transfer_cipher_type import FileTransferCipherType
|
|
83
|
+
from py4heappe.core.models.file_transfer_cipher_type_ext import FileTransferCipherTypeExt
|
|
84
|
+
from py4heappe.core.models.file_transfer_key_credentials_ext import FileTransferKeyCredentialsExt
|
|
85
|
+
from py4heappe.core.models.file_transfer_method import FileTransferMethod
|
|
86
|
+
from py4heappe.core.models.file_transfer_method_ext import FileTransferMethodExt
|
|
87
|
+
from py4heappe.core.models.file_transfer_protocol import FileTransferProtocol
|
|
88
|
+
from py4heappe.core.models.file_transfer_protocol_ext import FileTransferProtocolExt
|
|
89
|
+
from py4heappe.core.models.get_command_template_parameters_name_model import GetCommandTemplateParametersNameModel
|
|
90
|
+
from py4heappe.core.models.get_data_transfer_method_model import GetDataTransferMethodModel
|
|
91
|
+
from py4heappe.core.models.get_file_transfer_method_model import GetFileTransferMethodModel
|
|
92
|
+
from py4heappe.core.models.http_header_ext import HTTPHeaderExt
|
|
93
|
+
from py4heappe.core.models.http_get_to_job_node_model import HttpGetToJobNodeModel
|
|
94
|
+
from py4heappe.core.models.http_post_to_job_node_model import HttpPostToJobNodeModel
|
|
95
|
+
from py4heappe.core.models.initialize_cluster_script_directory_model import InitializeClusterScriptDirectoryModel
|
|
96
|
+
from py4heappe.core.models.instance_information_ext import InstanceInformationExt
|
|
97
|
+
from py4heappe.core.models.job_detailed_report_ext import JobDetailedReportExt
|
|
98
|
+
from py4heappe.core.models.job_file_content_ext import JobFileContentExt
|
|
99
|
+
from py4heappe.core.models.job_report_ext import JobReportExt
|
|
100
|
+
from py4heappe.core.models.job_specification_ext import JobSpecificationExt
|
|
101
|
+
from py4heappe.core.models.job_state_aggregation_report_ext import JobStateAggregationReportExt
|
|
102
|
+
from py4heappe.core.models.job_state_ext import JobStateExt
|
|
103
|
+
from py4heappe.core.models.lexis_credentials_ext import LexisCredentialsExt
|
|
104
|
+
from py4heappe.core.models.modify_command_template_from_generic_model import ModifyCommandTemplateFromGenericModel
|
|
105
|
+
from py4heappe.core.models.modify_command_template_model import ModifyCommandTemplateModel
|
|
106
|
+
from py4heappe.core.models.modify_command_template_parameter_model import ModifyCommandTemplateParameterModel
|
|
107
|
+
from py4heappe.core.models.modify_project_assignment_to_cluster_model import ModifyProjectAssignmentToClusterModel
|
|
108
|
+
from py4heappe.core.models.modify_project_model import ModifyProjectModel
|
|
109
|
+
from py4heappe.core.models.node_used_cores_and_limitation_ext import NodeUsedCoresAndLimitationExt
|
|
110
|
+
from py4heappe.core.models.open_id_credentials_ext import OpenIdCredentialsExt
|
|
111
|
+
from py4heappe.core.models.open_stack_application_credentials_ext import OpenStackApplicationCredentialsExt
|
|
112
|
+
from py4heappe.core.models.password_credentials_ext import PasswordCredentialsExt
|
|
113
|
+
from py4heappe.core.models.problem_details import ProblemDetails
|
|
114
|
+
from py4heappe.core.models.project import Project
|
|
115
|
+
from py4heappe.core.models.project_contact import ProjectContact
|
|
116
|
+
from py4heappe.core.models.project_detailed_report_ext import ProjectDetailedReportExt
|
|
117
|
+
from py4heappe.core.models.project_ext import ProjectExt
|
|
118
|
+
from py4heappe.core.models.project_for_task_ext import ProjectForTaskExt
|
|
119
|
+
from py4heappe.core.models.project_list_report_ext import ProjectListReportExt
|
|
120
|
+
from py4heappe.core.models.project_reference_ext import ProjectReferenceExt
|
|
121
|
+
from py4heappe.core.models.project_report_ext import ProjectReportExt
|
|
122
|
+
from py4heappe.core.models.project_resource_usage_ext import ProjectResourceUsageExt
|
|
123
|
+
from py4heappe.core.models.proxy_type import ProxyType
|
|
124
|
+
from py4heappe.core.models.proxy_type_ext import ProxyTypeExt
|
|
125
|
+
from py4heappe.core.models.public_key_ext import PublicKeyExt
|
|
126
|
+
from py4heappe.core.models.regenerate_secure_shell_key_model import RegenerateSecureShellKeyModel
|
|
127
|
+
from py4heappe.core.models.regenerate_secure_shell_key_model_obsolete import RegenerateSecureShellKeyModelObsolete
|
|
128
|
+
from py4heappe.core.models.remove_command_template_model import RemoveCommandTemplateModel
|
|
129
|
+
from py4heappe.core.models.remove_command_template_parameter_model import RemoveCommandTemplateParameterModel
|
|
130
|
+
from py4heappe.core.models.remove_project_assignment_to_cluster_model import RemoveProjectAssignmentToClusterModel
|
|
131
|
+
from py4heappe.core.models.remove_project_model import RemoveProjectModel
|
|
132
|
+
from py4heappe.core.models.remove_secure_shell_key_model import RemoveSecureShellKeyModel
|
|
133
|
+
from py4heappe.core.models.remove_secure_shell_key_model_obsolete import RemoveSecureShellKeyModelObsolete
|
|
134
|
+
from py4heappe.core.models.resource_allocation_type_ext import ResourceAllocationTypeExt
|
|
135
|
+
from py4heappe.core.models.scheduler_type import SchedulerType
|
|
136
|
+
from py4heappe.core.models.ssh_key_user_credentials_model import SshKeyUserCredentialsModel
|
|
137
|
+
from py4heappe.core.models.submit_job_model import SubmitJobModel
|
|
138
|
+
from py4heappe.core.models.submitted_job_info_ext import SubmittedJobInfoExt
|
|
139
|
+
from py4heappe.core.models.submitted_task_info_ext import SubmittedTaskInfoExt
|
|
140
|
+
from py4heappe.core.models.synchronizable_files_ext import SynchronizableFilesExt
|
|
141
|
+
from py4heappe.core.models.task_detailed_report_ext import TaskDetailedReportExt
|
|
142
|
+
from py4heappe.core.models.task_file_offset_ext import TaskFileOffsetExt
|
|
143
|
+
from py4heappe.core.models.task_paralization_parameter_ext import TaskParalizationParameterExt
|
|
144
|
+
from py4heappe.core.models.task_priority_ext import TaskPriorityExt
|
|
145
|
+
from py4heappe.core.models.task_report_ext import TaskReportExt
|
|
146
|
+
from py4heappe.core.models.task_specification_ext import TaskSpecificationExt
|
|
147
|
+
from py4heappe.core.models.task_state_ext import TaskStateExt
|
|
148
|
+
from py4heappe.core.models.test_cluster_access_for_account_model_obsolete import TestClusterAccessForAccountModelObsolete
|
|
149
|
+
from py4heappe.core.models.unauthorized_result import UnauthorizedResult
|
|
150
|
+
from py4heappe.core.models.usage_type import UsageType
|
|
151
|
+
from py4heappe.core.models.usage_type_ext import UsageTypeExt
|
|
152
|
+
from py4heappe.core.models.user_group_detailed_report_ext import UserGroupDetailedReportExt
|
|
153
|
+
from py4heappe.core.models.user_group_list_report_ext import UserGroupListReportExt
|
|
154
|
+
from py4heappe.core.models.user_group_report_ext import UserGroupReportExt
|
|
155
|
+
from py4heappe.core.models.version_information_ext import VersionInformationExt
|