hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
673ea3c2f3af8ec370e683d13fbca3102becc699
2,838
py
Python
panbox/pansim/pansim_active/active_assembler.py
ag-ds-bubble/panbox
8fb9854fd3c9a931b818bd51781e6d4fb046d580
[ "MIT" ]
null
null
null
panbox/pansim/pansim_active/active_assembler.py
ag-ds-bubble/panbox
8fb9854fd3c9a931b818bd51781e6d4fb046d580
[ "MIT" ]
null
null
null
panbox/pansim/pansim_active/active_assembler.py
ag-ds-bubble/panbox
8fb9854fd3c9a931b818bd51781e6d4fb046d580
[ "MIT" ]
null
null
null
from ..pansim_active.sim_controls import ActiveSimController class PanSimAssembler(ActiveSimController): def __init__(self): super().__init__() def initialise_pansim(self): self.initialise_parameters() def instantiate_pansim(self): self.reset_widgets() self.pansimView.S2_L1_country_DD.observe(self.update_state, names=['value']) self.pansimView.S2_L1_state_DD.observe(self.update_popdensity, names=['value']) self.pansimView.S2_L1_msperday_IS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L1_popdensity_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L1_initialaffected_IS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_infectradii_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_transmissionprob_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_incubperiod_IS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_quarentineafter_IS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_fatalityrate_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_asymptrate_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L3_socialdist_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L3_travelradii_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L3_interventionday_BIT.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_L2_infectradii_FS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L2_transmissionprob_FS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L2_incubperiod_IS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L2_quarentineafter_IS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L2_fatalityrate_FS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L2_asymptrate_FS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L3_socialdist_FS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L3_travelradii_FS.observe(self.update_dynamic_params, names=['value']) self.pansimView.S2_L3_transproobafter_FS.observe(self.pull_curr_param_values, names=['value']) self.pansimView.S2_play_BTN.on_click(self.onclick_playbtn) self.pansimView.S2_pause_BTN.on_click(self.onclick_pausebtn) self.pansimView.S2_reset_BTN.on_click(self.onclick_resetbtn) return self.pansimView.layoutPanSimView()
54.576923
103
0.764975
373
2,838
5.412869
0.168901
0.187221
0.206043
0.273403
0.776127
0.744923
0.717187
0.717187
0.717187
0.717187
0
0.019639
0.12086
2,838
51
104
55.647059
0.789579
0
0
0
0
0
0.04055
0
0
0
0
0
0
1
0.085714
false
0
0.028571
0
0.171429
0
0
0
0
null
0
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
677fd8120b153bd1b0004713f3929ceb52342436
19,255
py
Python
rapid7vmconsole/api/scan_template_api.py
kiblik/vm-console-client-python
038f6d33e8b2654a558326c6eb87f09ee23e0e22
[ "MIT" ]
61
2018-05-17T05:57:09.000Z
2022-03-08T13:59:21.000Z
rapid7vmconsole/api/scan_template_api.py
kiblik/vm-console-client-python
038f6d33e8b2654a558326c6eb87f09ee23e0e22
[ "MIT" ]
33
2018-06-26T16:21:14.000Z
2022-03-03T20:55:47.000Z
rapid7vmconsole/api/scan_template_api.py
kiblik/vm-console-client-python
038f6d33e8b2654a558326c6eb87f09ee23e0e22
[ "MIT" ]
43
2018-02-24T05:45:53.000Z
2022-03-31T22:15:16.000Z
# coding: utf-8 """ Python InsightVM API Client OpenAPI spec version: 3 Contact: support@rapid7.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from rapid7vmconsole.api_client import ApiClient class ScanTemplateApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def create_scan_template(self, **kwargs): # noqa: E501 """Scan Templates # noqa: E501 Creates a new scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_scan_template(async_req=True) >>> result = thread.get() :param async_req bool :param ScanTemplate scan_template: The details of the scan template. :return: CreatedReferenceScanTemplateIDLink If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.create_scan_template_with_http_info(**kwargs) # noqa: E501 else: (data) = self.create_scan_template_with_http_info(**kwargs) # noqa: E501 return data def create_scan_template_with_http_info(self, **kwargs): # noqa: E501 """Scan Templates # noqa: E501 Creates a new scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_scan_template_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param ScanTemplate scan_template: The details of the scan template. :return: CreatedReferenceScanTemplateIDLink If the method is called asynchronously, returns the request thread. """ all_params = ['scan_template'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_scan_template" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'scan_template' in params: body_params = params['scan_template'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json;charset=UTF-8']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/3/scan_templates', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CreatedReferenceScanTemplateIDLink', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_scan_template(self, id, **kwargs): # noqa: E501 """Scan Template # noqa: E501 Deletes a scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_scan_template(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: The identifier of the scan template (required) :return: Links If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_scan_template_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.delete_scan_template_with_http_info(id, **kwargs) # noqa: E501 return data def delete_scan_template_with_http_info(self, id, **kwargs): # noqa: E501 """Scan Template # noqa: E501 Deletes a scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_scan_template_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: The identifier of the scan template (required) :return: Links If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_scan_template" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `delete_scan_template`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json;charset=UTF-8']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/3/scan_templates/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Links', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_scan_template(self, id, **kwargs): # noqa: E501 """Scan Template # noqa: E501 Returns a scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scan_template(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: The identifier of the scan template (required) :return: ScanTemplate If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_scan_template_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.get_scan_template_with_http_info(id, **kwargs) # noqa: E501 return data def get_scan_template_with_http_info(self, id, **kwargs): # noqa: E501 """Scan Template # noqa: E501 Returns a scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scan_template_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: The identifier of the scan template (required) :return: ScanTemplate If the method is called asynchronously, returns the request thread. """ all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_scan_template" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `get_scan_template`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json;charset=UTF-8']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/3/scan_templates/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ScanTemplate', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_scan_templates(self, **kwargs): # noqa: E501 """Scan Templates # noqa: E501 Returns all scan templates. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scan_templates(async_req=True) >>> result = thread.get() :param async_req bool :return: ResourcesScanTemplate If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_scan_templates_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_scan_templates_with_http_info(**kwargs) # noqa: E501 return data def get_scan_templates_with_http_info(self, **kwargs): # noqa: E501 """Scan Templates # noqa: E501 Returns all scan templates. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_scan_templates_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :return: ResourcesScanTemplate If the method is called asynchronously, returns the request thread. """ all_params = [] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_scan_templates" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json;charset=UTF-8']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/3/scan_templates', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ResourcesScanTemplate', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_scan_template(self, id, **kwargs): # noqa: E501 """Scan Template # noqa: E501 Updates a scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_scan_template(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: The identifier of the scan template (required) :param ScanTemplate scan_template: The details of the scan template. :return: Links If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_scan_template_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.update_scan_template_with_http_info(id, **kwargs) # noqa: E501 return data def update_scan_template_with_http_info(self, id, **kwargs): # noqa: E501 """Scan Template # noqa: E501 Updates a scan template. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_scan_template_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: The identifier of the scan template (required) :param ScanTemplate scan_template: The details of the scan template. :return: Links If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'scan_template'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_scan_template" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `update_scan_template`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'scan_template' in params: body_params = params['scan_template'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json;charset=UTF-8']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/3/scan_templates/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Links', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
37.028846
117
0.603687
2,203
19,255
5.024058
0.073082
0.054933
0.025298
0.032526
0.947235
0.947235
0.943712
0.936845
0.935941
0.931063
0
0.018473
0.305583
19,255
519
118
37.100193
0.809289
0.32563
0
0.805861
1
0
0.171879
0.058607
0
0
0
0
0
1
0.040293
false
0
0.014652
0
0.113553
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
67a4b8b1097cc1ecf782c5c1929a04c0bb9759b2
3,319
py
Python
census/migrations/0025_auto_20190509_1516.py
senderle/bookcensus
46435d068437da3beebe594bb4faf9791e2690f1
[ "MIT" ]
1
2020-09-30T18:56:33.000Z
2020-09-30T18:56:33.000Z
census/migrations/0025_auto_20190509_1516.py
senderle/bookcensus
46435d068437da3beebe594bb4faf9791e2690f1
[ "MIT" ]
null
null
null
census/migrations/0025_auto_20190509_1516.py
senderle/bookcensus
46435d068437da3beebe594bb4faf9791e2690f1
[ "MIT" ]
null
null
null
# Generated by Django 2.0.9 on 2019-05-09 15:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('census', '0024_rejecteddraftcopy'), ] operations = [ migrations.AlterModelOptions( name='rejecteddraftcopy', options={'verbose_name_plural': 'Rejected draft copies'}, ), migrations.AddField( model_name='basecopy', name='Lee', field=models.IntegerField(default=0, null=True), ), migrations.AlterField( model_name='basecopy', name='Bartlett1916_Notes', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='basecopy', name='Bartlett1939_Notes', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='basecopy', name='Binder', field=models.CharField(blank=True, default='', max_length=500, null=True), ), migrations.AlterField( model_name='basecopy', name='Binding', field=models.CharField(blank=True, default='', max_length=500, null=True), ), migrations.AlterField( model_name='basecopy', name='Bookplate', field=models.CharField(blank=True, default='', max_length=500, null=True), ), migrations.AlterField( model_name='basecopy', name='Bookplate_Location', field=models.CharField(blank=True, default='', max_length=500, null=True), ), migrations.AlterField( model_name='basecopy', name='Condition', field=models.CharField(blank=True, default='', max_length=500, null=True), ), migrations.AlterField( model_name='basecopy', name='Lee_Notes', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='basecopy', name='Local_Notes', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='basecopy', name='Marginalia', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='basecopy', name='Shelfmark', field=models.CharField(blank=True, default='', max_length=500, null=True), ), migrations.AlterField( model_name='basecopy', name='bibliography', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='basecopy', name='prov_info', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='issue', name='notes', field=models.TextField(blank=True, default='', null=True), ), migrations.AlterField( model_name='issue', name='year', field=models.CharField(default='', max_length=20), ), ]
33.867347
86
0.55348
300
3,319
6.016667
0.216667
0.079778
0.149584
0.232687
0.761773
0.746814
0.746814
0.746814
0.719668
0.719668
0
0.021145
0.316059
3,319
97
87
34.216495
0.774009
0.013558
0
0.681319
1
0
0.111247
0.006724
0
0
0
0
0
1
0
false
0
0.010989
0
0.043956
0
0
0
0
null
0
0
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
67b74ec88488564ffd06a06e7e806e374fafe9fd
245
py
Python
server/.vim/plugged/python-mode/submodules/pylint/tests/functional/m/messages_managed_by_id.py
hkdb/sysconf
99d334f7309657647059c4b37f25e33dffc81fc3
[ "MIT" ]
10
2020-07-21T21:59:54.000Z
2021-07-19T11:01:47.000Z
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/m/messages_managed_by_id.py
OrangeGzY/vimrc
ddcaedce2effbbd1014eddbceebeb8c621cd9f95
[ "MIT" ]
null
null
null
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/m/messages_managed_by_id.py
OrangeGzY/vimrc
ddcaedce2effbbd1014eddbceebeb8c621cd9f95
[ "MIT" ]
1
2021-01-30T18:17:01.000Z
2021-01-30T18:17:01.000Z
# -*- encoding=utf-8 -*- #pylint: disable=C0111 def foo(): #pylint: disable=C0102 return 1 def toto(): #pylint: disable=C0102,R1711 return # +1: [missing-function-docstring] def test_enabled_by_id_msg(): #pylint: enable=C0111 pass
20.416667
51
0.685714
34
245
4.823529
0.676471
0.237805
0.219512
0
0
0
0
0
0
0
0
0.11165
0.159184
245
11
52
22.272727
0.684466
0.587755
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0.166667
0
0.333333
0.833333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
1
1
0
0
7
67e7ef8e79fc3f139ef81ba37d3aa364b392b857
9,041
py
Python
scripts/nuscenes_devkit/python-sdk/scripts/calculate_projection_matrices_nuscenes.py
n2pham/3d-bat
6be0a00f3dbbd4c968586e1bd01e45cdbf4614e1
[ "BSD-4-Clause-UC" ]
335
2019-08-15T18:10:19.000Z
2022-03-30T11:00:54.000Z
scripts/nuscenes_devkit/python-sdk/scripts/calculate_projection_matrices_nuscenes.py
n2pham/3d-bat
6be0a00f3dbbd4c968586e1bd01e45cdbf4614e1
[ "BSD-4-Clause-UC" ]
24
2019-09-19T09:46:05.000Z
2022-03-24T17:05:57.000Z
scripts/nuscenes_devkit/python-sdk/scripts/calculate_projection_matrices_nuscenes.py
n2pham/3d-bat
6be0a00f3dbbd4c968586e1bd01e45cdbf4614e1
[ "BSD-4-Clause-UC" ]
93
2019-12-02T14:14:58.000Z
2022-03-30T06:21:41.000Z
import numpy as np from pyquaternion import Quaternion # Move 3d point from LIDAR to ego vehicle coord system translation_vector_lidar_to_imu = np.array([0.891067, 0.0, 1.84292]).T rotation_matrix_lidar_to_imu = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) # transformation_matrix_lidar_to_ego = np.zeros((4, 4)) # transformation_matrix_lidar_to_ego[:3, :3] = rotation_matrix_lidar_to_ego # transformation_matrix_lidar_to_ego[:, 3] = translation_vector_lidar_to_ego # # # Move box to sensor coord system # translation_vector_ego_to_sensor = np.array([-0.086, 0.007, -1.541, 1]).T # rotation_matrix_ego_to_sensor = np.array([[1.78014178e-02, 9.99841527e-01, -1.74532924e-04], # [1.48292972e-02, -4.38565732e-04, -9.99889944e-01], # [-9.99731565e-01, 1.77968704e-02, -1.48347542e-02]]) # transformation_matrix_ego_to_sensor = np.zeros((4, 4)) # transformation_matrix_ego_to_sensor[:3, :3] = rotation_matrix_ego_to_sensor # transformation_matrix_ego_to_sensor[:, 3] = translation_vector_ego_to_sensor # FRONT translation_vector_imu_to_cam = -np.array([1.671, -0.026, 1.536]).T rotation_angles_imu_to_cam = [0.5008123506024099, -0.496820732721925, 0.4963493647221966, -0.5059579598757297] rotation_matrix = Quaternion(rotation_angles_imu_to_cam).rotation_matrix.T camera_intrinsic_matrix = np.array([[1262.8093578767177, 0.0, 786.6784634591471], [0.0, 1262.8093578767177, 437.9890946201144], [0.0, 0.0, 2.5]]) / 2.5 camera_extrinsic_matrix = np.zeros((3, 4)) camera_extrinsic_matrix[:3, :3] = rotation_matrix camera_extrinsic_matrix[:, 3] = translation_vector_imu_to_cam projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix) print(projection_matrix) translation_vector_imu_to_cam = np.array([1.671, -0.026, 1.536]).T rotation_angles_imu_to_cam = [0.5008123506024099, -0.496820732721925, 0.4963493647221966, -0.5059579598757297] rotation_matrix = Quaternion(rotation_angles_imu_to_cam).rotation_matrix.T camera_intrinsic_matrix = np.array([[1262.8093578767177, 0.0, 786.6784634591471], [0.0, 1262.8093578767177, 437.9890946201144], [0.0, 0.0, 2.5]]) / 2.5 camera_extrinsic_matrix_one = np.zeros((3, 4)) # translation_vector = np.matmul(rotation_matrix.T, translation_vector.T) # 3x1 camera_extrinsic_matrix_one[:3, :3] = rotation_matrix camera_extrinsic_matrix_one[:, 3] = translation_vector_imu_to_cam projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix_one) print(projection_matrix) # # FRONT_LEFT # translation_vector = -np.array([1.564, 0.472, 1.535]).T # rotation_angles = [0.6749672883132785, -0.6702326464493555, 0.21013653934841947, -0.2259424576550029] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([[1256.4720761102153, 0.0, 759.9201772536986], # [0.0, 1256.472076110215, 418.2347543062189], # [0.0, 0.0, 2.5]])/2.5 # camera_extrinsic_matrix_one = np.zeros((3, 4)) # # translation_vector = np.matmul(rotation_matrix.T, translation_vector.T) # 3x1 # camera_extrinsic_matrix_one[:3, :3] = rotation_matrix # camera_extrinsic_matrix_one[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix_one) # print(projection_matrix) # translation_vector = -np.array([1.564, 0.472, 1.535]).T # rotation_angles = [0.6749672883132785, -0.6702326464493555, 0.21013653934841947, -0.2259424576550029] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([[1256.4720761102153, 0.0, 759.9201772536986], # [0.0, 1256.472076110215, 418.2347543062189], # [0.0, 0.0, 2.5]]) / 2.5 # camera_extrinsic_matrix = np.zeros((3, 4)) # camera_extrinsic_matrix[:3, :3] = rotation_matrix # camera_extrinsic_matrix[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix) # print(projection_matrix) # # FRONT_RIGHT # translation_vector = -np.array([1.593, -0.527, 1.526]).T # rotation_angles = [0.22383629788979093, # -0.21087341359410547, # 0.6710418554409988, # -0.6746351187363905] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([ # [1264.1253743585607, 0.0, 761.8659236816043], # [0.0, 1264.125374358561, 415.0768894058469], # [0.0, 0.0, 2.5]])/2.5 # camera_extrinsic_matrix = np.zeros((3, 4)) # camera_extrinsic_matrix[:3, :3] = rotation_matrix # camera_extrinsic_matrix[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix) # print(projection_matrix) # CAM_BACK_RIGHT # translation_vector = -np.array([1.042, # -0.456, # 1.595]).T # rotation_angles = [0.12392664517942022, # -0.13099150918735702, # -0.6956208531150481, # 0.6954099796860017] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([[1259.4297629105833, 0.0, 752.9541347831612], # [0.0, 1259.4297629105833, 429.46398926977497], # [0.0, 0.0, 2.5]]) / 2.5 # camera_extrinsic_matrix = np.zeros((3, 4)) # camera_extrinsic_matrix[:3, :3] = rotation_matrix # camera_extrinsic_matrix[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix) # print(projection_matrix) # CAM_BACK # position of back camera relative to ego vehicle/body_rp frame (IMU) # translation_vector = -np.array([0.086, -0.007, 1.541]).T # rotation_angles = [0.5006316254997311, # -0.508201421131807, # -0.49914796672300266, # 0.49188474099671065] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([[798.1242652672415, 0.0, 679.0081140747895], # [0.0, 798.1242652672414, 419.2474525237902], # [0.0, 0.0, 2.5]]) / 2.5 # camera_extrinsic_matrix = np.zeros((3, 4)) # camera_extrinsic_matrix[:3, :3] = rotation_matrix # camera_extrinsic_matrix[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix) # print(projection_matrix) # calculate final transformation matrix (extrinsic matrix) # transformation_matrix_lidar_to_sensor = np.matmul(transformation_matrix_ego_to_sensor, # transformation_matrix_lidar_to_ego) # transformation_matrix_lidar_to_sensor = transformation_matrix_lidar_to_sensor[0:3, :] # projection_matrix = np.matmul(camera_intrinsic_matrix, transformation_matrix_lidar_to_sensor) # print(projection_matrix) # CAM_BACK_LEFT # translation_vector = -np.array([1.055, # 0.441, # 1.605]).T # rotation_angles = [0.6991074021274409, # -0.6957784949830705, # -0.11894121100606163, # 0.11399173011286876] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([[1258.2338510172276, 0.0, 742.9036438917772], # [0.0, 1258.2338510172278, 422.93240569290015], # [0.0, 0.0, 2.5]])/2.5 # camera_extrinsic_matrix = np.zeros((3, 4)) # camera_extrinsic_matrix[:3, :3] = rotation_matrix # camera_extrinsic_matrix[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix) # print(projection_matrix) # CAM_BACK_LEFT # translation_vector = -np.array([1.055, # 0.441, # 1.605]).T # rotation_angles = [0.6991074021274409, # -0.6957784949830705, # -0.11894121100606163, # 0.11399173011286876] # rotation_matrix = Quaternion(rotation_angles).rotation_matrix.T # camera_intrinsic_matrix = np.array([[1258.2338510172276, 0.0, 742.9036438917772], # [0.0, 1258.2338510172278, 422.93240569290015], # [0.0, 0.0, 2.5]]) / 2.5 # camera_extrinsic_matrix_one = np.zeros((3, 4)) # # translation_vector = np.matmul(rotation_matrix.T, translation_vector.T) # 3x1 # camera_extrinsic_matrix_one[:3, :3] = rotation_matrix # camera_extrinsic_matrix_one[:, 3] = translation_vector # projection_matrix = np.matmul(camera_intrinsic_matrix, camera_extrinsic_matrix_one) # print(projection_matrix)
53.497041
110
0.663643
1,097
9,041
5.170465
0.13856
0.01763
0.133286
0.085684
0.835508
0.796721
0.737835
0.729901
0.708039
0.708039
0
0.229922
0.216348
9,041
168
111
53.815476
0.570642
0.773034
0
0.428571
0
0
0
0
0
0
0
0
0
1
0
false
0
0.071429
0
0.071429
0.071429
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
db302767c1e1b6091ce7052597fccb373f1e2ef3
17,250
py
Python
Application/__init__.py
cristi161/eecvf
519c488bd47f697ef51e88823f7a751a52677b88
[ "MIT" ]
null
null
null
Application/__init__.py
cristi161/eecvf
519c488bd47f697ef51e88823f7a751a52677b88
[ "MIT" ]
null
null
null
Application/__init__.py
cristi161/eecvf
519c488bd47f697ef51e88823f7a751a52677b88
[ "MIT" ]
null
null
null
from config_main import CUDA_GPU ############################################################################################################################################ # service jobs ############################################################################################################################################ from Application.Config.create_config import create_config_file from Application.Config.service_job_create import set_input_image_folder from Application.Config.service_job_create import set_input_image_from_txt_folder from Application.Config.service_job_create import set_output_image_folder from Application.Config.service_job_create import set_input_video from Application.Config.service_job_create import set_number_waves from Application.Config.service_job_create import set_input_camera_video from Application.Config.service_job_create import configure_save_pictures from Application.Config.service_job_create import configure_show_pictures from Application.Config.service_job_create import delete_folder_appl_out from Application.Config.service_job_create import create_list_ports_with_word from Application.Config.service_job_create import create_list_ports_start_with_word from Application.Config.service_job_create import create_folder_from_list_ports from Application.Config.service_job_create import create_folders_from_list_ports from .run_appl import run_application ############################################################################################################################################ # Input jobs ############################################################################################################################################ from Application.Config.job_create import do_get_image_job from Application.Config.job_create import do_get_image_from_txt_job from Application.Config.job_create import do_get_satellite_image_job from Application.Config.job_create import do_get_video_job from Application.Config.job_create import do_get_video_capture_job ############################################################################################################################################ # Pyramid level processing jobs ############################################################################################################################################ from Application.Config.job_create import do_pyramid_level_down_job from Application.Config.job_create import do_pyramid_level_up_job ############################################################################################################################################ # Image processing jobs ############################################################################################################################################ from Application.Config.job_create import do_max_pixel_image_job from Application.Config.job_create import do_median_pixel_image_job from Application.Config.job_create import do_mean_pixel_image_job from Application.Config.job_create import do_add_gaussian_blur_noise_job from Application.Config.job_create import do_add_salt_pepper_noise from Application.Config.job_create import do_add_speckle_noise from Application.Config.job_create import do_grayscale_transform_job from Application.Config.job_create import do_image_complement_job from Application.Config.job_create import do_number_edge_pixels from Application.Config.job_create import do_image_crop_job from Application.Config.job_create import do_rotate_image_job from Application.Config.job_create import do_flip_image_job from Application.Config.job_create import do_zoom_image_job from Application.Config.job_create import do_contrast_brightness_change_image_job from Application.Config.job_create import do_gamma_correction_image_job from Application.Config.job_create import do_pixelate_image_job from Application.Jobs.processing_image import do_resize_image_job from Application.Jobs.processing_image import do_blending_images_job ############################################################################################################################################ # Image blurring jobs ############################################################################################################################################ from Application.Config.job_create import do_gaussian_blur_image_job from Application.Config.job_create import do_median_blur_job from Application.Config.job_create import do_mean_blur_job from Application.Config.job_create import do_conservative_filter_job from Application.Config.job_create import do_bilateral_filter_job from Application.Config.job_create import do_guided_filter_job from Application.Config.job_create import do_l0_gradient_minimization_filter_job from Application.Config.job_create import do_anisotropic_diffusion_filter_job from Application.Config.job_create import do_crimmins_job from Application.Config.job_create import do_sharpen_filter_job from Application.Config.job_create import do_unsharp_filter_job from Application.Config.job_create import do_isef_filter_job from Application.Config.job_create import do_motion_blur_filter_job ############################################################################################################################################ # Image morphology jobs ############################################################################################################################################ from Application.Config.job_create import do_image_morphological_erosion_job from Application.Config.job_create import do_image_morphological_dilation_job from Application.Config.job_create import do_image_morphological_open_job from Application.Config.job_create import do_image_morphological_close_job from Application.Config.job_create import do_image_morphological_edge_gradient_job from Application.Config.job_create import do_image_morphological_top_hat_job from Application.Config.job_create import do_image_morphological_black_hat_job from Application.Config.job_create import do_morphological_hit_and_miss_transformation_job from Application.Config.job_create import do_image_morphological_cv2_job from Application.Config.job_create import do_morphological_thinning_job ############################################################################################################################################ # Kernel processing jobs ############################################################################################################################################ from Application.Config.job_create import do_kernel_convolution_job from Application.Config.job_create import do_deriche_kernel_convolution_job from Application.Config.job_create import do_kernel_cross_convolution_job from Application.Config.job_create import do_kernel_frei_chen_convolution_job from Application.Config.job_create import do_kernel_navatia_babu_convolution_job ############################################################################################################################################ # edge detection - magnitude gradient jobs ############################################################################################################################################ from Application.Config.job_create import do_gradient_magnitude_job from Application.Config.job_create import do_first_order_derivative_operators ############################################################################################################################################ # edge detection - directional gradient jobs ############################################################################################################################################ from Application.Config.job_create import do_gradient_magnitude_cross_job from Application.Config.job_create import do_gradient_navatia_babu_job from Application.Config.job_create import do_gradient_frei_chen_job from Application.Config.job_create import do_frei_chen_edge_job from Application.Config.job_create import do_navatia_babu_edge_5x5_job from Application.Config.job_create import do_compass_edge_job from Application.Config.job_create import do_kirsch_3x3_cross_job from Application.Config.job_create import do_robinson_3x3_cross_job from Application.Config.job_create import do_robinson_modified_3x3_cross_job from Application.Config.job_create import do_prewitt_3x3_cross_job ############################################################################################################################################ # edge detection - Canny jobs ############################################################################################################################################ from Application.Config.job_create import do_canny_from_kernel_convolution_job from Application.Config.job_create import do_canny_config_job from Application.Config.job_create import do_canny_fix_threshold_job from Application.Config.job_create import do_canny_ratio_threshold_job from Application.Config.job_create import do_canny_otsu_half_job from Application.Config.job_create import do_canny_otsu_median_sigma_job from Application.Config.job_create import do_canny_median_sigma_job from Application.Config.job_create import do_canny_mean_sigma_job from Application.Config.job_create import do_deriche_canny_job ############################################################################################################################################ # edge detection - second derivative ############################################################################################################################################ from Application.Config.job_create import do_laplacian_pyramid_from_img_diff_job from Application.Config.job_create import do_laplacian_from_img_diff_job from Application.Config.job_create import do_laplace_job from Application.Config.job_create import do_log_job from Application.Config.job_create import do_zero_crossing_job from Application.Config.job_create import do_zero_crossing_adaptive_window_isef_job from Application.Config.job_create import do_threshold_hysteresis_isef_job from Application.Config.job_create import do_shen_castan_job from Application.Config.job_create import do_marr_hildreth_job from Application.Config.job_create import do_dog_job from Application.Config.job_create import do_dob_job ############################################################################################################################################ # edge detection algorithms ############################################################################################################################################ from Application.Jobs.edge_edline import do_edge_drawing_job from Application.Jobs.edge_edline import do_edge_drawing_mod_job ############################################################################################################################################ # line/shape detection ############################################################################################################################################ from Application.Config.job_create import do_hough_lines_job from Application.Jobs.edge_edline import do_ed_lines_job from Application.Jobs.edge_edline import do_ed_lines_mod_job from Application.Config.job_create import do_hough_circle_job ############################################################################################################################################ # Image threshold jobs ############################################################################################################################################ from Application.Config.job_create import do_otsu_job from Application.Jobs.thresholding_image import do_multi_otsu_job from Application.Config.job_create import do_image_threshold_job from Application.Config.job_create import do_image_adaptive_threshold_job ############################################################################################################################################ # Skeletonization/thinning jobs ############################################################################################################################################ from Application.Config.job_create import do_thinning_guo_hall_image_job ############################################################################################################################################ # Line/edge connectivity jobs ############################################################################################################################################ from Application.Config.job_create import do_edge_label_job from Application.Jobs.line_connectivity import do_line_theta_filtering_job ############################################################################################################################################ # Value manipulations ############################################################################################################################################ from Application.Jobs.value_manipulating import do_value_manipulation_job ############################################################################################################################################ # Multiple image jobs ############################################################################################################################################ from Application.Config.job_create import do_matrix_difference_job from Application.Config.job_create import do_matrix_difference_1_px_offset_job from Application.Config.job_create import do_matrix_sum_job from Application.Config.job_create import do_matrix_bitwise_and_job from Application.Config.job_create import do_matrix_bitwise_or_job from Application.Config.job_create import do_matrix_bitwise_or_4_job from Application.Config.job_create import do_matrix_bitwise_xor_job from Application.Config.job_create import do_matrix_intersect_job ############################################################################################################################################ # Augmentation jobs ############################################################################################################################################ from Application.Jobs.image_augmentation import do_class_correlation ############################################################################################################################################ # Texture jobs ############################################################################################################################################ from Application.Jobs.grey_comatrix import do_glcm_job ############################################################################################################################################ # Feature jobs ############################################################################################################################################ from Application.Jobs.feature_detection import do_sift_job ############################################################################################################################################ # Deinterlacing jobs ############################################################################################################################################ if CUDA_GPU: from Application.Jobs.deinterlacing import do_deep_video_deinterlacing ############################################################################################################################################ # U-Net jobs ############################################################################################################################################ if CUDA_GPU: from Application.Config.job_create import do_u_net_edge ############################################################################################################################################ # Semseg jobs ############################################################################################################################################ if CUDA_GPU: from Application.Config.job_create import do_mobilenet_unet_semseg from Application.Config.job_create import do_unet_mini_semseg from Application.Config.job_create import do_resnet50_unet_semseg from Application.Config.job_create import do_u_net_semseg from Application.Config.job_create import do_vgg_u_net_semseg from Application.Config.job_create import do_semseg_base_job ############################################################################################################################################ # Speed-bump jobs ############################################################################################################################################ from Application.Jobs.sb_detection import do_sb_detection_from_lines_job ############################################################################################################################################ # Image Cube creation ############################################################################################################################################ from Application.Jobs.image_cube import create_image_cube
78.767123
140
0.517391
1,530
17,250
5.418954
0.137909
0.242432
0.301411
0.303944
0.768182
0.768182
0.764805
0.764805
0.61621
0.329876
0
0.000969
0.042783
17,250
219
141
78.767123
0.501151
0.033333
0
0.021583
0
0
0
0
0
0
0
0
0
1
0
true
0.007194
0.978417
0
0.978417
0
0
0
0
null
1
1
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
9
e1dc4353d520c1fa00c8d4108eabd3e458bc73c7
93
py
Python
chocopy-rs/test/pa2/not_really_shadow.py
wwylele/chocopy-wwylele
ef60c94cc9c2d7c8ac11cf2761b724a717ac36aa
[ "MIT" ]
5
2020-05-13T03:47:43.000Z
2022-01-20T04:52:42.000Z
chocopy-rs/test/pa2/not_really_shadow.py
wwylele/chocopy-wwylele
ef60c94cc9c2d7c8ac11cf2761b724a717ac36aa
[ "MIT" ]
4
2020-05-18T01:06:15.000Z
2020-06-12T19:33:14.000Z
chocopy-rs/test/pa2/not_really_shadow.py
wwylele/chocopy-rs
ef60c94cc9c2d7c8ac11cf2761b724a717ac36aa
[ "MIT" ]
null
null
null
class a(object): a:int = 0 class b(object): a:int = 0 def b(x: b): pass
11.625
16
0.473118
17
93
2.588235
0.529412
0.318182
0.454545
0.5
0
0
0
0
0
0
0
0.034483
0.376344
93
7
17
13.285714
0.724138
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0
0
0.833333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
7
c011131947bb1c15344ebfdd816d1a370f7bbe0f
5,670
py
Python
PhysicsTools/PatExamples/python/samplesCERN_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
PhysicsTools/PatExamples/python/samplesCERN_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
PhysicsTools/PatExamples/python/samplesCERN_cff.py
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
import FWCore.ParameterSet.Config as cms from PhysicsTools.PatAlgos.tools.cmsswVersionTools import pickRelValInputFiles ## THESE SAMPLES ONLY WORK FOR 41x OR OLDER ## 299,991 QCD events as defined on WorkBookPATExampleTopQuarks #simulationQCD41X = cms.untracked.vstring( # 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_0.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_1.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_2.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_3.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_4.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_5.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_6.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_7.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_8.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_9.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_10.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_11.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_12.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_13.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_14.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_15.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_16.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_17.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_18.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_19.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_20.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_21.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_22.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_23.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_24.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_25.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_26.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_27.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_28.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_qcd_29.root' #) ## THESE SAMPLES ONLY WORK FOR 41x OR OLDER ## 99,991 W+Jets events as defined on WorkBookPATExampleTopQuarks #simulationWjets = cms.untracked.vstring( # 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_0.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_1.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_2.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_3.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_4.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_5.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_6.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_7.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_8.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_9.root' #) ## THESE SAMPLES ONLY WORK FOR 41x OR OLDER ## 9,991 Z+Jets events as defined on WorkBookPATExampleTopQuarks #simulationZjets = cms.untracked.vstring( # 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_0.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_1.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_2.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_3.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_4.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_5.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_6.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_7.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_8.root' # ,'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_9.root' #) ## THESE SAMPLES ONLY WORK FOR 41x OR OLDER ## 1000 Ttbar events as defined on WorkBookPATExampleTopQuarks #simulationTtbar = cms.untracked.vstring( # 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_ttbar.root' #) ## 100,000 W+Jets events as defined on WorkBookPATExampleTopQuarks simulationWjets = cms.untracked.vstring( 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_wjets_42X.root' ) ## 10,000 Z+Jets events as defined on WorkBookPATExampleTopQuarks simulationZjets = cms.untracked.vstring( 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_42X.root' ) ## 1000 Ttbar events as defined on WorkBookPATExampleTopQuarks simulationTtbar = cms.untracked.vstring( 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_ttbar_42X.root' ) ttbarRECO = cms.untracked.vstring( pickRelValInputFiles( cmsswVersion = 'CMSSW_4_2_8' , relVal = 'RelValZTT' , globalTag = 'START42_V12' ) ) ttbarJets = cms.untracked.vstring( 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_ttbar_jets.root' ) zjetsRECO = cms.untracked.vstring( pickRelValInputFiles( cmsswVersion = 'CMSSW_4_2_8' , relVal = 'RelValZMM' , globalTag = 'START42_V12' ) ) zjetsTracks = cms.untracked.vstring( 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_tracks.root' ) zjetsTrigger = cms.untracked.vstring( 'rfio:///castor/cern.ch/user/c/cmssup/patTuple_zjets_trigger.root' ) # CMSSW_3_8_5_patch3 prompt reconstruction of muon PD, run 149291, 22073 events AOD dataMu = cms.untracked.vstring( '/store/data/Run2010B/Mu/AOD/PromptReco-v2/000/149/291/FE4109CA-D0E4-DF11-96F6-001D09F2AD7F.root' )
46.097561
101
0.702646
834
5,670
4.627098
0.146283
0.147707
0.206789
0.236331
0.864732
0.85333
0.85333
0.85333
0.844778
0.834413
0
0.036353
0.121869
5,670
122
102
46.47541
0.738703
0.72769
0
0.114286
0
0.028571
0.359343
0.316906
0
0
0
0
0
1
0
false
0
0.057143
0
0.057143
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
c0313f04b4bf1f7501ab3f9db5cde55be1a3e5be
17,717
py
Python
py2/tensorflow_code/pool_fkns.py
gulamungon/SEQUENS
48321f437f637d6d31c0beb70e03477952ad7340
[ "Apache-1.1" ]
4
2019-07-26T09:11:28.000Z
2020-09-27T13:31:40.000Z
py2/tensorflow_code/pool_fkns.py
gulamungon/SEQUENS
48321f437f637d6d31c0beb70e03477952ad7340
[ "Apache-1.1" ]
null
null
null
py2/tensorflow_code/pool_fkns.py
gulamungon/SEQUENS
48321f437f637d6d31c0beb70e03477952ad7340
[ "Apache-1.1" ]
2
2019-07-27T06:34:37.000Z
2019-07-29T09:21:52.000Z
# Pooling functions import tensorflow as tf import numpy as np # The variance_epsilon is needed to avoid nans in some situations def mean_std(x, axes=0, variance_epsilon=1e-8): mean_, var_ = tf.nn.moments(x, axes=axes, keep_dims=True) return ( tf.concat([mean_, tf.sqrt(var_ + variance_epsilon),], axis=-1) ) def mean_std_attention(x, att, axes=0, variance_epsilon=1e-8): count_ = tf.reduce_sum(att, axis=[axes], keep_dims=True) sum_ = tf.reduce_sum(x*att, axis=[axes], keep_dims=True) mean_ = sum_ / count_ sum_m_2_ = tf.reduce_sum( ((x-mean_)**2)*att, axis=[axes], keep_dims=True ) var_ = sum_m_2_ / count_ return (tf.concat([mean_, tf.sqrt(var_ + variance_epsilon),], axis=-1) ) # Attention is used differently in std calculation def mean_std_attention_2(x, att, axes=0, variance_epsilon=1e-8): count_ = tf.reduce_sum(att, axis=[axes], keep_dims=True) sum_ = tf.reduce_sum(x*att, axis=[axes], keep_dims=True) mean_ = sum_ / count_ sum_m_2_ = tf.reduce_sum( ((x*att-mean_)**2), axis=[axes], keep_dims=True ) var_ = sum_m_2_ / count_ return (tf.concat([mean_, tf.sqrt(var_ + variance_epsilon),], axis=-1) ) def mean_std_attention_head(x, att, axes=0, variance_epsilon=1e-8): x = tf.expand_dims(x,-1) #[200,283,500,1] att = tf.expand_dims(att,-2) #[200,283,1 3] count_ = tf.reduce_sum(att, axis=[axes], keep_dims=True) sum_ = tf.reduce_sum(x*att, axis=[axes], keep_dims=True) #[200,1,500 3] mean_ = sum_ / count_ sum_m_2_ = tf.reduce_sum( ((x-mean_)**2)*att, axis=[axes], keep_dims=True) #[200,1,500 3] var_ = sum_m_2_ / count_ sh_ = tf.shape(x) mean_ = tf.reshape(mean_, (sh_[0], 1, -1)) var_ = tf.reshape(var_, (sh_[0], 1, -1)) return (tf.concat([mean_, tf.sqrt(var_ + variance_epsilon),], axis=-1) ) # Attention is used differently in std calculation def mean_std_attention_head_2(x, att, axes=0, variance_epsilon=1e-8): x = tf.expand_dims(x,-1) #[200,283,500,1] att = tf.expand_dims(att,-2) #[200,283,1 3] count_ = tf.reduce_sum(att, axis=[axes], keep_dims=True) sum_ = tf.reduce_sum(x*att, axis=[axes], keep_dims=True) #[200,1,500 3] mean_ = sum_ / count_ sum_m_2_ = tf.reduce_sum((x*att-mean_)**2, axis=[axes], keep_dims=True) #[200,1,500 3] var_ = sum_m_2_ / count_ sh_ = tf.shape(x) mean_ = tf.reshape(mean_, (sh_[0], 1, -1)) var_ = tf.reshape(var_, (sh_[0], 1, -1)) return (tf.concat([mean_, tf.sqrt(var_ + variance_epsilon),], axis=-1) ) def mean_std_attention_framemerge(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False, floatX='float32'): c_max = 10 if no_merge: print "Will not merge frames, only reduce their weight." x_ = x else: bs_ = tf.shape(beta) bb_ = tf.concat([ tf.zeros([bs_[0], c_max, 1]), beta], axis=1) bbb_= tf.ones(bs_) w_ = tf.ones(bs_) zs_ = tf.shape(x) zz_ = tf.concat([ tf.zeros([zs_[0], c_max, zs_[2]]), x], axis=1) zzz_= zz_[:,c_max:,:] def body(zzz_,w_,bbb_,i_): bbb_ *= (1-bb_[:,c_max-i_-1:-i_-1,:]) zzz_ += zz_[:,c_max-i_-1:-i_-1,:] * bbb_ w_ += bbb_ return zzz_,w_,bbb_, i_+1 # Initialization i0_ = tf.constant(0, dtype='int32', name='pool_loop_index') x_, w_ = tf.while_loop(cond =lambda zz, ww, bb, ii: tf.less(ii, c_max ), body=body, loop_vars=[zzz_, w_, bbb_, i0_ ], shape_invariants=[zzz_.get_shape(), w_.get_shape(), bbb_.get_shape(), i0_.get_shape()], parallel_iterations=1, swap_memory=True)[0:2] x_ = x_ / w_ if att == None: att = beta else: att = att * beta out_ = mean_std_attention(x_, att, axes=axes) return out_ def mean_std_attention_framemerge_8(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False, floatX='float32'): c_max = 10 if no_merge: print "Will not merge frames, only reduce their weight." x_ = x else: bs_ = tf.shape(beta) bb_ = tf.concat([ tf.zeros([bs_[0], c_max, 1]), beta], axis=1) bbb_= tf.ones(bs_) w_ = tf.ones(bs_) zs_ = tf.shape(x) zz_ = tf.concat([ tf.zeros([zs_[0], c_max, zs_[2]]), x], axis=1) zzz_= zz_[:,c_max:,:] for i in range(c_max): print i bbb_ *= (1-bb_[:,c_max-i-1:-i-1,:]) zzz_ += zz_[:,c_max-i-1:-i-1,:] * bbb_ w_ += bbb_ x_ = zzz_ / w_ if att == None: att = beta else: att = att * beta out_ = mean_std_attention(x_, att, axes=axes) return out_ # Calculates each step individually. Does not uses prev. step. def mean_std_attention_framemerge_7(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False, floatX='float32'): if no_merge: print "Will not merge frames, only reduce their weight." x_ = x else: # Initialization i0_ = tf.constant(1, dtype='int32', name='pool_loop_index') x_a_ = tf.TensorArray(dtype=floatX, size=tf.shape(beta)[1], element_shape=tf.TensorShape([None, 23]) ) w_a_ = tf.TensorArray(dtype=floatX, size=tf.shape(beta)[1], element_shape=tf.TensorShape([None, 1]) ) x_ = x[:,0,:] w_ = tf.ones([tf.shape(beta)[0], 1]) x_a_ = x_a_.write(0, x[:,0,:]) w_a_ = w_a_.write(0, tf.ones([tf.shape(beta)[0], 1])) def body(i_, x_, w_, x_a_, w_a_ ): #x_new_ = (x[:,i_,:] + x_a_.read(i_ -1) * ( 1 - beta[:,i_-1,:] )) #w_new_ = (1 + w_a_.read(i_ -1) * ( 1 - beta[:,i_-1,:] )) #x_a_ = x_a_.write(i_, x_new_) #w_a_ = w_a_.write(i_, w_new_) x_ = x[:,i_,:] + x_ * ( 1 - beta[:,i_-1,:] ) w_ = 1 + w_ * ( 1 - beta[:,i_-1,:] ) x_a_ = x_a_.write(i_, x_) w_a_ = w_a_.write(i_, w_) return [tf.add(i_, 1), x_, w_, x_a_, w_a_] _, _, _, x_a_new_, w_a_new_= tf.while_loop(cond = lambda ii, xx, ww, xa, xw: tf.less(ii, tf.shape(beta)[1]), body=body, loop_vars=[i0_, x_, w_, x_a_, w_a_], #shape_invariants=[i0_.get_shape()], #tf.shape(beta)[1], tf.shape(beta)[1], parallel_iterations=1, swap_memory=loop_swap_memory) x_ = tf.transpose(x_a_new_.stack() / w_a_new_.stack(), perm=[1,0,2] ) # Output of map has instances in first dim which # is time in our case. So need to switch dims. if att == None: att = beta else: att = att * beta out = mean_std_attention(x_, att, axes=axes) return out # Calculates each step individually. Does not uses prev. step. def mean_std_attention_framemerge_6(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False, floatX='float32'): c_max = 10 if no_merge: print "Will not merge frames, only reduce their weight." x_ = x else: # Initialization i0_ = tf.constant(1, dtype='int32', name='pool_loop_index') x_a_ = tf.TensorArray(dtype=floatX, size=tf.shape(beta)[1], element_shape=tf.TensorShape([None, 1500]) ) w_a_ = tf.TensorArray(dtype=floatX, size=tf.shape(beta)[1], element_shape=tf.TensorShape([None, 1])) def body(i_, x_a_, w_a_ ): ii_ = tf.cast(i_, 'int32') s_ = tf.maximum(0, ii_ - c_max) w_ = tf.cumprod(1-beta[:,s_:ii_,:], reverse=True, axis=axes) z_ = tf.reduce_sum(x[:,s_:ii_,:] * w_, axis=axes ) + x[:,ii_,:] w_ = tf.reduce_sum( w_, axis=axes ) + 1 x_a_ = x_a_.write(i_, z_) w_a_ = w_a_.write(i_, w_) return [tf.add(i_, 1), x_a_, w_a_] i_, x_a_new_, w_a_new_= tf.while_loop(cond = lambda ii, xx, ww: tf.less(ii, tf.shape(beta)[1]), body=body, loop_vars=[i0_, x_a_, w_a_], #shape_invariants=[i0_.get_shape()], #tf.shape(beta)[1], tf.shape(beta)[1], parallel_iterations=10, swap_memory=loop_swap_memory) x_a_new_ = x_a_new_.write(0, x[:,0,:]) w_a_new_ = w_a_new_.write(0, tf.ones([tf.shape(beta)[0], 1])) x_ = tf.transpose(x_a_new_.stack() / w_a_new_.stack(), perm=[1,0,2] ) # Output of map has instances in first dim which # is time in our case. So need to switch dims. if att == None: att = beta else: att = att * beta out = mean_std_attention(x_, att, axes=axes) return out # Without using tf loop. Instead expands matrices. def mean_std_attention_framemerge_5(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False, floatX='float32'): c_max = 10 if no_merge: print "Will not merge frames, only reduce their weight." x_ = x else: bs_ = tf.shape(beta) bb_ = tf.expand_dims(tf.concat([ tf.zeros([bs_[0], c_max-1, 1]), beta],axis=1),-1) bbb_= bb_[:,c_max-1:,:,:] is_ = tf.shape(x) zz_ = tf.expand_dims(tf.concat([ tf.zeros([is_[0], c_max-1, is_[2]]), x], axis=1), -1) zzz_= zz_[:,c_max-1:,:,:] for i in range(1,c_max): print i zzz_= tf.concat([zz_[:,c_max-i-1:-i,...], zzz_],axis=3) bbb_= tf.concat([bb_[:,c_max-i-1:-i,...], bbb_],axis=3) #w_ = tf.cumprod(1 - tf.squeeze(bbb_), reverse=True, axis=2) w_ = tf.cumprod(1 - bbb_, reverse=True, axis=3) z_new_= tf.reduce_sum(zzz_[:,:-1,:,:] * w_[:,:-1,:,:], axis=3) + x[:,1:,:] z_new_= tf.concat([x[:,0:1,:], z_new_], axis=1 ) w_= tf.concat([tf.ones([is_[0],1,1]), tf.reduce_sum(w_, axis=3)[:,:-1,:]+1],axis=1) x_ = z_new_ / w_ if att == None: att = beta else: att = att * beta out_ = mean_std_attention(x_, att, axes=axes) return out_ # Calculates each step individually. Does not uses prev. step. def mean_std_attention_framemerge_4(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False, floatX='float32'): c_max = 10 if no_merge: print "Will not merge frames, only reduce their weight." x_ = x else: def body(i_ ): ii_ = tf.cast(i_, 'int32') s_ = tf.maximum(0, ii_ - c_max) w_ = tf.cumprod(1-beta[:,s_:ii_,:], reverse=True, axis=axes) z_ = tf.reduce_sum(x[:,s_:ii_,:] * w_, axis=axes ) + x[:,ii_,:] w_ = tf.reduce_sum( w_, axis=axes ) + 1 return [z_, w_] i_ = tf.range(start=0.0, limit=tf.cast(tf.shape(x)[1],'float32'), dtype='float32') #with tf.device('/cpu:0'): x_, w_ = tf.map_fn(fn=body, elems=i_, dtype=[floatX, floatX], parallel_iterations=1, swap_memory=False) x_ = tf.transpose(x_ / w_, perm=[1,0,2] ) # Output of map has instances in first dim which is time in our case. # So need to switch dims. if att == None: att = beta else: att = att * beta out = mean_std_attention(x_, att, axes=axes) return out # No weight? def mean_std_attention_framemerge_3(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False): t = 0 if no_merge: print "Will not merge frames, only reduce their weight." x_new_ = x else: #def body(x_, w_, bv_, i_): def body(x_, i_): x_new_ = tf.concat([x_, x[:, i_: i_ +1, :] ], axis=1) return [ x_new_, tf.add(i_, 1) ] # Initialization i0_ = tf.constant(1, dtype='int32', name='pool_loop_index') bv0_ = tf.ones([tf.shape(beta)[0], t+1, 1]) x_new_ = x[:,0:1,:] w_new_ = tf.ones([tf.shape(x)[0],1,1]) x_new_ = tf.while_loop(cond =lambda xx, ii: tf.less(ii, tf.shape(beta)[1] ), body=body, loop_vars=[x_new_, i0_ ], shape_invariants=[x.get_shape(), i0_.get_shape()], parallel_iterations=1, swap_memory=loop_swap_memory)[0] x_new_ = x_new_ #/ w_new_ if att == None: att = beta else: att = att * beta out = mean_std_attention(x_new_, att, axes=axes) return out # Keeps track of t last beta. Multiply by latest beta in each step. def mean_std_attention_framemerge_2(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=False, no_merge=False): t = 10 if no_merge: print "Will not merge frames, only reduce their weight." x_new_ = x else: def body(x_, w_, bv_, i_): tt_ = tf.minimum(t, i_) bv_new_ = tf.concat( [bv_[:,1:,:] *(1- beta[:,i_-1:i_,:]), tf.ones([tf.shape(bv_)[0],1,1])], axis=axes ) bv_new_.set_shape([None, t+1, 1]) x_new_ = tf.reduce_sum(x[:, i_ -tt_ : i_ +1, :] * bv_new_[:,t-tt_:,:], axis=axes, keep_dims=True) x_new_ = tf.concat([x_, x_new_], axis=1) w_new_ = tf.reduce_sum(bv_new_[:,t-tt_:,:], axis=axes, keep_dims=True) w_new_.set_shape([None,None,1]) w_new_ = tf.concat([w_, w_new_], axis=1) return [x_new_, w_new_, bv_new_, tf.add(i_, 1) ] # Initialization i0_ = tf.constant(1, dtype='int32', name='pool_loop_index') bv0_ = tf.ones([tf.shape(beta)[0], t+1, 1]) x_new_ = x[:,0:1,:] w_new_ = tf.ones([tf.shape(x)[0],1,1]) x_new_, w_new_ = tf.while_loop(cond =lambda xx, ww, bb, ii: tf.less(ii, tf.shape(beta)[1] ), body=body, loop_vars=[x_new_, w_new_, bv0_, i0_ ], shape_invariants=[x.get_shape(), tf.TensorShape([None,None,1]), bv0_.get_shape(), i0_.get_shape()], parallel_iterations=1, swap_memory=loop_swap_memory)[0:2] x_new_ = x_new_ / w_new_ if att == None: att = beta else: att = att * beta out = mean_std_attention(x_new_, att, axes=axes) return out # Summming x inside loop, frame by frame the natural way. def mean_std_attention_framemerge_1(x, beta, att, axes=0, variance_epsilon=1e-8, loop_swap_memory=True, no_merge=False): if no_merge: print "Will not merge frames, only reduce their weight." x_new_ = x else: def body(x_, w_, i_): #x_new_ = (x[:,i_:i_+1,:] + x[:,i_ -1:i_,:] * ( 1 - tf.expand_dims(beta[:,i_-1:i_],2) )) / (2 - tf.expand_dims(beta[:,i_-1:i_],2)) x_new_ = (x[:,i_:i_+1,:] + x_[:,i_ -1:i_,:] * ( 1 - beta[:,i_-1:i_,:] )) #/ (2 - beta[:,i_-1:i_,:]) x_new_ = tf.concat([x_, x_new_], axis=1) w_new_ = (1 + w_[:,i_ -1:i_,:] * ( 1 - beta[:,i_-1:i_,:] )) #/ (2 - beta[:,i_-1:i_,:]) w_new_ = tf.concat([w_, w_new_], axis=1) return [x_new_, w_new_, tf.add(i_, 1) ] # Initialization i0_ = tf.constant(1, dtype='int32', name='pool_loop_index') x_new_ = x[:,0:1,:] w_new_ = tf.ones([tf.shape(x)[0],1,1]) x_new_, w_new_ = tf.while_loop(cond =lambda xx, ww, ii: tf.less(ii, tf.shape(beta)[1] ), body=body, loop_vars=[x_new_, w_new_, i0_ ], shape_invariants=[x.get_shape(), tf.TensorShape([None,None,1]), i0_.get_shape()], parallel_iterations=1, swap_memory=loop_swap_memory)[0:2] x_new_ = x_new_ / w_new_ if att == None: att = beta #tf.expand_dims( beta, 2) else: att = att * beta #tf.expand_dims( beta, 2) #pass out = mean_std_attention(x_new_, att, axes=axes) return out # I experimented with applying instead of adding variance_epsilong but # this did not solve the nan problem """ def mean_std(x, axes=0): mean_, var_ = tf.nn.moments(x, axes=axes, keep_dims=True) return ( tf.concat([mean_, tf.sqrt(tf.nn.relu(var_)),], axis=-1) ) """ def m_std(x, floatX): n = tf.cast(tf.shape(x)[0], floatX) s1 = tf.reduce_sum(x, axis=0, keep_dims=True) # If n > 0 this gives us the mean/std. If n==0, it gives us 0 n2 = tf.cond(tf.equal(n, 0), lambda: np.ones(1).squeeze().astype(floatX), lambda: n) m = n * s1 / (n2 **2) s2 = tf.reduce_sum((x - m) **2, axis=0, keep_dims=True) s = tf.sqrt(n * s2 / (n2**2)) return tf.concat([m, s], axis=1)
38.18319
144
0.528193
2,647
17,717
3.209294
0.080091
0.009182
0.041436
0.030135
0.850029
0.80824
0.785403
0.762449
0.749971
0.73455
0
0.037387
0.319129
17,717
463
145
38.265659
0.666832
0.113507
0
0.62585
0
0
0.03992
0
0
0
0
0
0
0
null
null
0
0.006803
null
null
0.037415
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
7
c06230534fec8081cd5bc16527157364476f7955
611,312
py
Python
ibm_watson/discovery_v1.py
laggraw/python-sdk
80b33065b8d526a9a5f9a62dc892a6fba53c703f
[ "Apache-2.0" ]
null
null
null
ibm_watson/discovery_v1.py
laggraw/python-sdk
80b33065b8d526a9a5f9a62dc892a6fba53c703f
[ "Apache-2.0" ]
2
2020-01-18T23:42:45.000Z
2020-01-18T23:52:44.000Z
ibm_watson/discovery_v1.py
truthiswill/python-sdk-1
e0e5f833e4935f9b52c17c4fae653c08b2bc323f
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # (C) Copyright IBM Corp. 2019, 2020. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ IBM Watson&trade; Discovery is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better decision-making. Securely unify structured and unstructured data with pre-enriched content, and use a simplified query language to eliminate the need for manual filtering of results. """ import json from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator from .common import get_sdk_headers from datetime import date from datetime import datetime from enum import Enum from ibm_cloud_sdk_core import BaseService from ibm_cloud_sdk_core import datetime_to_string, string_to_datetime from ibm_cloud_sdk_core import get_authenticator_from_environment from os.path import basename from typing import BinaryIO from typing import Dict from typing import List import sys ############################################################################## # Service ############################################################################## class DiscoveryV1(BaseService): """The Discovery V1 service.""" DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/discovery/api' DEFAULT_SERVICE_NAME = 'discovery' def __init__( self, version: str, authenticator: Authenticator = None, service_name: str = DEFAULT_SERVICE_NAME, ) -> None: """ Construct a new client for the Discovery service. :param str version: The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md about initializing the authenticator of your choice. """ if not authenticator: authenticator = get_authenticator_from_environment(service_name) BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator, disable_ssl_verification=False) self.version = version self.configure_service(service_name) ######################### # Environments ######################### def create_environment(self, name: str, *, description: str = None, size: str = None, **kwargs) -> 'DetailedResponse': """ Create an environment. Creates a new environment for private data. An environment must be created before collections can be created. **Note**: You can create only one environment for private data per service instance. An attempt to create another environment results in an error. :param str name: Name that identifies the environment. :param str description: (optional) Description of the environment. :param str size: (optional) Size of the environment. In the Lite plan the default and only accepted value is `LT`, in all other plans the default is `S`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if name is None: raise ValueError('name must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_environment') headers.update(sdk_headers) params = {'version': self.version} data = {'name': name, 'description': description, 'size': size} url = '/v1/environments' request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def list_environments(self, *, name: str = None, **kwargs) -> 'DetailedResponse': """ List environments. List existing environments for the service instance. :param str name: (optional) Show only the environment with the given name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_environments') headers.update(sdk_headers) params = {'version': self.version, 'name': name} url = '/v1/environments' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_environment(self, environment_id: str, **kwargs) -> 'DetailedResponse': """ Get environment info. :param str environment_id: The ID of the environment. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_environment') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def update_environment(self, environment_id: str, *, name: str = None, description: str = None, size: str = None, **kwargs) -> 'DetailedResponse': """ Update an environment. Updates an environment. The environment's **name** and **description** parameters can be changed. You must specify a **name** for the environment. :param str environment_id: The ID of the environment. :param str name: (optional) Name that identifies the environment. :param str description: (optional) Description of the environment. :param str size: (optional) Size that the environment should be increased to. Environment size cannot be modified when using a Lite plan. Environment size can only increased and not decreased. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_environment') headers.update(sdk_headers) params = {'version': self.version} data = {'name': name, 'description': description, 'size': size} url = '/v1/environments/{0}'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_environment(self, environment_id: str, **kwargs) -> 'DetailedResponse': """ Delete environment. :param str environment_id: The ID of the environment. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_environment') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def list_fields(self, environment_id: str, collection_ids: List[str], **kwargs) -> 'DetailedResponse': """ List fields across collections. Gets a list of the unique fields (and their types) stored in the indexes of the specified collections. :param str environment_id: The ID of the environment. :param List[str] collection_ids: A comma-separated list of collection IDs to be queried against. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_ids is None: raise ValueError('collection_ids must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_fields') headers.update(sdk_headers) params = { 'version': self.version, 'collection_ids': self._convert_list(collection_ids) } url = '/v1/environments/{0}/fields'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Configurations ######################### def create_configuration( self, environment_id: str, name: str, *, description: str = None, conversions: 'Conversions' = None, enrichments: List['Enrichment'] = None, normalizations: List['NormalizationOperation'] = None, source: 'Source' = None, **kwargs) -> 'DetailedResponse': """ Add configuration. Creates a new configuration. If the input configuration contains the **configuration_id**, **created**, or **updated** properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration. The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration. :param str environment_id: The ID of the environment. :param str name: The name of the configuration. :param str description: (optional) The description of the configuration, if available. :param Conversions conversions: (optional) Document conversion settings. :param List[Enrichment] enrichments: (optional) An array of document enrichment settings for the configuration. :param List[NormalizationOperation] normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :param Source source: (optional) Object containing source parameters for the configuration. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if name is None: raise ValueError('name must be provided') if conversions is not None: conversions = self._convert_model(conversions) if enrichments is not None: enrichments = [self._convert_model(x) for x in enrichments] if normalizations is not None: normalizations = [self._convert_model(x) for x in normalizations] if source is not None: source = self._convert_model(source) headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_configuration') headers.update(sdk_headers) params = {'version': self.version} data = { 'name': name, 'description': description, 'conversions': conversions, 'enrichments': enrichments, 'normalizations': normalizations, 'source': source } url = '/v1/environments/{0}/configurations'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def list_configurations(self, environment_id: str, *, name: str = None, **kwargs) -> 'DetailedResponse': """ List configurations. Lists existing configurations for the service instance. :param str environment_id: The ID of the environment. :param str name: (optional) Find configurations with the given name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_configurations') headers.update(sdk_headers) params = {'version': self.version, 'name': name} url = '/v1/environments/{0}/configurations'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_configuration(self, environment_id: str, configuration_id: str, **kwargs) -> 'DetailedResponse': """ Get configuration details. :param str environment_id: The ID of the environment. :param str configuration_id: The ID of the configuration. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if configuration_id is None: raise ValueError('configuration_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_configuration') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/configurations/{1}'.format( *self._encode_path_vars(environment_id, configuration_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def update_configuration( self, environment_id: str, configuration_id: str, name: str, *, description: str = None, conversions: 'Conversions' = None, enrichments: List['Enrichment'] = None, normalizations: List['NormalizationOperation'] = None, source: 'Source' = None, **kwargs) -> 'DetailedResponse': """ Update a configuration. Replaces an existing configuration. * Completely replaces the original configuration. * The **configuration_id**, **updated**, and **created** fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties. * Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration. :param str environment_id: The ID of the environment. :param str configuration_id: The ID of the configuration. :param str name: The name of the configuration. :param str description: (optional) The description of the configuration, if available. :param Conversions conversions: (optional) Document conversion settings. :param List[Enrichment] enrichments: (optional) An array of document enrichment settings for the configuration. :param List[NormalizationOperation] normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :param Source source: (optional) Object containing source parameters for the configuration. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if configuration_id is None: raise ValueError('configuration_id must be provided') if name is None: raise ValueError('name must be provided') if conversions is not None: conversions = self._convert_model(conversions) if enrichments is not None: enrichments = [self._convert_model(x) for x in enrichments] if normalizations is not None: normalizations = [self._convert_model(x) for x in normalizations] if source is not None: source = self._convert_model(source) headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_configuration') headers.update(sdk_headers) params = {'version': self.version} data = { 'name': name, 'description': description, 'conversions': conversions, 'enrichments': enrichments, 'normalizations': normalizations, 'source': source } url = '/v1/environments/{0}/configurations/{1}'.format( *self._encode_path_vars(environment_id, configuration_id)) request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_configuration(self, environment_id: str, configuration_id: str, **kwargs) -> 'DetailedResponse': """ Delete a configuration. The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted. :param str environment_id: The ID of the environment. :param str configuration_id: The ID of the configuration. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if configuration_id is None: raise ValueError('configuration_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_configuration') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/configurations/{1}'.format( *self._encode_path_vars(environment_id, configuration_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Collections ######################### def create_collection(self, environment_id: str, name: str, *, description: str = None, configuration_id: str = None, language: str = None, **kwargs) -> 'DetailedResponse': """ Create a collection. :param str environment_id: The ID of the environment. :param str name: The name of the collection to be created. :param str description: (optional) A description of the collection. :param str configuration_id: (optional) The ID of the configuration in which the collection is to be created. :param str language: (optional) The language of the documents stored in the collection, in the form of an ISO 639-1 language code. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if name is None: raise ValueError('name must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_collection') headers.update(sdk_headers) params = {'version': self.version} data = { 'name': name, 'description': description, 'configuration_id': configuration_id, 'language': language } url = '/v1/environments/{0}/collections'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def list_collections(self, environment_id: str, *, name: str = None, **kwargs) -> 'DetailedResponse': """ List collections. Lists existing collections for the service instance. :param str environment_id: The ID of the environment. :param str name: (optional) Find collections with the given name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_collections') headers.update(sdk_headers) params = {'version': self.version, 'name': name} url = '/v1/environments/{0}/collections'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_collection(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Get collection details. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_collection') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def update_collection(self, environment_id: str, collection_id: str, name: str, *, description: str = None, configuration_id: str = None, **kwargs) -> 'DetailedResponse': """ Update a collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str name: The name of the collection. :param str description: (optional) A description of the collection. :param str configuration_id: (optional) The ID of the configuration in which the collection is to be updated. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if name is None: raise ValueError('name must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_collection') headers.update(sdk_headers) params = {'version': self.version} data = { 'name': name, 'description': description, 'configuration_id': configuration_id } url = '/v1/environments/{0}/collections/{1}'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_collection(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Delete a collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_collection') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def list_collection_fields(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ List collection fields. Gets a list of the unique fields (and their types) stored in the index. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_collection_fields') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/fields'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Query modifications ######################### def list_expansions(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Get the expansion list. Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_expansions') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/expansions'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def create_expansions(self, environment_id: str, collection_id: str, expansions: List['Expansion'], **kwargs) -> 'DetailedResponse': """ Create or update expansion list. Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is `500`. The current expansion list is replaced with the uploaded content. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param List[Expansion] expansions: An array of query expansion definitions. Each object in the **expansions** array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms. To create a bi-directional expansion specify an **expanded_terms** array. When found in a query, all items in the **expanded_terms** array are then expanded to the other items in the same array. To create a uni-directional expansion, specify both an array of **input_terms** and an array of **expanded_terms**. When items in the **input_terms** array are present in a query, they are expanded using the items listed in the **expanded_terms** array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if expansions is None: raise ValueError('expansions must be provided') expansions = [self._convert_model(x) for x in expansions] headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_expansions') headers.update(sdk_headers) params = {'version': self.version} data = {'expansions': expansions} url = '/v1/environments/{0}/collections/{1}/expansions'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_expansions(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Delete the expansion list. Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_expansions') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/expansions'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def get_tokenization_dictionary_status(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Get tokenization dictionary status. Returns the current status of the tokenization dictionary for the specified collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_tokenization_dictionary_status') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/word_lists/tokenization_dictionary'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def create_tokenization_dictionary( self, environment_id: str, collection_id: str, *, tokenization_rules: List['TokenDictRule'] = None, **kwargs) -> 'DetailedResponse': """ Create tokenization dictionary. Upload a custom tokenization dictionary to use with the specified collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param List[TokenDictRule] tokenization_rules: (optional) An array of tokenization rules. Each rule contains, the original `text` string, component `tokens`, any alternate character set `readings`, and which `part_of_speech` the text is from. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if tokenization_rules is not None: tokenization_rules = [ self._convert_model(x) for x in tokenization_rules ] headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_tokenization_dictionary') headers.update(sdk_headers) params = {'version': self.version} data = {'tokenization_rules': tokenization_rules} url = '/v1/environments/{0}/collections/{1}/word_lists/tokenization_dictionary'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_tokenization_dictionary(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Delete tokenization dictionary. Delete the tokenization dictionary from the collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_tokenization_dictionary') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/word_lists/tokenization_dictionary'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def get_stopword_list_status(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Get stopword list status. Returns the current status of the stopword list for the specified collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_stopword_list_status') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/word_lists/stopwords'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def create_stopword_list(self, environment_id: str, collection_id: str, stopword_file: BinaryIO, *, stopword_filename: str = None, **kwargs) -> 'DetailedResponse': """ Create stopword list. Upload a custom stopword list to use with the specified collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param TextIO stopword_file: The content of the stopword list to ingest. :param str stopword_filename: (optional) The filename for stopword_file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if stopword_file is None: raise ValueError('stopword_file must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_stopword_list') headers.update(sdk_headers) params = {'version': self.version} form_data = [] if not stopword_filename and hasattr(stopword_file, 'name'): stopword_filename = basename(stopword_file.name) if not stopword_filename: raise ValueError('stopword_filename must be provided') form_data.append(('stopword_file', (stopword_filename, stopword_file, 'application/octet-stream'))) url = '/v1/environments/{0}/collections/{1}/word_lists/stopwords'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, files=form_data) response = self.send(request) return response def delete_stopword_list(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Delete a custom stopword list. Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_stopword_list') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/word_lists/stopwords'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Documents ######################### def add_document(self, environment_id: str, collection_id: str, *, file: BinaryIO = None, filename: str = None, file_content_type: str = None, metadata: str = None, **kwargs) -> 'DetailedResponse': """ Add a document. Add a document to a collection with optional metadata. * The **version** query parameter is still required. * Returns immediately after the system has accepted the document for processing. * The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected. * The user can set the **Content-Type** parameter on the **file** part to indicate the media type of the document. If the **Content-Type** parameter is missing or is one of the generic media types (for example, `application/octet-stream`), then the service attempts to automatically detect the document's media type. * The following field names are reserved and will be filtered out if present after normalization: `id`, `score`, `highlight`, and any field with the prefix of: `_`, `+`, or `-` * Fields with empty name values after normalization are filtered out before indexing. * Fields containing the following characters after normalization are filtered out before indexing: `#` and `,` **Note:** Documents can be added with a specific **document_id** by using the **_/v1/environments/{environment_id}/collections/{collection_id}/documents** method. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param TextIO file: (optional) The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected. :param str filename: (optional) The filename for file. :param str file_content_type: (optional) The content type of file. :param str metadata: (optional) The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: ``` { "Creator": "Johnny Appleseed", "Subject": "Apples" } ```. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_document') headers.update(sdk_headers) params = {'version': self.version} form_data = [] if file: if not filename and hasattr(file, 'name'): filename = basename(file.name) if not filename: raise ValueError('filename must be provided') form_data.append(('file', (filename, file, file_content_type or 'application/octet-stream'))) if metadata: metadata = str(metadata) form_data.append(('metadata', (None, metadata, 'text/plain'))) url = '/v1/environments/{0}/collections/{1}/documents'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, files=form_data) response = self.send(request) return response def get_document_status(self, environment_id: str, collection_id: str, document_id: str, **kwargs) -> 'DetailedResponse': """ Get document details. Fetch status details about a submitted document. **Note:** this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str document_id: The ID of the document. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if document_id is None: raise ValueError('document_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_document_status') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/documents/{2}'.format( *self._encode_path_vars(environment_id, collection_id, document_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def update_document(self, environment_id: str, collection_id: str, document_id: str, *, file: BinaryIO = None, filename: str = None, file_content_type: str = None, metadata: str = None, **kwargs) -> 'DetailedResponse': """ Update a document. Replace an existing document or add a document with a specified **document_id**. Starts ingesting a document with optional metadata. **Note:** When uploading a new document with this method it automatically replaces any document stored with the same **document_id** if it exists. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str document_id: The ID of the document. :param TextIO file: (optional) The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected. :param str filename: (optional) The filename for file. :param str file_content_type: (optional) The content type of file. :param str metadata: (optional) The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: ``` { "Creator": "Johnny Appleseed", "Subject": "Apples" } ```. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if document_id is None: raise ValueError('document_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_document') headers.update(sdk_headers) params = {'version': self.version} form_data = [] if file: if not filename and hasattr(file, 'name'): filename = basename(file.name) if not filename: raise ValueError('filename must be provided') form_data.append(('file', (filename, file, file_content_type or 'application/octet-stream'))) if metadata: metadata = str(metadata) form_data.append(('metadata', (None, metadata, 'text/plain'))) url = '/v1/environments/{0}/collections/{1}/documents/{2}'.format( *self._encode_path_vars(environment_id, collection_id, document_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, files=form_data) response = self.send(request) return response def delete_document(self, environment_id: str, collection_id: str, document_id: str, **kwargs) -> 'DetailedResponse': """ Delete a document. If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code `200`) with the status set to 'deleted'. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str document_id: The ID of the document. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if document_id is None: raise ValueError('document_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_document') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/documents/{2}'.format( *self._encode_path_vars(environment_id, collection_id, document_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Queries ######################### def query(self, environment_id: str, collection_id: str, *, filter: str = None, query: str = None, natural_language_query: str = None, passages: bool = None, aggregation: str = None, count: int = None, return_: str = None, offset: int = None, sort: str = None, highlight: bool = None, passages_fields: str = None, passages_count: int = None, passages_characters: int = None, deduplicate: bool = None, deduplicate_field: str = None, similar: bool = None, similar_document_ids: str = None, similar_fields: str = None, bias: str = None, spelling_suggestions: bool = None, x_watson_logging_opt_out: bool = None, **kwargs) -> 'DetailedResponse': """ Query a collection. By using this method, you can construct long queries. For details, see the [Discovery documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts). :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str filter: (optional) A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set. :param str query: (optional) A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results. :param str natural_language_query: (optional) A natural language query that returns relevant documents by utilizing training data and natural language understanding. :param bool passages: (optional) A passages query that returns the most relevant passages from the results. :param str aggregation: (optional) An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference. :param int count: (optional) Number of results to return. :param str return_: (optional) A comma-separated list of the portion of the document hierarchy to return. :param int offset: (optional) The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. :param str sort: (optional) A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the **bias** parameter. :param bool highlight: (optional) When true, a highlight field is returned for each result which contains the fields which match the query with `<em></em>` tags around the matching query terms. :param str passages_fields: (optional) A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included. :param int passages_count: (optional) The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is `10`. The maximum is `100`. :param int passages_characters: (optional) The approximate number of characters that any one passage will have. :param bool deduplicate: (optional) When `true`, and used with a Watson Discovery News collection, duplicate results (based on the contents of the **title** field) are removed. Duplicate comparison is limited to the current query only; **offset** is not considered. This parameter is currently Beta functionality. :param str deduplicate_field: (optional) When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, **offset** is not considered. This parameter is currently Beta functionality. :param bool similar: (optional) When `true`, results are returned based on their similarity to the document IDs specified in the **similar.document_ids** parameter. :param str similar_document_ids: (optional) A comma-separated list of document IDs to find similar documents. **Tip:** Include the **natural_language_query** parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as **filter** and **query**, are subsequently applied and reduce the scope. :param str similar_fields: (optional) A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison. :param str bias: (optional) Field which the returned results will be biased against. The specified field must be either a **date** or **number** format. When a **date** type field is specified returned results are biased towards field values closer to the current date. When a **number** type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the **sort** parameter. :param bool spelling_suggestions: (optional) When `true` and the **natural_language_query** parameter is used, the **natural_languge_query** parameter is spell checked. The most likely correction is retunred in the **suggested_query** field of the response (if one exists). **Important:** this parameter is only valid when using the Cloud Pak version of Discovery. :param bool x_watson_logging_opt_out: (optional) If `true`, queries are not stored in the Discovery **Logs** endpoint. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {'X-Watson-Logging-Opt-Out': x_watson_logging_opt_out} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='query') headers.update(sdk_headers) params = {'version': self.version} data = { 'filter': filter, 'query': query, 'natural_language_query': natural_language_query, 'passages': passages, 'aggregation': aggregation, 'count': count, 'return': return_, 'offset': offset, 'sort': sort, 'highlight': highlight, 'passages.fields': passages_fields, 'passages.count': passages_count, 'passages.characters': passages_characters, 'deduplicate': deduplicate, 'deduplicate.field': deduplicate_field, 'similar': similar, 'similar.document_ids': similar_document_ids, 'similar.fields': similar_fields, 'bias': bias, 'spelling_suggestions': spelling_suggestions } url = '/v1/environments/{0}/collections/{1}/query'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def query_notices(self, environment_id: str, collection_id: str, *, filter: str = None, query: str = None, natural_language_query: str = None, passages: bool = None, aggregation: str = None, count: int = None, return_: List[str] = None, offset: int = None, sort: List[str] = None, highlight: bool = None, passages_fields: List[str] = None, passages_count: int = None, passages_characters: int = None, deduplicate_field: str = None, similar: bool = None, similar_document_ids: List[str] = None, similar_fields: List[str] = None, **kwargs) -> 'DetailedResponse': """ Query system notices. Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the [Discovery documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts) for more details on the query language. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str filter: (optional) A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set. :param str query: (optional) A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. :param str natural_language_query: (optional) A natural language query that returns relevant documents by utilizing training data and natural language understanding. :param bool passages: (optional) A passages query that returns the most relevant passages from the results. :param str aggregation: (optional) An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference. :param int count: (optional) Number of results to return. The maximum for the **count** and **offset** values together in any one query is **10000**. :param List[str] return_: (optional) A comma-separated list of the portion of the document hierarchy to return. :param int offset: (optional) The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the **count** and **offset** values together in any one query is **10000**. :param List[str] sort: (optional) A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending is the default sort direction if no prefix is specified. :param bool highlight: (optional) When true, a highlight field is returned for each result which contains the fields which match the query with `<em></em>` tags around the matching query terms. :param List[str] passages_fields: (optional) A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included. :param int passages_count: (optional) The maximum number of passages to return. The search returns fewer passages if the requested total is not found. :param int passages_characters: (optional) The approximate number of characters that any one passage will have. :param str deduplicate_field: (optional) When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, **offset** is not considered. This parameter is currently Beta functionality. :param bool similar: (optional) When `true`, results are returned based on their similarity to the document IDs specified in the **similar.document_ids** parameter. :param List[str] similar_document_ids: (optional) A comma-separated list of document IDs to find similar documents. **Tip:** Include the **natural_language_query** parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as **filter** and **query**, are subsequently applied and reduce the scope. :param List[str] similar_fields: (optional) A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='query_notices') headers.update(sdk_headers) params = { 'version': self.version, 'filter': filter, 'query': query, 'natural_language_query': natural_language_query, 'passages': passages, 'aggregation': aggregation, 'count': count, 'return': self._convert_list(return_), 'offset': offset, 'sort': self._convert_list(sort), 'highlight': highlight, 'passages.fields': self._convert_list(passages_fields), 'passages.count': passages_count, 'passages.characters': passages_characters, 'deduplicate.field': deduplicate_field, 'similar': similar, 'similar.document_ids': self._convert_list(similar_document_ids), 'similar.fields': self._convert_list(similar_fields) } url = '/v1/environments/{0}/collections/{1}/notices'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def federated_query(self, environment_id: str, collection_ids: str, *, filter: str = None, query: str = None, natural_language_query: str = None, passages: bool = None, aggregation: str = None, count: int = None, return_: str = None, offset: int = None, sort: str = None, highlight: bool = None, passages_fields: str = None, passages_count: int = None, passages_characters: int = None, deduplicate: bool = None, deduplicate_field: str = None, similar: bool = None, similar_document_ids: str = None, similar_fields: str = None, bias: str = None, x_watson_logging_opt_out: bool = None, **kwargs) -> 'DetailedResponse': """ Query multiple collections. By using this method, you can construct long queries that search multiple collection. For details, see the [Discovery documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts). :param str environment_id: The ID of the environment. :param str collection_ids: A comma-separated list of collection IDs to be queried against. :param str filter: (optional) A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set. :param str query: (optional) A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results. :param str natural_language_query: (optional) A natural language query that returns relevant documents by utilizing training data and natural language understanding. :param bool passages: (optional) A passages query that returns the most relevant passages from the results. :param str aggregation: (optional) An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference. :param int count: (optional) Number of results to return. :param str return_: (optional) A comma-separated list of the portion of the document hierarchy to return. :param int offset: (optional) The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. :param str sort: (optional) A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the **bias** parameter. :param bool highlight: (optional) When true, a highlight field is returned for each result which contains the fields which match the query with `<em></em>` tags around the matching query terms. :param str passages_fields: (optional) A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included. :param int passages_count: (optional) The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is `10`. The maximum is `100`. :param int passages_characters: (optional) The approximate number of characters that any one passage will have. :param bool deduplicate: (optional) When `true`, and used with a Watson Discovery News collection, duplicate results (based on the contents of the **title** field) are removed. Duplicate comparison is limited to the current query only; **offset** is not considered. This parameter is currently Beta functionality. :param str deduplicate_field: (optional) When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, **offset** is not considered. This parameter is currently Beta functionality. :param bool similar: (optional) When `true`, results are returned based on their similarity to the document IDs specified in the **similar.document_ids** parameter. :param str similar_document_ids: (optional) A comma-separated list of document IDs to find similar documents. **Tip:** Include the **natural_language_query** parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as **filter** and **query**, are subsequently applied and reduce the scope. :param str similar_fields: (optional) A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison. :param str bias: (optional) Field which the returned results will be biased against. The specified field must be either a **date** or **number** format. When a **date** type field is specified returned results are biased towards field values closer to the current date. When a **number** type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the **sort** parameter. :param bool x_watson_logging_opt_out: (optional) If `true`, queries are not stored in the Discovery **Logs** endpoint. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_ids is None: raise ValueError('collection_ids must be provided') headers = {'X-Watson-Logging-Opt-Out': x_watson_logging_opt_out} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='federated_query') headers.update(sdk_headers) params = {'version': self.version} data = { 'collection_ids': collection_ids, 'filter': filter, 'query': query, 'natural_language_query': natural_language_query, 'passages': passages, 'aggregation': aggregation, 'count': count, 'return': return_, 'offset': offset, 'sort': sort, 'highlight': highlight, 'passages.fields': passages_fields, 'passages.count': passages_count, 'passages.characters': passages_characters, 'deduplicate': deduplicate, 'deduplicate.field': deduplicate_field, 'similar': similar, 'similar.document_ids': similar_document_ids, 'similar.fields': similar_fields, 'bias': bias } url = '/v1/environments/{0}/query'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def federated_query_notices(self, environment_id: str, collection_ids: List[str], *, filter: str = None, query: str = None, natural_language_query: str = None, aggregation: str = None, count: int = None, return_: List[str] = None, offset: int = None, sort: List[str] = None, highlight: bool = None, deduplicate_field: str = None, similar: bool = None, similar_document_ids: List[str] = None, similar_fields: List[str] = None, **kwargs) -> 'DetailedResponse': """ Query multiple collection system notices. Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the [Discovery documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts) for more details on the query language. :param str environment_id: The ID of the environment. :param List[str] collection_ids: A comma-separated list of collection IDs to be queried against. :param str filter: (optional) A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set. :param str query: (optional) A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. :param str natural_language_query: (optional) A natural language query that returns relevant documents by utilizing training data and natural language understanding. :param str aggregation: (optional) An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference. :param int count: (optional) Number of results to return. The maximum for the **count** and **offset** values together in any one query is **10000**. :param List[str] return_: (optional) A comma-separated list of the portion of the document hierarchy to return. :param int offset: (optional) The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the **count** and **offset** values together in any one query is **10000**. :param List[str] sort: (optional) A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending is the default sort direction if no prefix is specified. :param bool highlight: (optional) When true, a highlight field is returned for each result which contains the fields which match the query with `<em></em>` tags around the matching query terms. :param str deduplicate_field: (optional) When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, **offset** is not considered. This parameter is currently Beta functionality. :param bool similar: (optional) When `true`, results are returned based on their similarity to the document IDs specified in the **similar.document_ids** parameter. :param List[str] similar_document_ids: (optional) A comma-separated list of document IDs to find similar documents. **Tip:** Include the **natural_language_query** parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as **filter** and **query**, are subsequently applied and reduce the scope. :param List[str] similar_fields: (optional) A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_ids is None: raise ValueError('collection_ids must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='federated_query_notices') headers.update(sdk_headers) params = { 'version': self.version, 'collection_ids': self._convert_list(collection_ids), 'filter': filter, 'query': query, 'natural_language_query': natural_language_query, 'aggregation': aggregation, 'count': count, 'return': self._convert_list(return_), 'offset': offset, 'sort': self._convert_list(sort), 'highlight': highlight, 'deduplicate.field': deduplicate_field, 'similar': similar, 'similar.document_ids': self._convert_list(similar_document_ids), 'similar.fields': self._convert_list(similar_fields) } url = '/v1/environments/{0}/notices'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_autocompletion(self, environment_id: str, collection_id: str, prefix: str, *, field: str = None, count: int = None, **kwargs) -> 'DetailedResponse': """ Get Autocomplete Suggestions. Returns completion query suggestions for the specified prefix. /n/n **Important:** this method is only valid when using the Cloud Pak version of Discovery. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str prefix: The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete to `Hot`, `Housing`, or `How do I upgrade`. Possible completions are. :param str field: (optional) The field in the result documents that autocompletion suggestions are identified from. :param int count: (optional) The number of autocompletion suggestions to return. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if prefix is None: raise ValueError('prefix must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_autocompletion') headers.update(sdk_headers) params = { 'version': self.version, 'prefix': prefix, 'field': field, 'count': count } url = '/v1/environments/{0}/collections/{1}/autocompletion'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Training data ######################### def list_training_data(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ List training data. Lists the training data for the specified collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_training_data') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def add_training_data(self, environment_id: str, collection_id: str, *, natural_language_query: str = None, filter: str = None, examples: List['TrainingExample'] = None, **kwargs) -> 'DetailedResponse': """ Add query to training data. Adds a query to the training data for this collection. The query can contain a filter and natural language query. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str natural_language_query: (optional) The natural text query for the new training query. :param str filter: (optional) The filter used on the collection before the **natural_language_query** is applied. :param List[TrainingExample] examples: (optional) Array of training examples. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if examples is not None: examples = [self._convert_model(x) for x in examples] headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_training_data') headers.update(sdk_headers) params = {'version': self.version} data = { 'natural_language_query': natural_language_query, 'filter': filter, 'examples': examples } url = '/v1/environments/{0}/collections/{1}/training_data'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_all_training_data(self, environment_id: str, collection_id: str, **kwargs) -> 'DetailedResponse': """ Delete all training data. Deletes all training data from a collection. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_all_training_data') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data'.format( *self._encode_path_vars(environment_id, collection_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def get_training_data(self, environment_id: str, collection_id: str, query_id: str, **kwargs) -> 'DetailedResponse': """ Get details about a query. Gets details for a specific training data query, including the query string and all examples. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_training_data') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data/{2}'.format( *self._encode_path_vars(environment_id, collection_id, query_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def delete_training_data(self, environment_id: str, collection_id: str, query_id: str, **kwargs) -> 'DetailedResponse': """ Delete a training data query. Removes the training data query and all associated examples from the training data set. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_training_data') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data/{2}'.format( *self._encode_path_vars(environment_id, collection_id, query_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def list_training_examples(self, environment_id: str, collection_id: str, query_id: str, **kwargs) -> 'DetailedResponse': """ List examples for a training data query. List all examples for this training data query. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_training_examples') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data/{2}/examples'.format( *self._encode_path_vars(environment_id, collection_id, query_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def create_training_example(self, environment_id: str, collection_id: str, query_id: str, *, document_id: str = None, cross_reference: str = None, relevance: int = None, **kwargs) -> 'DetailedResponse': """ Add example to training data query. Adds a example to this training data query. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param str document_id: (optional) The document ID associated with this training example. :param str cross_reference: (optional) The cross reference associated with this training example. :param int relevance: (optional) The relevance of the training example. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_training_example') headers.update(sdk_headers) params = {'version': self.version} data = { 'document_id': document_id, 'cross_reference': cross_reference, 'relevance': relevance } url = '/v1/environments/{0}/collections/{1}/training_data/{2}/examples'.format( *self._encode_path_vars(environment_id, collection_id, query_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_training_example(self, environment_id: str, collection_id: str, query_id: str, example_id: str, **kwargs) -> 'DetailedResponse': """ Delete example for training data query. Deletes the example document with the given ID from the training data query. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param str example_id: The ID of the document as it is indexed. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') if example_id is None: raise ValueError('example_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_training_example') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data/{2}/examples/{3}'.format( *self._encode_path_vars(environment_id, collection_id, query_id, example_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response def update_training_example(self, environment_id: str, collection_id: str, query_id: str, example_id: str, *, cross_reference: str = None, relevance: int = None, **kwargs) -> 'DetailedResponse': """ Change label or cross reference for example. Changes the label or cross reference query for this training data example. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param str example_id: The ID of the document as it is indexed. :param str cross_reference: (optional) The example to add. :param int relevance: (optional) The relevance value for this example. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') if example_id is None: raise ValueError('example_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_training_example') headers.update(sdk_headers) params = {'version': self.version} data = {'cross_reference': cross_reference, 'relevance': relevance} url = '/v1/environments/{0}/collections/{1}/training_data/{2}/examples/{3}'.format( *self._encode_path_vars(environment_id, collection_id, query_id, example_id)) request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def get_training_example(self, environment_id: str, collection_id: str, query_id: str, example_id: str, **kwargs) -> 'DetailedResponse': """ Get details for training data example. Gets the details for this training example. :param str environment_id: The ID of the environment. :param str collection_id: The ID of the collection. :param str query_id: The ID of the query used for training. :param str example_id: The ID of the document as it is indexed. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if collection_id is None: raise ValueError('collection_id must be provided') if query_id is None: raise ValueError('query_id must be provided') if example_id is None: raise ValueError('example_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_training_example') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/collections/{1}/training_data/{2}/examples/{3}'.format( *self._encode_path_vars(environment_id, collection_id, query_id, example_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # User data ######################### def delete_user_data(self, customer_id: str, **kwargs) -> 'DetailedResponse': """ Delete labeled data. Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID. You associate a customer ID with data by passing the **X-Watson-Metadata** header with a request that passes data. For more information about personal data and customer IDs, see [Information security](https://cloud.ibm.com/docs/services/discovery?topic=discovery-information-security#information-security). :param str customer_id: The customer ID for which all data is to be deleted. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if customer_id is None: raise ValueError('customer_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_user_data') headers.update(sdk_headers) params = {'version': self.version, 'customer_id': customer_id} url = '/v1/user_data' request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Events and feedback ######################### def create_event(self, type: str, data: 'EventData', **kwargs) -> 'DetailedResponse': """ Create event. The **Events** API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred. :param str type: The event type to be created. :param EventData data: Query event data object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if type is None: raise ValueError('type must be provided') if data is None: raise ValueError('data must be provided') data = self._convert_model(data) headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_event') headers.update(sdk_headers) params = {'version': self.version} data = {'type': type, 'data': data} url = '/v1/events' request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def query_log(self, *, filter: str = None, query: str = None, count: int = None, offset: int = None, sort: List[str] = None, **kwargs) -> 'DetailedResponse': """ Search the query and event log. Searches the query and event log to find query sessions that match the specified criteria. Searching the **logs** endpoint uses the standard Discovery query syntax for the parameters that are supported. :param str filter: (optional) A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set. :param str query: (optional) A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. :param int count: (optional) Number of results to return. The maximum for the **count** and **offset** values together in any one query is **10000**. :param int offset: (optional) The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the **count** and **offset** values together in any one query is **10000**. :param List[str] sort: (optional) A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending is the default sort direction if no prefix is specified. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='query_log') headers.update(sdk_headers) params = { 'version': self.version, 'filter': filter, 'query': query, 'count': count, 'offset': offset, 'sort': self._convert_list(sort) } url = '/v1/logs' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_metrics_query(self, *, start_time: datetime = None, end_time: datetime = None, result_type: str = None, **kwargs) -> 'DetailedResponse': """ Number of queries over time. Total number of queries using the **natural_language_query** parameter over a specific time window. :param datetime start_time: (optional) Metric is computed from data recorded after this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param datetime end_time: (optional) Metric is computed from data recorded before this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param str result_type: (optional) The type of result to consider when calculating the metric. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_metrics_query') headers.update(sdk_headers) params = { 'version': self.version, 'start_time': start_time, 'end_time': end_time, 'result_type': result_type } url = '/v1/metrics/number_of_queries' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_metrics_query_event(self, *, start_time: datetime = None, end_time: datetime = None, result_type: str = None, **kwargs) -> 'DetailedResponse': """ Number of queries with an event over time. Total number of queries using the **natural_language_query** parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the **Events** API. :param datetime start_time: (optional) Metric is computed from data recorded after this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param datetime end_time: (optional) Metric is computed from data recorded before this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param str result_type: (optional) The type of result to consider when calculating the metric. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_metrics_query_event') headers.update(sdk_headers) params = { 'version': self.version, 'start_time': start_time, 'end_time': end_time, 'result_type': result_type } url = '/v1/metrics/number_of_queries_with_event' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_metrics_query_no_results(self, *, start_time: datetime = None, end_time: datetime = None, result_type: str = None, **kwargs) -> 'DetailedResponse': """ Number of queries with no search results over time. Total number of queries using the **natural_language_query** parameter that have no results returned over a specified time window. :param datetime start_time: (optional) Metric is computed from data recorded after this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param datetime end_time: (optional) Metric is computed from data recorded before this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param str result_type: (optional) The type of result to consider when calculating the metric. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_metrics_query_no_results') headers.update(sdk_headers) params = { 'version': self.version, 'start_time': start_time, 'end_time': end_time, 'result_type': result_type } url = '/v1/metrics/number_of_queries_with_no_search_results' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_metrics_event_rate(self, *, start_time: datetime = None, end_time: datetime = None, result_type: str = None, **kwargs) -> 'DetailedResponse': """ Percentage of queries with an associated event. The percentage of queries using the **natural_language_query** parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the **Events** API. :param datetime start_time: (optional) Metric is computed from data recorded after this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param datetime end_time: (optional) Metric is computed from data recorded before this timestamp; must be in `YYYY-MM-DDThh:mm:ssZ` format. :param str result_type: (optional) The type of result to consider when calculating the metric. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_metrics_event_rate') headers.update(sdk_headers) params = { 'version': self.version, 'start_time': start_time, 'end_time': end_time, 'result_type': result_type } url = '/v1/metrics/event_rate' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def get_metrics_query_token_event(self, *, count: int = None, **kwargs) -> 'DetailedResponse': """ Most frequent query tokens with an event. The most frequent query tokens parsed from the **natural_language_query** parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string. :param int count: (optional) Number of results to return. The maximum for the **count** and **offset** values together in any one query is **10000**. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_metrics_query_token_event') headers.update(sdk_headers) params = {'version': self.version, 'count': count} url = '/v1/metrics/top_query_tokens_with_event_rate' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # Credentials ######################### def list_credentials(self, environment_id: str, **kwargs) -> 'DetailedResponse': """ List credentials. List all the source credentials that have been created for this service instance. **Note:** All credentials are sent over an encrypted connection and encrypted at rest. :param str environment_id: The ID of the environment. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_credentials') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/credentials'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def create_credentials(self, environment_id: str, *, source_type: str = None, credential_details: 'CredentialDetails' = None, status: str = None, **kwargs) -> 'DetailedResponse': """ Create credentials. Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source. **Note:** All credentials are sent over an encrypted connection and encrypted at rest. :param str environment_id: The ID of the environment. :param str source_type: (optional) The source that this credentials object connects to. - `box` indicates the credentials are used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. :param CredentialDetails credential_details: (optional) Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source. :param str status: (optional) The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if credential_details is not None: credential_details = self._convert_model(credential_details) headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_credentials') headers.update(sdk_headers) params = {'version': self.version} data = { 'source_type': source_type, 'credential_details': credential_details, 'status': status } url = '/v1/environments/{0}/credentials'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def get_credentials(self, environment_id: str, credential_id: str, **kwargs) -> 'DetailedResponse': """ View Credentials. Returns details about the specified credentials. **Note:** Secure credential information such as a password or SSH key is never returned and must be obtained from the source system. :param str environment_id: The ID of the environment. :param str credential_id: The unique identifier for a set of source credentials. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if credential_id is None: raise ValueError('credential_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_credentials') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/credentials/{1}'.format( *self._encode_path_vars(environment_id, credential_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def update_credentials(self, environment_id: str, credential_id: str, *, source_type: str = None, credential_details: 'CredentialDetails' = None, status: str = None, **kwargs) -> 'DetailedResponse': """ Update credentials. Updates an existing set of source credentials. **Note:** All credentials are sent over an encrypted connection and encrypted at rest. :param str environment_id: The ID of the environment. :param str credential_id: The unique identifier for a set of source credentials. :param str source_type: (optional) The source that this credentials object connects to. - `box` indicates the credentials are used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. :param CredentialDetails credential_details: (optional) Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source. :param str status: (optional) The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if credential_id is None: raise ValueError('credential_id must be provided') if credential_details is not None: credential_details = self._convert_model(credential_details) headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_credentials') headers.update(sdk_headers) params = {'version': self.version} data = { 'source_type': source_type, 'credential_details': credential_details, 'status': status } url = '/v1/environments/{0}/credentials/{1}'.format( *self._encode_path_vars(environment_id, credential_id)) request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def delete_credentials(self, environment_id: str, credential_id: str, **kwargs) -> 'DetailedResponse': """ Delete credentials. Deletes a set of stored credentials from your Discovery instance. :param str environment_id: The ID of the environment. :param str credential_id: The unique identifier for a set of source credentials. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if credential_id is None: raise ValueError('credential_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_credentials') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/credentials/{1}'.format( *self._encode_path_vars(environment_id, credential_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response ######################### # gatewayConfiguration ######################### def list_gateways(self, environment_id: str, **kwargs) -> 'DetailedResponse': """ List Gateways. List the currently configured gateways. :param str environment_id: The ID of the environment. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_gateways') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/gateways'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def create_gateway(self, environment_id: str, *, name: str = None, **kwargs) -> 'DetailedResponse': """ Create Gateway. Create a gateway configuration to use with a remotely installed gateway. :param str environment_id: The ID of the environment. :param str name: (optional) User-defined name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_gateway') headers.update(sdk_headers) params = {'version': self.version} data = {'name': name} url = '/v1/environments/{0}/gateways'.format( *self._encode_path_vars(environment_id)) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request) return response def get_gateway(self, environment_id: str, gateway_id: str, **kwargs) -> 'DetailedResponse': """ List Gateway Details. List information about the specified gateway. :param str environment_id: The ID of the environment. :param str gateway_id: The requested gateway ID. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if gateway_id is None: raise ValueError('gateway_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_gateway') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/gateways/{1}'.format( *self._encode_path_vars(environment_id, gateway_id)) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request) return response def delete_gateway(self, environment_id: str, gateway_id: str, **kwargs) -> 'DetailedResponse': """ Delete Gateway. Delete the specified gateway configuration. :param str environment_id: The ID of the environment. :param str gateway_id: The requested gateway ID. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if environment_id is None: raise ValueError('environment_id must be provided') if gateway_id is None: raise ValueError('gateway_id must be provided') headers = {} if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_gateway') headers.update(sdk_headers) params = {'version': self.version} url = '/v1/environments/{0}/gateways/{1}'.format( *self._encode_path_vars(environment_id, gateway_id)) request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request) return response class AddDocumentEnums(object): class FileContentType(Enum): """ The content type of file. """ APPLICATION_JSON = 'application/json' APPLICATION_MSWORD = 'application/msword' APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' APPLICATION_PDF = 'application/pdf' TEXT_HTML = 'text/html' APPLICATION_XHTML_XML = 'application/xhtml+xml' class UpdateDocumentEnums(object): class FileContentType(Enum): """ The content type of file. """ APPLICATION_JSON = 'application/json' APPLICATION_MSWORD = 'application/msword' APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' APPLICATION_PDF = 'application/pdf' TEXT_HTML = 'text/html' APPLICATION_XHTML_XML = 'application/xhtml+xml' class GetMetricsQueryEnums(object): class ResultType(Enum): """ The type of result to consider when calculating the metric. """ DOCUMENT = 'document' class GetMetricsQueryEventEnums(object): class ResultType(Enum): """ The type of result to consider when calculating the metric. """ DOCUMENT = 'document' class GetMetricsQueryNoResultsEnums(object): class ResultType(Enum): """ The type of result to consider when calculating the metric. """ DOCUMENT = 'document' class GetMetricsEventRateEnums(object): class ResultType(Enum): """ The type of result to consider when calculating the metric. """ DOCUMENT = 'document' ############################################################################## # Models ############################################################################## class AggregationResult(): """ Aggregation results for the specified query. :attr str key: (optional) Key that matched the aggregation type. :attr int matching_results: (optional) Number of matching results. :attr List[QueryAggregation] aggregations: (optional) Aggregations returned in the case of chained aggregations. """ def __init__(self, *, key: str = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None) -> None: """ Initialize a AggregationResult object. :param str key: (optional) Key that matched the aggregation type. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned in the case of chained aggregations. """ self.key = key self.matching_results = matching_results self.aggregations = aggregations @classmethod def from_dict(cls, _dict: Dict) -> 'AggregationResult': """Initialize a AggregationResult object from a json dictionary.""" args = {} valid_keys = ['key', 'matching_results', 'aggregations'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class AggregationResult: ' + ', '.join(bad_keys)) if 'key' in _dict: args['key'] = _dict.get('key') if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a AggregationResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this AggregationResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'AggregationResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'AggregationResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Collection(): """ A collection for storing documents. :attr str collection_id: (optional) The unique identifier of the collection. :attr str name: (optional) The name of the collection. :attr str description: (optional) The description of the collection. :attr datetime created: (optional) The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'. :attr datetime updated: (optional) The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :attr str status: (optional) The status of the collection. :attr str configuration_id: (optional) The unique identifier of the collection's configuration. :attr str language: (optional) The language of the documents stored in the collection. Permitted values include `en` (English), `de` (German), and `es` (Spanish). :attr DocumentCounts document_counts: (optional) Object containing collection document count information. :attr CollectionDiskUsage disk_usage: (optional) Summary of the disk usage statistics for this collection. :attr TrainingStatus training_status: (optional) Training status details. :attr CollectionCrawlStatus crawl_status: (optional) Object containing information about the crawl status of this collection. :attr SduStatus smart_document_understanding: (optional) Object containing smart document understanding information for this collection. """ def __init__(self, *, collection_id: str = None, name: str = None, description: str = None, created: datetime = None, updated: datetime = None, status: str = None, configuration_id: str = None, language: str = None, document_counts: 'DocumentCounts' = None, disk_usage: 'CollectionDiskUsage' = None, training_status: 'TrainingStatus' = None, crawl_status: 'CollectionCrawlStatus' = None, smart_document_understanding: 'SduStatus' = None) -> None: """ Initialize a Collection object. :param str collection_id: (optional) The unique identifier of the collection. :param str name: (optional) The name of the collection. :param str description: (optional) The description of the collection. :param datetime created: (optional) The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'. :param datetime updated: (optional) The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :param str status: (optional) The status of the collection. :param str configuration_id: (optional) The unique identifier of the collection's configuration. :param str language: (optional) The language of the documents stored in the collection. Permitted values include `en` (English), `de` (German), and `es` (Spanish). :param DocumentCounts document_counts: (optional) Object containing collection document count information. :param CollectionDiskUsage disk_usage: (optional) Summary of the disk usage statistics for this collection. :param TrainingStatus training_status: (optional) Training status details. :param CollectionCrawlStatus crawl_status: (optional) Object containing information about the crawl status of this collection. :param SduStatus smart_document_understanding: (optional) Object containing smart document understanding information for this collection. """ self.collection_id = collection_id self.name = name self.description = description self.created = created self.updated = updated self.status = status self.configuration_id = configuration_id self.language = language self.document_counts = document_counts self.disk_usage = disk_usage self.training_status = training_status self.crawl_status = crawl_status self.smart_document_understanding = smart_document_understanding @classmethod def from_dict(cls, _dict: Dict) -> 'Collection': """Initialize a Collection object from a json dictionary.""" args = {} valid_keys = [ 'collection_id', 'name', 'description', 'created', 'updated', 'status', 'configuration_id', 'language', 'document_counts', 'disk_usage', 'training_status', 'crawl_status', 'smart_document_understanding' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Collection: ' + ', '.join(bad_keys)) if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') if 'name' in _dict: args['name'] = _dict.get('name') if 'description' in _dict: args['description'] = _dict.get('description') if 'created' in _dict: args['created'] = string_to_datetime(_dict.get('created')) if 'updated' in _dict: args['updated'] = string_to_datetime(_dict.get('updated')) if 'status' in _dict: args['status'] = _dict.get('status') if 'configuration_id' in _dict: args['configuration_id'] = _dict.get('configuration_id') if 'language' in _dict: args['language'] = _dict.get('language') if 'document_counts' in _dict: args['document_counts'] = DocumentCounts._from_dict( _dict.get('document_counts')) if 'disk_usage' in _dict: args['disk_usage'] = CollectionDiskUsage._from_dict( _dict.get('disk_usage')) if 'training_status' in _dict: args['training_status'] = TrainingStatus._from_dict( _dict.get('training_status')) if 'crawl_status' in _dict: args['crawl_status'] = CollectionCrawlStatus._from_dict( _dict.get('crawl_status')) if 'smart_document_understanding' in _dict: args['smart_document_understanding'] = SduStatus._from_dict( _dict.get('smart_document_understanding')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Collection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description if hasattr(self, 'created') and self.created is not None: _dict['created'] = datetime_to_string(self.created) if hasattr(self, 'updated') and self.updated is not None: _dict['updated'] = datetime_to_string(self.updated) if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'configuration_id') and self.configuration_id is not None: _dict['configuration_id'] = self.configuration_id if hasattr(self, 'language') and self.language is not None: _dict['language'] = self.language if hasattr(self, 'document_counts') and self.document_counts is not None: _dict['document_counts'] = self.document_counts._to_dict() if hasattr(self, 'disk_usage') and self.disk_usage is not None: _dict['disk_usage'] = self.disk_usage._to_dict() if hasattr(self, 'training_status') and self.training_status is not None: _dict['training_status'] = self.training_status._to_dict() if hasattr(self, 'crawl_status') and self.crawl_status is not None: _dict['crawl_status'] = self.crawl_status._to_dict() if hasattr(self, 'smart_document_understanding' ) and self.smart_document_understanding is not None: _dict[ 'smart_document_understanding'] = self.smart_document_understanding._to_dict( ) return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Collection object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Collection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Collection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ The status of the collection. """ ACTIVE = "active" PENDING = "pending" MAINTENANCE = "maintenance" class CollectionCrawlStatus(): """ Object containing information about the crawl status of this collection. :attr SourceStatus source_crawl: (optional) Object containing source crawl status information. """ def __init__(self, *, source_crawl: 'SourceStatus' = None) -> None: """ Initialize a CollectionCrawlStatus object. :param SourceStatus source_crawl: (optional) Object containing source crawl status information. """ self.source_crawl = source_crawl @classmethod def from_dict(cls, _dict: Dict) -> 'CollectionCrawlStatus': """Initialize a CollectionCrawlStatus object from a json dictionary.""" args = {} valid_keys = ['source_crawl'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class CollectionCrawlStatus: ' + ', '.join(bad_keys)) if 'source_crawl' in _dict: args['source_crawl'] = SourceStatus._from_dict( _dict.get('source_crawl')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a CollectionCrawlStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'source_crawl') and self.source_crawl is not None: _dict['source_crawl'] = self.source_crawl._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this CollectionCrawlStatus object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'CollectionCrawlStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'CollectionCrawlStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CollectionDiskUsage(): """ Summary of the disk usage statistics for this collection. :attr int used_bytes: (optional) Number of bytes used by the collection. """ def __init__(self, *, used_bytes: int = None) -> None: """ Initialize a CollectionDiskUsage object. :param int used_bytes: (optional) Number of bytes used by the collection. """ self.used_bytes = used_bytes @classmethod def from_dict(cls, _dict: Dict) -> 'CollectionDiskUsage': """Initialize a CollectionDiskUsage object from a json dictionary.""" args = {} valid_keys = ['used_bytes'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class CollectionDiskUsage: ' + ', '.join(bad_keys)) if 'used_bytes' in _dict: args['used_bytes'] = _dict.get('used_bytes') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a CollectionDiskUsage object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'used_bytes') and self.used_bytes is not None: _dict['used_bytes'] = self.used_bytes return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this CollectionDiskUsage object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'CollectionDiskUsage') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'CollectionDiskUsage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CollectionUsage(): """ Summary of the collection usage in the environment. :attr int available: (optional) Number of active collections in the environment. :attr int maximum_allowed: (optional) Total number of collections allowed in the environment. """ def __init__(self, *, available: int = None, maximum_allowed: int = None) -> None: """ Initialize a CollectionUsage object. :param int available: (optional) Number of active collections in the environment. :param int maximum_allowed: (optional) Total number of collections allowed in the environment. """ self.available = available self.maximum_allowed = maximum_allowed @classmethod def from_dict(cls, _dict: Dict) -> 'CollectionUsage': """Initialize a CollectionUsage object from a json dictionary.""" args = {} valid_keys = ['available', 'maximum_allowed'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class CollectionUsage: ' + ', '.join(bad_keys)) if 'available' in _dict: args['available'] = _dict.get('available') if 'maximum_allowed' in _dict: args['maximum_allowed'] = _dict.get('maximum_allowed') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a CollectionUsage object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'available') and self.available is not None: _dict['available'] = self.available if hasattr(self, 'maximum_allowed') and self.maximum_allowed is not None: _dict['maximum_allowed'] = self.maximum_allowed return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this CollectionUsage object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'CollectionUsage') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'CollectionUsage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Completions(): """ An object containing an array of autocompletion suggestions. :attr List[str] completions: (optional) Array of autcomplete suggestion based on the provided prefix. """ def __init__(self, *, completions: List[str] = None) -> None: """ Initialize a Completions object. :param List[str] completions: (optional) Array of autcomplete suggestion based on the provided prefix. """ self.completions = completions @classmethod def from_dict(cls, _dict: Dict) -> 'Completions': """Initialize a Completions object from a json dictionary.""" args = {} valid_keys = ['completions'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Completions: ' + ', '.join(bad_keys)) if 'completions' in _dict: args['completions'] = _dict.get('completions') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Completions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'completions') and self.completions is not None: _dict['completions'] = self.completions return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Completions object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Completions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Completions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Configuration(): """ A custom configuration for the environment. :attr str configuration_id: (optional) The unique identifier of the configuration. :attr str name: The name of the configuration. :attr datetime created: (optional) The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :attr datetime updated: (optional) The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :attr str description: (optional) The description of the configuration, if available. :attr Conversions conversions: (optional) Document conversion settings. :attr List[Enrichment] enrichments: (optional) An array of document enrichment settings for the configuration. :attr List[NormalizationOperation] normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :attr Source source: (optional) Object containing source parameters for the configuration. """ def __init__(self, name: str, *, configuration_id: str = None, created: datetime = None, updated: datetime = None, description: str = None, conversions: 'Conversions' = None, enrichments: List['Enrichment'] = None, normalizations: List['NormalizationOperation'] = None, source: 'Source' = None) -> None: """ Initialize a Configuration object. :param str name: The name of the configuration. :param str configuration_id: (optional) The unique identifier of the configuration. :param datetime created: (optional) The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :param datetime updated: (optional) The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :param str description: (optional) The description of the configuration, if available. :param Conversions conversions: (optional) Document conversion settings. :param List[Enrichment] enrichments: (optional) An array of document enrichment settings for the configuration. :param List[NormalizationOperation] normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :param Source source: (optional) Object containing source parameters for the configuration. """ self.configuration_id = configuration_id self.name = name self.created = created self.updated = updated self.description = description self.conversions = conversions self.enrichments = enrichments self.normalizations = normalizations self.source = source @classmethod def from_dict(cls, _dict: Dict) -> 'Configuration': """Initialize a Configuration object from a json dictionary.""" args = {} valid_keys = [ 'configuration_id', 'name', 'created', 'updated', 'description', 'conversions', 'enrichments', 'normalizations', 'source' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Configuration: ' + ', '.join(bad_keys)) if 'configuration_id' in _dict: args['configuration_id'] = _dict.get('configuration_id') if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( 'Required property \'name\' not present in Configuration JSON') if 'created' in _dict: args['created'] = string_to_datetime(_dict.get('created')) if 'updated' in _dict: args['updated'] = string_to_datetime(_dict.get('updated')) if 'description' in _dict: args['description'] = _dict.get('description') if 'conversions' in _dict: args['conversions'] = Conversions._from_dict( _dict.get('conversions')) if 'enrichments' in _dict: args['enrichments'] = [ Enrichment._from_dict(x) for x in (_dict.get('enrichments')) ] if 'normalizations' in _dict: args['normalizations'] = [ NormalizationOperation._from_dict(x) for x in (_dict.get('normalizations')) ] if 'source' in _dict: args['source'] = Source._from_dict(_dict.get('source')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Configuration object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'configuration_id') and self.configuration_id is not None: _dict['configuration_id'] = self.configuration_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'created') and self.created is not None: _dict['created'] = datetime_to_string(self.created) if hasattr(self, 'updated') and self.updated is not None: _dict['updated'] = datetime_to_string(self.updated) if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description if hasattr(self, 'conversions') and self.conversions is not None: _dict['conversions'] = self.conversions._to_dict() if hasattr(self, 'enrichments') and self.enrichments is not None: _dict['enrichments'] = [x._to_dict() for x in self.enrichments] if hasattr(self, 'normalizations') and self.normalizations is not None: _dict['normalizations'] = [ x._to_dict() for x in self.normalizations ] if hasattr(self, 'source') and self.source is not None: _dict['source'] = self.source._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Configuration object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Configuration') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Configuration') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Conversions(): """ Document conversion settings. :attr PdfSettings pdf: (optional) A list of PDF conversion settings. :attr WordSettings word: (optional) A list of Word conversion settings. :attr HtmlSettings html: (optional) A list of HTML conversion settings. :attr SegmentSettings segment: (optional) A list of Document Segmentation settings. :attr List[NormalizationOperation] json_normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :attr bool image_text_recognition: (optional) When `true`, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on **Advanced** and higher plans only. **Lite** plans do not support image text recognition. """ def __init__(self, *, pdf: 'PdfSettings' = None, word: 'WordSettings' = None, html: 'HtmlSettings' = None, segment: 'SegmentSettings' = None, json_normalizations: List['NormalizationOperation'] = None, image_text_recognition: bool = None) -> None: """ Initialize a Conversions object. :param PdfSettings pdf: (optional) A list of PDF conversion settings. :param WordSettings word: (optional) A list of Word conversion settings. :param HtmlSettings html: (optional) A list of HTML conversion settings. :param SegmentSettings segment: (optional) A list of Document Segmentation settings. :param List[NormalizationOperation] json_normalizations: (optional) Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array. :param bool image_text_recognition: (optional) When `true`, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on **Advanced** and higher plans only. **Lite** plans do not support image text recognition. """ self.pdf = pdf self.word = word self.html = html self.segment = segment self.json_normalizations = json_normalizations self.image_text_recognition = image_text_recognition @classmethod def from_dict(cls, _dict: Dict) -> 'Conversions': """Initialize a Conversions object from a json dictionary.""" args = {} valid_keys = [ 'pdf', 'word', 'html', 'segment', 'json_normalizations', 'image_text_recognition' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Conversions: ' + ', '.join(bad_keys)) if 'pdf' in _dict: args['pdf'] = PdfSettings._from_dict(_dict.get('pdf')) if 'word' in _dict: args['word'] = WordSettings._from_dict(_dict.get('word')) if 'html' in _dict: args['html'] = HtmlSettings._from_dict(_dict.get('html')) if 'segment' in _dict: args['segment'] = SegmentSettings._from_dict(_dict.get('segment')) if 'json_normalizations' in _dict: args['json_normalizations'] = [ NormalizationOperation._from_dict(x) for x in (_dict.get('json_normalizations')) ] if 'image_text_recognition' in _dict: args['image_text_recognition'] = _dict.get('image_text_recognition') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Conversions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'pdf') and self.pdf is not None: _dict['pdf'] = self.pdf._to_dict() if hasattr(self, 'word') and self.word is not None: _dict['word'] = self.word._to_dict() if hasattr(self, 'html') and self.html is not None: _dict['html'] = self.html._to_dict() if hasattr(self, 'segment') and self.segment is not None: _dict['segment'] = self.segment._to_dict() if hasattr( self, 'json_normalizations') and self.json_normalizations is not None: _dict['json_normalizations'] = [ x._to_dict() for x in self.json_normalizations ] if hasattr(self, 'image_text_recognition' ) and self.image_text_recognition is not None: _dict['image_text_recognition'] = self.image_text_recognition return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Conversions object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Conversions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Conversions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CreateEventResponse(): """ An object defining the event being created. :attr str type: (optional) The event type that was created. :attr EventData data: (optional) Query event data object. """ def __init__(self, *, type: str = None, data: 'EventData' = None) -> None: """ Initialize a CreateEventResponse object. :param str type: (optional) The event type that was created. :param EventData data: (optional) Query event data object. """ self.type = type self.data = data @classmethod def from_dict(cls, _dict: Dict) -> 'CreateEventResponse': """Initialize a CreateEventResponse object from a json dictionary.""" args = {} valid_keys = ['type', 'data'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class CreateEventResponse: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'data' in _dict: args['data'] = EventData._from_dict(_dict.get('data')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a CreateEventResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'data') and self.data is not None: _dict['data'] = self.data._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this CreateEventResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'CreateEventResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'CreateEventResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TypeEnum(Enum): """ The event type that was created. """ CLICK = "click" class CredentialDetails(): """ Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source. :attr str credential_type: (optional) The authentication method for this credentials definition. The **credential_type** specified must be supported by the **source_type**. The following combinations are possible: - `"source_type": "box"` - valid `credential_type`s: `oauth2` - `"source_type": "salesforce"` - valid `credential_type`s: `username_password` - `"source_type": "sharepoint"` - valid `credential_type`s: `saml` with **source_version** of `online`, or `ntlm_v1` with **source_version** of `2016` - `"source_type": "web_crawl"` - valid `credential_type`s: `noauth` or `basic` - "source_type": "cloud_object_storage"` - valid `credential_type`s: `aws4_hmac`. :attr str client_id: (optional) The **client_id** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. :attr str enterprise_id: (optional) The **enterprise_id** of the Box site that these credentials connect to. Only valid, and required, with a **source_type** of `box`. :attr str url: (optional) The **url** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `username_password`, `noauth`, and `basic`. :attr str username: (optional) The **username** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `saml`, `username_password`, `basic`, or `ntlm_v1`. :attr str organization_url: (optional) The **organization_url** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `saml`. :attr str site_collection_path: (optional) The **site_collection.path** of the source that these credentials connect to. Only valid, and required, with a **source_type** of `sharepoint`. :attr str client_secret: (optional) The **client_secret** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :attr str public_key_id: (optional) The **public_key_id** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :attr str private_key: (optional) The **private_key** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :attr str passphrase: (optional) The **passphrase** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :attr str password: (optional) The **password** of the source that these credentials connect to. Only valid, and required, with **credential_type**s of `saml`, `username_password`, `basic`, or `ntlm_v1`. **Note:** When used with a **source_type** of `salesforce`, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying **credentials**. :attr str gateway_id: (optional) The ID of the **gateway** to be connected through (when connecting to intranet sites). Only valid with a **credential_type** of `noauth`, `basic`, or `ntlm_v1`. Gateways are created using the `/v1/environments/{environment_id}/gateways` methods. :attr str source_version: (optional) The type of Sharepoint repository to connect to. Only valid, and required, with a **source_type** of `sharepoint`. :attr str web_application_url: (optional) SharePoint OnPrem WebApplication URL. Only valid, and required, with a **source_version** of `2016`. If a port is not supplied, the default to port `80` for http and port `443` for https connections are used. :attr str domain: (optional) The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a **source_version** of `2016`. :attr str endpoint: (optional) The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a **credential_type** of `aws4_hmac`. :attr str access_key_id: (optional) The access key ID associated with the cloud object store. Only valid, and required, with a **credential_type** of `aws4_hmac`. This value is never returned and is only used when creating or modifying **credentials**. For more infomation, see the [cloud object store documentation](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-using-hmac-credentials#using-hmac-credentials). :attr str secret_access_key: (optional) The secret access key associated with the cloud object store. Only valid, and required, with a **credential_type** of `aws4_hmac`. This value is never returned and is only used when creating or modifying **credentials**. For more infomation, see the [cloud object store documentation](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-using-hmac-credentials#using-hmac-credentials). """ def __init__(self, *, credential_type: str = None, client_id: str = None, enterprise_id: str = None, url: str = None, username: str = None, organization_url: str = None, site_collection_path: str = None, client_secret: str = None, public_key_id: str = None, private_key: str = None, passphrase: str = None, password: str = None, gateway_id: str = None, source_version: str = None, web_application_url: str = None, domain: str = None, endpoint: str = None, access_key_id: str = None, secret_access_key: str = None) -> None: """ Initialize a CredentialDetails object. :param str credential_type: (optional) The authentication method for this credentials definition. The **credential_type** specified must be supported by the **source_type**. The following combinations are possible: - `"source_type": "box"` - valid `credential_type`s: `oauth2` - `"source_type": "salesforce"` - valid `credential_type`s: `username_password` - `"source_type": "sharepoint"` - valid `credential_type`s: `saml` with **source_version** of `online`, or `ntlm_v1` with **source_version** of `2016` - `"source_type": "web_crawl"` - valid `credential_type`s: `noauth` or `basic` - "source_type": "cloud_object_storage"` - valid `credential_type`s: `aws4_hmac`. :param str client_id: (optional) The **client_id** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. :param str enterprise_id: (optional) The **enterprise_id** of the Box site that these credentials connect to. Only valid, and required, with a **source_type** of `box`. :param str url: (optional) The **url** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `username_password`, `noauth`, and `basic`. :param str username: (optional) The **username** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `saml`, `username_password`, `basic`, or `ntlm_v1`. :param str organization_url: (optional) The **organization_url** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `saml`. :param str site_collection_path: (optional) The **site_collection.path** of the source that these credentials connect to. Only valid, and required, with a **source_type** of `sharepoint`. :param str client_secret: (optional) The **client_secret** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :param str public_key_id: (optional) The **public_key_id** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :param str private_key: (optional) The **private_key** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :param str passphrase: (optional) The **passphrase** of the source that these credentials connect to. Only valid, and required, with a **credential_type** of `oauth2`. This value is never returned and is only used when creating or modifying **credentials**. :param str password: (optional) The **password** of the source that these credentials connect to. Only valid, and required, with **credential_type**s of `saml`, `username_password`, `basic`, or `ntlm_v1`. **Note:** When used with a **source_type** of `salesforce`, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying **credentials**. :param str gateway_id: (optional) The ID of the **gateway** to be connected through (when connecting to intranet sites). Only valid with a **credential_type** of `noauth`, `basic`, or `ntlm_v1`. Gateways are created using the `/v1/environments/{environment_id}/gateways` methods. :param str source_version: (optional) The type of Sharepoint repository to connect to. Only valid, and required, with a **source_type** of `sharepoint`. :param str web_application_url: (optional) SharePoint OnPrem WebApplication URL. Only valid, and required, with a **source_version** of `2016`. If a port is not supplied, the default to port `80` for http and port `443` for https connections are used. :param str domain: (optional) The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a **source_version** of `2016`. :param str endpoint: (optional) The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a **credential_type** of `aws4_hmac`. :param str access_key_id: (optional) The access key ID associated with the cloud object store. Only valid, and required, with a **credential_type** of `aws4_hmac`. This value is never returned and is only used when creating or modifying **credentials**. For more infomation, see the [cloud object store documentation](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-using-hmac-credentials#using-hmac-credentials). :param str secret_access_key: (optional) The secret access key associated with the cloud object store. Only valid, and required, with a **credential_type** of `aws4_hmac`. This value is never returned and is only used when creating or modifying **credentials**. For more infomation, see the [cloud object store documentation](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-using-hmac-credentials#using-hmac-credentials). """ self.credential_type = credential_type self.client_id = client_id self.enterprise_id = enterprise_id self.url = url self.username = username self.organization_url = organization_url self.site_collection_path = site_collection_path self.client_secret = client_secret self.public_key_id = public_key_id self.private_key = private_key self.passphrase = passphrase self.password = password self.gateway_id = gateway_id self.source_version = source_version self.web_application_url = web_application_url self.domain = domain self.endpoint = endpoint self.access_key_id = access_key_id self.secret_access_key = secret_access_key @classmethod def from_dict(cls, _dict: Dict) -> 'CredentialDetails': """Initialize a CredentialDetails object from a json dictionary.""" args = {} valid_keys = [ 'credential_type', 'client_id', 'enterprise_id', 'url', 'username', 'organization_url', 'site_collection_path', 'site_collection.path', 'client_secret', 'public_key_id', 'private_key', 'passphrase', 'password', 'gateway_id', 'source_version', 'web_application_url', 'domain', 'endpoint', 'access_key_id', 'secret_access_key' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class CredentialDetails: ' + ', '.join(bad_keys)) if 'credential_type' in _dict: args['credential_type'] = _dict.get('credential_type') if 'client_id' in _dict: args['client_id'] = _dict.get('client_id') if 'enterprise_id' in _dict: args['enterprise_id'] = _dict.get('enterprise_id') if 'url' in _dict: args['url'] = _dict.get('url') if 'username' in _dict: args['username'] = _dict.get('username') if 'organization_url' in _dict: args['organization_url'] = _dict.get('organization_url') if 'site_collection.path' in _dict: args['site_collection_path'] = _dict.get('site_collection.path') if 'client_secret' in _dict: args['client_secret'] = _dict.get('client_secret') if 'public_key_id' in _dict: args['public_key_id'] = _dict.get('public_key_id') if 'private_key' in _dict: args['private_key'] = _dict.get('private_key') if 'passphrase' in _dict: args['passphrase'] = _dict.get('passphrase') if 'password' in _dict: args['password'] = _dict.get('password') if 'gateway_id' in _dict: args['gateway_id'] = _dict.get('gateway_id') if 'source_version' in _dict: args['source_version'] = _dict.get('source_version') if 'web_application_url' in _dict: args['web_application_url'] = _dict.get('web_application_url') if 'domain' in _dict: args['domain'] = _dict.get('domain') if 'endpoint' in _dict: args['endpoint'] = _dict.get('endpoint') if 'access_key_id' in _dict: args['access_key_id'] = _dict.get('access_key_id') if 'secret_access_key' in _dict: args['secret_access_key'] = _dict.get('secret_access_key') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a CredentialDetails object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'credential_type') and self.credential_type is not None: _dict['credential_type'] = self.credential_type if hasattr(self, 'client_id') and self.client_id is not None: _dict['client_id'] = self.client_id if hasattr(self, 'enterprise_id') and self.enterprise_id is not None: _dict['enterprise_id'] = self.enterprise_id if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url if hasattr(self, 'username') and self.username is not None: _dict['username'] = self.username if hasattr(self, 'organization_url') and self.organization_url is not None: _dict['organization_url'] = self.organization_url if hasattr(self, 'site_collection_path' ) and self.site_collection_path is not None: _dict['site_collection.path'] = self.site_collection_path if hasattr(self, 'client_secret') and self.client_secret is not None: _dict['client_secret'] = self.client_secret if hasattr(self, 'public_key_id') and self.public_key_id is not None: _dict['public_key_id'] = self.public_key_id if hasattr(self, 'private_key') and self.private_key is not None: _dict['private_key'] = self.private_key if hasattr(self, 'passphrase') and self.passphrase is not None: _dict['passphrase'] = self.passphrase if hasattr(self, 'password') and self.password is not None: _dict['password'] = self.password if hasattr(self, 'gateway_id') and self.gateway_id is not None: _dict['gateway_id'] = self.gateway_id if hasattr(self, 'source_version') and self.source_version is not None: _dict['source_version'] = self.source_version if hasattr( self, 'web_application_url') and self.web_application_url is not None: _dict['web_application_url'] = self.web_application_url if hasattr(self, 'domain') and self.domain is not None: _dict['domain'] = self.domain if hasattr(self, 'endpoint') and self.endpoint is not None: _dict['endpoint'] = self.endpoint if hasattr(self, 'access_key_id') and self.access_key_id is not None: _dict['access_key_id'] = self.access_key_id if hasattr(self, 'secret_access_key') and self.secret_access_key is not None: _dict['secret_access_key'] = self.secret_access_key return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this CredentialDetails object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'CredentialDetails') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'CredentialDetails') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CredentialTypeEnum(Enum): """ The authentication method for this credentials definition. The **credential_type** specified must be supported by the **source_type**. The following combinations are possible: - `"source_type": "box"` - valid `credential_type`s: `oauth2` - `"source_type": "salesforce"` - valid `credential_type`s: `username_password` - `"source_type": "sharepoint"` - valid `credential_type`s: `saml` with **source_version** of `online`, or `ntlm_v1` with **source_version** of `2016` - `"source_type": "web_crawl"` - valid `credential_type`s: `noauth` or `basic` - "source_type": "cloud_object_storage"` - valid `credential_type`s: `aws4_hmac`. """ OAUTH2 = "oauth2" SAML = "saml" USERNAME_PASSWORD = "username_password" NOAUTH = "noauth" BASIC = "basic" NTLM_V1 = "ntlm_v1" AWS4_HMAC = "aws4_hmac" class SourceVersionEnum(Enum): """ The type of Sharepoint repository to connect to. Only valid, and required, with a **source_type** of `sharepoint`. """ ONLINE = "online" class Credentials(): """ Object containing credential information. :attr str credential_id: (optional) Unique identifier for this set of credentials. :attr str source_type: (optional) The source that this credentials object connects to. - `box` indicates the credentials are used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. :attr CredentialDetails credential_details: (optional) Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source. :attr str status: (optional) The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. """ def __init__(self, *, credential_id: str = None, source_type: str = None, credential_details: 'CredentialDetails' = None, status: str = None) -> None: """ Initialize a Credentials object. :param str credential_id: (optional) Unique identifier for this set of credentials. :param str source_type: (optional) The source that this credentials object connects to. - `box` indicates the credentials are used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. :param CredentialDetails credential_details: (optional) Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source. :param str status: (optional) The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. """ self.credential_id = credential_id self.source_type = source_type self.credential_details = credential_details self.status = status @classmethod def from_dict(cls, _dict: Dict) -> 'Credentials': """Initialize a Credentials object from a json dictionary.""" args = {} valid_keys = [ 'credential_id', 'source_type', 'credential_details', 'status' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Credentials: ' + ', '.join(bad_keys)) if 'credential_id' in _dict: args['credential_id'] = _dict.get('credential_id') if 'source_type' in _dict: args['source_type'] = _dict.get('source_type') if 'credential_details' in _dict: args['credential_details'] = CredentialDetails._from_dict( _dict.get('credential_details')) if 'status' in _dict: args['status'] = _dict.get('status') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Credentials object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'credential_id') and self.credential_id is not None: _dict['credential_id'] = self.credential_id if hasattr(self, 'source_type') and self.source_type is not None: _dict['source_type'] = self.source_type if hasattr( self, 'credential_details') and self.credential_details is not None: _dict['credential_details'] = self.credential_details._to_dict() if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Credentials object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Credentials') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Credentials') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SourceTypeEnum(Enum): """ The source that this credentials object connects to. - `box` indicates the credentials are used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. """ BOX = "box" SALESFORCE = "salesforce" SHAREPOINT = "sharepoint" WEB_CRAWL = "web_crawl" CLOUD_OBJECT_STORAGE = "cloud_object_storage" class StatusEnum(Enum): """ The current status of this set of credentials. `connected` indicates that the credentials are available to use with the source configuration of a collection. `invalid` refers to the credentials (for example, the password provided has expired) and must be corrected before they can be used with a collection. """ CONNECTED = "connected" INVALID = "invalid" class CredentialsList(): """ Object containing array of credential definitions. :attr List[Credentials] credentials: (optional) An array of credential definitions that were created for this instance. """ def __init__(self, *, credentials: List['Credentials'] = None) -> None: """ Initialize a CredentialsList object. :param List[Credentials] credentials: (optional) An array of credential definitions that were created for this instance. """ self.credentials = credentials @classmethod def from_dict(cls, _dict: Dict) -> 'CredentialsList': """Initialize a CredentialsList object from a json dictionary.""" args = {} valid_keys = ['credentials'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class CredentialsList: ' + ', '.join(bad_keys)) if 'credentials' in _dict: args['credentials'] = [ Credentials._from_dict(x) for x in (_dict.get('credentials')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a CredentialsList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'credentials') and self.credentials is not None: _dict['credentials'] = [x._to_dict() for x in self.credentials] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this CredentialsList object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'CredentialsList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'CredentialsList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class DeleteCollectionResponse(): """ Response object returned when deleting a colleciton. :attr str collection_id: The unique identifier of the collection that is being deleted. :attr str status: The status of the collection. The status of a successful deletion operation is `deleted`. """ def __init__(self, collection_id: str, status: str) -> None: """ Initialize a DeleteCollectionResponse object. :param str collection_id: The unique identifier of the collection that is being deleted. :param str status: The status of the collection. The status of a successful deletion operation is `deleted`. """ self.collection_id = collection_id self.status = status @classmethod def from_dict(cls, _dict: Dict) -> 'DeleteCollectionResponse': """Initialize a DeleteCollectionResponse object from a json dictionary.""" args = {} valid_keys = ['collection_id', 'status'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DeleteCollectionResponse: ' + ', '.join(bad_keys)) if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') else: raise ValueError( 'Required property \'collection_id\' not present in DeleteCollectionResponse JSON' ) if 'status' in _dict: args['status'] = _dict.get('status') else: raise ValueError( 'Required property \'status\' not present in DeleteCollectionResponse JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DeleteCollectionResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DeleteCollectionResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DeleteCollectionResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DeleteCollectionResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ The status of the collection. The status of a successful deletion operation is `deleted`. """ DELETED = "deleted" class DeleteConfigurationResponse(): """ Information returned when a configuration is deleted. :attr str configuration_id: The unique identifier for the configuration. :attr str status: Status of the configuration. A deleted configuration has the status deleted. :attr List[Notice] notices: (optional) An array of notice messages, if any. """ def __init__(self, configuration_id: str, status: str, *, notices: List['Notice'] = None) -> None: """ Initialize a DeleteConfigurationResponse object. :param str configuration_id: The unique identifier for the configuration. :param str status: Status of the configuration. A deleted configuration has the status deleted. :param List[Notice] notices: (optional) An array of notice messages, if any. """ self.configuration_id = configuration_id self.status = status self.notices = notices @classmethod def from_dict(cls, _dict: Dict) -> 'DeleteConfigurationResponse': """Initialize a DeleteConfigurationResponse object from a json dictionary.""" args = {} valid_keys = ['configuration_id', 'status', 'notices'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DeleteConfigurationResponse: ' + ', '.join(bad_keys)) if 'configuration_id' in _dict: args['configuration_id'] = _dict.get('configuration_id') else: raise ValueError( 'Required property \'configuration_id\' not present in DeleteConfigurationResponse JSON' ) if 'status' in _dict: args['status'] = _dict.get('status') else: raise ValueError( 'Required property \'status\' not present in DeleteConfigurationResponse JSON' ) if 'notices' in _dict: args['notices'] = [ Notice._from_dict(x) for x in (_dict.get('notices')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DeleteConfigurationResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'configuration_id') and self.configuration_id is not None: _dict['configuration_id'] = self.configuration_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'notices') and self.notices is not None: _dict['notices'] = [x._to_dict() for x in self.notices] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DeleteConfigurationResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DeleteConfigurationResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DeleteConfigurationResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Status of the configuration. A deleted configuration has the status deleted. """ DELETED = "deleted" class DeleteCredentials(): """ Object returned after credentials are deleted. :attr str credential_id: (optional) The unique identifier of the credentials that have been deleted. :attr str status: (optional) The status of the deletion request. """ def __init__(self, *, credential_id: str = None, status: str = None) -> None: """ Initialize a DeleteCredentials object. :param str credential_id: (optional) The unique identifier of the credentials that have been deleted. :param str status: (optional) The status of the deletion request. """ self.credential_id = credential_id self.status = status @classmethod def from_dict(cls, _dict: Dict) -> 'DeleteCredentials': """Initialize a DeleteCredentials object from a json dictionary.""" args = {} valid_keys = ['credential_id', 'status'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DeleteCredentials: ' + ', '.join(bad_keys)) if 'credential_id' in _dict: args['credential_id'] = _dict.get('credential_id') if 'status' in _dict: args['status'] = _dict.get('status') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DeleteCredentials object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'credential_id') and self.credential_id is not None: _dict['credential_id'] = self.credential_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DeleteCredentials object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DeleteCredentials') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DeleteCredentials') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ The status of the deletion request. """ DELETED = "deleted" class DeleteDocumentResponse(): """ Information returned when a document is deleted. :attr str document_id: (optional) The unique identifier of the document. :attr str status: (optional) Status of the document. A deleted document has the status deleted. """ def __init__(self, *, document_id: str = None, status: str = None) -> None: """ Initialize a DeleteDocumentResponse object. :param str document_id: (optional) The unique identifier of the document. :param str status: (optional) Status of the document. A deleted document has the status deleted. """ self.document_id = document_id self.status = status @classmethod def from_dict(cls, _dict: Dict) -> 'DeleteDocumentResponse': """Initialize a DeleteDocumentResponse object from a json dictionary.""" args = {} valid_keys = ['document_id', 'status'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DeleteDocumentResponse: ' + ', '.join(bad_keys)) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'status' in _dict: args['status'] = _dict.get('status') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DeleteDocumentResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DeleteDocumentResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DeleteDocumentResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DeleteDocumentResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Status of the document. A deleted document has the status deleted. """ DELETED = "deleted" class DeleteEnvironmentResponse(): """ Response object returned when deleting an environment. :attr str environment_id: The unique identifier for the environment. :attr str status: Status of the environment. """ def __init__(self, environment_id: str, status: str) -> None: """ Initialize a DeleteEnvironmentResponse object. :param str environment_id: The unique identifier for the environment. :param str status: Status of the environment. """ self.environment_id = environment_id self.status = status @classmethod def from_dict(cls, _dict: Dict) -> 'DeleteEnvironmentResponse': """Initialize a DeleteEnvironmentResponse object from a json dictionary.""" args = {} valid_keys = ['environment_id', 'status'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DeleteEnvironmentResponse: ' + ', '.join(bad_keys)) if 'environment_id' in _dict: args['environment_id'] = _dict.get('environment_id') else: raise ValueError( 'Required property \'environment_id\' not present in DeleteEnvironmentResponse JSON' ) if 'status' in _dict: args['status'] = _dict.get('status') else: raise ValueError( 'Required property \'status\' not present in DeleteEnvironmentResponse JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DeleteEnvironmentResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environment_id') and self.environment_id is not None: _dict['environment_id'] = self.environment_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DeleteEnvironmentResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DeleteEnvironmentResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DeleteEnvironmentResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Status of the environment. """ DELETED = "deleted" class DiskUsage(): """ Summary of the disk usage statistics for the environment. :attr int used_bytes: (optional) Number of bytes within the environment's disk capacity that are currently used to store data. :attr int maximum_allowed_bytes: (optional) Total number of bytes available in the environment's disk capacity. """ def __init__(self, *, used_bytes: int = None, maximum_allowed_bytes: int = None) -> None: """ Initialize a DiskUsage object. :param int used_bytes: (optional) Number of bytes within the environment's disk capacity that are currently used to store data. :param int maximum_allowed_bytes: (optional) Total number of bytes available in the environment's disk capacity. """ self.used_bytes = used_bytes self.maximum_allowed_bytes = maximum_allowed_bytes @classmethod def from_dict(cls, _dict: Dict) -> 'DiskUsage': """Initialize a DiskUsage object from a json dictionary.""" args = {} valid_keys = ['used_bytes', 'maximum_allowed_bytes'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DiskUsage: ' + ', '.join(bad_keys)) if 'used_bytes' in _dict: args['used_bytes'] = _dict.get('used_bytes') if 'maximum_allowed_bytes' in _dict: args['maximum_allowed_bytes'] = _dict.get('maximum_allowed_bytes') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DiskUsage object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'used_bytes') and self.used_bytes is not None: _dict['used_bytes'] = self.used_bytes if hasattr(self, 'maximum_allowed_bytes' ) and self.maximum_allowed_bytes is not None: _dict['maximum_allowed_bytes'] = self.maximum_allowed_bytes return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DiskUsage object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DiskUsage') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DiskUsage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class DocumentAccepted(): """ Information returned after an uploaded document is accepted. :attr str document_id: (optional) The unique identifier of the ingested document. :attr str status: (optional) Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. :attr List[Notice] notices: (optional) Array of notices produced by the document-ingestion process. """ def __init__(self, *, document_id: str = None, status: str = None, notices: List['Notice'] = None) -> None: """ Initialize a DocumentAccepted object. :param str document_id: (optional) The unique identifier of the ingested document. :param str status: (optional) Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. :param List[Notice] notices: (optional) Array of notices produced by the document-ingestion process. """ self.document_id = document_id self.status = status self.notices = notices @classmethod def from_dict(cls, _dict: Dict) -> 'DocumentAccepted': """Initialize a DocumentAccepted object from a json dictionary.""" args = {} valid_keys = ['document_id', 'status', 'notices'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DocumentAccepted: ' + ', '.join(bad_keys)) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'status' in _dict: args['status'] = _dict.get('status') if 'notices' in _dict: args['notices'] = [ Notice._from_dict(x) for x in (_dict.get('notices')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DocumentAccepted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'notices') and self.notices is not None: _dict['notices'] = [x._to_dict() for x in self.notices] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DocumentAccepted object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DocumentAccepted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DocumentAccepted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. """ PROCESSING = "processing" PENDING = "pending" class DocumentCounts(): """ Object containing collection document count information. :attr int available: (optional) The total number of available documents in the collection. :attr int processing: (optional) The number of documents in the collection that are currently being processed. :attr int failed: (optional) The number of documents in the collection that failed to be ingested. :attr int pending: (optional) The number of documents that have been uploaded to the collection, but have not yet started processing. """ def __init__(self, *, available: int = None, processing: int = None, failed: int = None, pending: int = None) -> None: """ Initialize a DocumentCounts object. :param int available: (optional) The total number of available documents in the collection. :param int processing: (optional) The number of documents in the collection that are currently being processed. :param int failed: (optional) The number of documents in the collection that failed to be ingested. :param int pending: (optional) The number of documents that have been uploaded to the collection, but have not yet started processing. """ self.available = available self.processing = processing self.failed = failed self.pending = pending @classmethod def from_dict(cls, _dict: Dict) -> 'DocumentCounts': """Initialize a DocumentCounts object from a json dictionary.""" args = {} valid_keys = ['available', 'processing', 'failed', 'pending'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DocumentCounts: ' + ', '.join(bad_keys)) if 'available' in _dict: args['available'] = _dict.get('available') if 'processing' in _dict: args['processing'] = _dict.get('processing') if 'failed' in _dict: args['failed'] = _dict.get('failed') if 'pending' in _dict: args['pending'] = _dict.get('pending') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DocumentCounts object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'available') and self.available is not None: _dict['available'] = self.available if hasattr(self, 'processing') and self.processing is not None: _dict['processing'] = self.processing if hasattr(self, 'failed') and self.failed is not None: _dict['failed'] = self.failed if hasattr(self, 'pending') and self.pending is not None: _dict['pending'] = self.pending return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DocumentCounts object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DocumentCounts') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DocumentCounts') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class DocumentStatus(): """ Status information about a submitted document. :attr str document_id: The unique identifier of the document. :attr str configuration_id: (optional) The unique identifier for the configuration. :attr str status: Status of the document in the ingestion process. :attr str status_description: Description of the document status. :attr str filename: (optional) Name of the original source file (if available). :attr str file_type: (optional) The type of the original source file. :attr str sha1: (optional) The SHA-1 hash of the original source file (formatted as a hexadecimal string). :attr List[Notice] notices: Array of notices produced by the document-ingestion process. """ def __init__(self, document_id: str, status: str, status_description: str, notices: List['Notice'], *, configuration_id: str = None, filename: str = None, file_type: str = None, sha1: str = None) -> None: """ Initialize a DocumentStatus object. :param str document_id: The unique identifier of the document. :param str status: Status of the document in the ingestion process. :param str status_description: Description of the document status. :param List[Notice] notices: Array of notices produced by the document-ingestion process. :param str configuration_id: (optional) The unique identifier for the configuration. :param str filename: (optional) Name of the original source file (if available). :param str file_type: (optional) The type of the original source file. :param str sha1: (optional) The SHA-1 hash of the original source file (formatted as a hexadecimal string). """ self.document_id = document_id self.configuration_id = configuration_id self.status = status self.status_description = status_description self.filename = filename self.file_type = file_type self.sha1 = sha1 self.notices = notices @classmethod def from_dict(cls, _dict: Dict) -> 'DocumentStatus': """Initialize a DocumentStatus object from a json dictionary.""" args = {} valid_keys = [ 'document_id', 'configuration_id', 'status', 'status_description', 'filename', 'file_type', 'sha1', 'notices' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class DocumentStatus: ' + ', '.join(bad_keys)) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') else: raise ValueError( 'Required property \'document_id\' not present in DocumentStatus JSON' ) if 'configuration_id' in _dict: args['configuration_id'] = _dict.get('configuration_id') if 'status' in _dict: args['status'] = _dict.get('status') else: raise ValueError( 'Required property \'status\' not present in DocumentStatus JSON' ) if 'status_description' in _dict: args['status_description'] = _dict.get('status_description') else: raise ValueError( 'Required property \'status_description\' not present in DocumentStatus JSON' ) if 'filename' in _dict: args['filename'] = _dict.get('filename') if 'file_type' in _dict: args['file_type'] = _dict.get('file_type') if 'sha1' in _dict: args['sha1'] = _dict.get('sha1') if 'notices' in _dict: args['notices'] = [ Notice._from_dict(x) for x in (_dict.get('notices')) ] else: raise ValueError( 'Required property \'notices\' not present in DocumentStatus JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a DocumentStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'configuration_id') and self.configuration_id is not None: _dict['configuration_id'] = self.configuration_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr( self, 'status_description') and self.status_description is not None: _dict['status_description'] = self.status_description if hasattr(self, 'filename') and self.filename is not None: _dict['filename'] = self.filename if hasattr(self, 'file_type') and self.file_type is not None: _dict['file_type'] = self.file_type if hasattr(self, 'sha1') and self.sha1 is not None: _dict['sha1'] = self.sha1 if hasattr(self, 'notices') and self.notices is not None: _dict['notices'] = [x._to_dict() for x in self.notices] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this DocumentStatus object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'DocumentStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'DocumentStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Status of the document in the ingestion process. """ AVAILABLE = "available" AVAILABLE_WITH_NOTICES = "available with notices" FAILED = "failed" PROCESSING = "processing" PENDING = "pending" class FileTypeEnum(Enum): """ The type of the original source file. """ PDF = "pdf" HTML = "html" WORD = "word" JSON = "json" class Enrichment(): """ Enrichment step to perform on the document. Each enrichment is performed on the specified field in the order that they are listed in the configuration. :attr str description: (optional) Describes what the enrichment step does. :attr str destination_field: Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if `text` is a top-level field with no sub-fields, `text.foo` is a valid destination but `text.foo.bar` is not. :attr str source_field: Field to be enriched. Arrays can be specified as the **source_field** if the **enrichment** service for this enrichment is set to `natural_language_undstanding`. :attr bool overwrite: (optional) Indicates that the enrichments will overwrite the destination_field field if it already exists. :attr str enrichment: Name of the enrichment service to call. Current options are `natural_language_understanding` and `elements`. When using `natual_language_understanding`, the **options** object must contain Natural Language Understanding options. When using `elements` the **options** object must contain Element Classification options. Additionally, when using the `elements` enrichment the configuration specified and files ingested must meet all the criteria specified in [the documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-element-classification#element-classification). :attr bool ignore_downstream_errors: (optional) If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing. :attr EnrichmentOptions options: (optional) Options which are specific to a particular enrichment. """ def __init__(self, destination_field: str, source_field: str, enrichment: str, *, description: str = None, overwrite: bool = None, ignore_downstream_errors: bool = None, options: 'EnrichmentOptions' = None) -> None: """ Initialize a Enrichment object. :param str destination_field: Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if `text` is a top-level field with no sub-fields, `text.foo` is a valid destination but `text.foo.bar` is not. :param str source_field: Field to be enriched. Arrays can be specified as the **source_field** if the **enrichment** service for this enrichment is set to `natural_language_undstanding`. :param str enrichment: Name of the enrichment service to call. Current options are `natural_language_understanding` and `elements`. When using `natual_language_understanding`, the **options** object must contain Natural Language Understanding options. When using `elements` the **options** object must contain Element Classification options. Additionally, when using the `elements` enrichment the configuration specified and files ingested must meet all the criteria specified in [the documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-element-classification#element-classification). :param str description: (optional) Describes what the enrichment step does. :param bool overwrite: (optional) Indicates that the enrichments will overwrite the destination_field field if it already exists. :param bool ignore_downstream_errors: (optional) If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing. :param EnrichmentOptions options: (optional) Options which are specific to a particular enrichment. """ self.description = description self.destination_field = destination_field self.source_field = source_field self.overwrite = overwrite self.enrichment = enrichment self.ignore_downstream_errors = ignore_downstream_errors self.options = options @classmethod def from_dict(cls, _dict: Dict) -> 'Enrichment': """Initialize a Enrichment object from a json dictionary.""" args = {} valid_keys = [ 'description', 'destination_field', 'source_field', 'overwrite', 'enrichment', 'ignore_downstream_errors', 'options' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Enrichment: ' + ', '.join(bad_keys)) if 'description' in _dict: args['description'] = _dict.get('description') if 'destination_field' in _dict: args['destination_field'] = _dict.get('destination_field') else: raise ValueError( 'Required property \'destination_field\' not present in Enrichment JSON' ) if 'source_field' in _dict: args['source_field'] = _dict.get('source_field') else: raise ValueError( 'Required property \'source_field\' not present in Enrichment JSON' ) if 'overwrite' in _dict: args['overwrite'] = _dict.get('overwrite') if 'enrichment' in _dict: args['enrichment'] = _dict.get('enrichment') else: raise ValueError( 'Required property \'enrichment\' not present in Enrichment JSON' ) if 'ignore_downstream_errors' in _dict: args['ignore_downstream_errors'] = _dict.get( 'ignore_downstream_errors') if 'options' in _dict: args['options'] = EnrichmentOptions._from_dict(_dict.get('options')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Enrichment object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description if hasattr(self, 'destination_field') and self.destination_field is not None: _dict['destination_field'] = self.destination_field if hasattr(self, 'source_field') and self.source_field is not None: _dict['source_field'] = self.source_field if hasattr(self, 'overwrite') and self.overwrite is not None: _dict['overwrite'] = self.overwrite if hasattr(self, 'enrichment') and self.enrichment is not None: _dict['enrichment'] = self.enrichment if hasattr(self, 'ignore_downstream_errors' ) and self.ignore_downstream_errors is not None: _dict['ignore_downstream_errors'] = self.ignore_downstream_errors if hasattr(self, 'options') and self.options is not None: _dict['options'] = self.options._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Enrichment object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Enrichment') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Enrichment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class EnrichmentOptions(): """ Options which are specific to a particular enrichment. :attr NluEnrichmentFeatures features: (optional) Object containing Natural Language Understanding features to be used. :attr str language: (optional) ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are `ar` (Arabic), `en` (English), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and `sv` (Swedish). **Note:** Not all features support all languages, automatic detection is recommended. :attr str model: (optional) *For use with `elements` enrichments only.* The element extraction model to use. Models available are: `contract`. """ def __init__(self, *, features: 'NluEnrichmentFeatures' = None, language: str = None, model: str = None) -> None: """ Initialize a EnrichmentOptions object. :param NluEnrichmentFeatures features: (optional) Object containing Natural Language Understanding features to be used. :param str language: (optional) ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are `ar` (Arabic), `en` (English), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and `sv` (Swedish). **Note:** Not all features support all languages, automatic detection is recommended. :param str model: (optional) *For use with `elements` enrichments only.* The element extraction model to use. Models available are: `contract`. """ self.features = features self.language = language self.model = model @classmethod def from_dict(cls, _dict: Dict) -> 'EnrichmentOptions': """Initialize a EnrichmentOptions object from a json dictionary.""" args = {} valid_keys = ['features', 'language', 'model'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class EnrichmentOptions: ' + ', '.join(bad_keys)) if 'features' in _dict: args['features'] = NluEnrichmentFeatures._from_dict( _dict.get('features')) if 'language' in _dict: args['language'] = _dict.get('language') if 'model' in _dict: args['model'] = _dict.get('model') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a EnrichmentOptions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'features') and self.features is not None: _dict['features'] = self.features._to_dict() if hasattr(self, 'language') and self.language is not None: _dict['language'] = self.language if hasattr(self, 'model') and self.model is not None: _dict['model'] = self.model return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this EnrichmentOptions object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'EnrichmentOptions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'EnrichmentOptions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class LanguageEnum(Enum): """ ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are `ar` (Arabic), `en` (English), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and `sv` (Swedish). **Note:** Not all features support all languages, automatic detection is recommended. """ AR = "ar" EN = "en" FR = "fr" DE = "de" IT = "it" PT = "pt" RU = "ru" ES = "es" SV = "sv" class Environment(): """ Details about an environment. :attr str environment_id: (optional) Unique identifier for the environment. :attr str name: (optional) Name that identifies the environment. :attr str description: (optional) Description of the environment. :attr datetime created: (optional) Creation date of the environment, in the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. :attr datetime updated: (optional) Date of most recent environment update, in the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. :attr str status: (optional) Current status of the environment. `resizing` is displayed when a request to increase the environment size has been made, but is still in the process of being completed. :attr bool read_only: (optional) If `true`, the environment contains read-only collections that are maintained by IBM. :attr str size: (optional) Current size of the environment. :attr str requested_size: (optional) The new size requested for this environment. Only returned when the environment *status* is `resizing`. *Note:* Querying and indexing can still be performed during an environment upsize. :attr IndexCapacity index_capacity: (optional) Details about the resource usage and capacity of the environment. :attr SearchStatus search_status: (optional) Information about the Continuous Relevancy Training for this environment. """ def __init__(self, *, environment_id: str = None, name: str = None, description: str = None, created: datetime = None, updated: datetime = None, status: str = None, read_only: bool = None, size: str = None, requested_size: str = None, index_capacity: 'IndexCapacity' = None, search_status: 'SearchStatus' = None) -> None: """ Initialize a Environment object. :param str environment_id: (optional) Unique identifier for the environment. :param str name: (optional) Name that identifies the environment. :param str description: (optional) Description of the environment. :param datetime created: (optional) Creation date of the environment, in the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. :param datetime updated: (optional) Date of most recent environment update, in the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. :param str status: (optional) Current status of the environment. `resizing` is displayed when a request to increase the environment size has been made, but is still in the process of being completed. :param bool read_only: (optional) If `true`, the environment contains read-only collections that are maintained by IBM. :param str size: (optional) Current size of the environment. :param str requested_size: (optional) The new size requested for this environment. Only returned when the environment *status* is `resizing`. *Note:* Querying and indexing can still be performed during an environment upsize. :param IndexCapacity index_capacity: (optional) Details about the resource usage and capacity of the environment. :param SearchStatus search_status: (optional) Information about the Continuous Relevancy Training for this environment. """ self.environment_id = environment_id self.name = name self.description = description self.created = created self.updated = updated self.status = status self.read_only = read_only self.size = size self.requested_size = requested_size self.index_capacity = index_capacity self.search_status = search_status @classmethod def from_dict(cls, _dict: Dict) -> 'Environment': """Initialize a Environment object from a json dictionary.""" args = {} valid_keys = [ 'environment_id', 'name', 'description', 'created', 'updated', 'status', 'read_only', 'size', 'requested_size', 'index_capacity', 'search_status' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Environment: ' + ', '.join(bad_keys)) if 'environment_id' in _dict: args['environment_id'] = _dict.get('environment_id') if 'name' in _dict: args['name'] = _dict.get('name') if 'description' in _dict: args['description'] = _dict.get('description') if 'created' in _dict: args['created'] = string_to_datetime(_dict.get('created')) if 'updated' in _dict: args['updated'] = string_to_datetime(_dict.get('updated')) if 'status' in _dict: args['status'] = _dict.get('status') if 'read_only' in _dict: args['read_only'] = _dict.get('read_only') if 'size' in _dict: args['size'] = _dict.get('size') if 'requested_size' in _dict: args['requested_size'] = _dict.get('requested_size') if 'index_capacity' in _dict: args['index_capacity'] = IndexCapacity._from_dict( _dict.get('index_capacity')) if 'search_status' in _dict: args['search_status'] = SearchStatus._from_dict( _dict.get('search_status')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Environment object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environment_id') and self.environment_id is not None: _dict['environment_id'] = self.environment_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description if hasattr(self, 'created') and self.created is not None: _dict['created'] = datetime_to_string(self.created) if hasattr(self, 'updated') and self.updated is not None: _dict['updated'] = datetime_to_string(self.updated) if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'read_only') and self.read_only is not None: _dict['read_only'] = self.read_only if hasattr(self, 'size') and self.size is not None: _dict['size'] = self.size if hasattr(self, 'requested_size') and self.requested_size is not None: _dict['requested_size'] = self.requested_size if hasattr(self, 'index_capacity') and self.index_capacity is not None: _dict['index_capacity'] = self.index_capacity._to_dict() if hasattr(self, 'search_status') and self.search_status is not None: _dict['search_status'] = self.search_status._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Environment object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Environment') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Environment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Current status of the environment. `resizing` is displayed when a request to increase the environment size has been made, but is still in the process of being completed. """ ACTIVE = "active" PENDING = "pending" MAINTENANCE = "maintenance" RESIZING = "resizing" class SizeEnum(Enum): """ Current size of the environment. """ LT = "LT" XS = "XS" S = "S" MS = "MS" M = "M" ML = "ML" L = "L" XL = "XL" XXL = "XXL" XXXL = "XXXL" class EnvironmentDocuments(): """ Summary of the document usage statistics for the environment. :attr int indexed: (optional) Number of documents indexed for the environment. :attr int maximum_allowed: (optional) Total number of documents allowed in the environment's capacity. """ def __init__(self, *, indexed: int = None, maximum_allowed: int = None) -> None: """ Initialize a EnvironmentDocuments object. :param int indexed: (optional) Number of documents indexed for the environment. :param int maximum_allowed: (optional) Total number of documents allowed in the environment's capacity. """ self.indexed = indexed self.maximum_allowed = maximum_allowed @classmethod def from_dict(cls, _dict: Dict) -> 'EnvironmentDocuments': """Initialize a EnvironmentDocuments object from a json dictionary.""" args = {} valid_keys = ['indexed', 'maximum_allowed'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class EnvironmentDocuments: ' + ', '.join(bad_keys)) if 'indexed' in _dict: args['indexed'] = _dict.get('indexed') if 'maximum_allowed' in _dict: args['maximum_allowed'] = _dict.get('maximum_allowed') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a EnvironmentDocuments object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'indexed') and self.indexed is not None: _dict['indexed'] = self.indexed if hasattr(self, 'maximum_allowed') and self.maximum_allowed is not None: _dict['maximum_allowed'] = self.maximum_allowed return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this EnvironmentDocuments object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'EnvironmentDocuments') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'EnvironmentDocuments') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class EventData(): """ Query event data object. :attr str environment_id: The **environment_id** associated with the query that the event is associated with. :attr str session_token: The session token that was returned as part of the query results that this event is associated with. :attr datetime client_timestamp: (optional) The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used. :attr int display_rank: (optional) The rank of the result item which the event is associated with. :attr str collection_id: The **collection_id** of the document that this event is associated with. :attr str document_id: The **document_id** of the document that this event is associated with. :attr str query_id: (optional) The query identifier stored in the log. The query and any events associated with that query are stored with the same **query_id**. """ def __init__(self, environment_id: str, session_token: str, collection_id: str, document_id: str, *, client_timestamp: datetime = None, display_rank: int = None, query_id: str = None) -> None: """ Initialize a EventData object. :param str environment_id: The **environment_id** associated with the query that the event is associated with. :param str session_token: The session token that was returned as part of the query results that this event is associated with. :param str collection_id: The **collection_id** of the document that this event is associated with. :param str document_id: The **document_id** of the document that this event is associated with. :param datetime client_timestamp: (optional) The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used. :param int display_rank: (optional) The rank of the result item which the event is associated with. :param str query_id: (optional) The query identifier stored in the log. The query and any events associated with that query are stored with the same **query_id**. """ self.environment_id = environment_id self.session_token = session_token self.client_timestamp = client_timestamp self.display_rank = display_rank self.collection_id = collection_id self.document_id = document_id self.query_id = query_id @classmethod def from_dict(cls, _dict: Dict) -> 'EventData': """Initialize a EventData object from a json dictionary.""" args = {} valid_keys = [ 'environment_id', 'session_token', 'client_timestamp', 'display_rank', 'collection_id', 'document_id', 'query_id' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class EventData: ' + ', '.join(bad_keys)) if 'environment_id' in _dict: args['environment_id'] = _dict.get('environment_id') else: raise ValueError( 'Required property \'environment_id\' not present in EventData JSON' ) if 'session_token' in _dict: args['session_token'] = _dict.get('session_token') else: raise ValueError( 'Required property \'session_token\' not present in EventData JSON' ) if 'client_timestamp' in _dict: args['client_timestamp'] = string_to_datetime( _dict.get('client_timestamp')) if 'display_rank' in _dict: args['display_rank'] = _dict.get('display_rank') if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') else: raise ValueError( 'Required property \'collection_id\' not present in EventData JSON' ) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') else: raise ValueError( 'Required property \'document_id\' not present in EventData JSON' ) if 'query_id' in _dict: args['query_id'] = _dict.get('query_id') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a EventData object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environment_id') and self.environment_id is not None: _dict['environment_id'] = self.environment_id if hasattr(self, 'session_token') and self.session_token is not None: _dict['session_token'] = self.session_token if hasattr(self, 'client_timestamp') and self.client_timestamp is not None: _dict['client_timestamp'] = datetime_to_string( self.client_timestamp) if hasattr(self, 'display_rank') and self.display_rank is not None: _dict['display_rank'] = self.display_rank if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'query_id') and self.query_id is not None: _dict['query_id'] = self.query_id return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this EventData object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'EventData') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'EventData') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Expansion(): """ An expansion definition. Each object respresents one set of expandable strings. For example, you could have expansions for the word `hot` in one object, and expansions for the word `cold` in another. :attr List[str] input_terms: (optional) A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded. :attr List[str] expanded_terms: A list of terms that this expansion will be expanded to. If specified without **input_terms**, it also functions as the input term list. """ def __init__(self, expanded_terms: List[str], *, input_terms: List[str] = None) -> None: """ Initialize a Expansion object. :param List[str] expanded_terms: A list of terms that this expansion will be expanded to. If specified without **input_terms**, it also functions as the input term list. :param List[str] input_terms: (optional) A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded. """ self.input_terms = input_terms self.expanded_terms = expanded_terms @classmethod def from_dict(cls, _dict: Dict) -> 'Expansion': """Initialize a Expansion object from a json dictionary.""" args = {} valid_keys = ['input_terms', 'expanded_terms'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Expansion: ' + ', '.join(bad_keys)) if 'input_terms' in _dict: args['input_terms'] = _dict.get('input_terms') if 'expanded_terms' in _dict: args['expanded_terms'] = _dict.get('expanded_terms') else: raise ValueError( 'Required property \'expanded_terms\' not present in Expansion JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Expansion object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'input_terms') and self.input_terms is not None: _dict['input_terms'] = self.input_terms if hasattr(self, 'expanded_terms') and self.expanded_terms is not None: _dict['expanded_terms'] = self.expanded_terms return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Expansion object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Expansion') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Expansion') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Expansions(): """ The query expansion definitions for the specified collection. :attr List[Expansion] expansions: An array of query expansion definitions. Each object in the **expansions** array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms. To create a bi-directional expansion specify an **expanded_terms** array. When found in a query, all items in the **expanded_terms** array are then expanded to the other items in the same array. To create a uni-directional expansion, specify both an array of **input_terms** and an array of **expanded_terms**. When items in the **input_terms** array are present in a query, they are expanded using the items listed in the **expanded_terms** array. """ def __init__(self, expansions: List['Expansion']) -> None: """ Initialize a Expansions object. :param List[Expansion] expansions: An array of query expansion definitions. Each object in the **expansions** array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms. To create a bi-directional expansion specify an **expanded_terms** array. When found in a query, all items in the **expanded_terms** array are then expanded to the other items in the same array. To create a uni-directional expansion, specify both an array of **input_terms** and an array of **expanded_terms**. When items in the **input_terms** array are present in a query, they are expanded using the items listed in the **expanded_terms** array. """ self.expansions = expansions @classmethod def from_dict(cls, _dict: Dict) -> 'Expansions': """Initialize a Expansions object from a json dictionary.""" args = {} valid_keys = ['expansions'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Expansions: ' + ', '.join(bad_keys)) if 'expansions' in _dict: args['expansions'] = [ Expansion._from_dict(x) for x in (_dict.get('expansions')) ] else: raise ValueError( 'Required property \'expansions\' not present in Expansions JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Expansions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'expansions') and self.expansions is not None: _dict['expansions'] = [x._to_dict() for x in self.expansions] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Expansions object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Expansions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Expansions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Field(): """ Object containing field details. :attr str field: (optional) The name of the field. :attr str type: (optional) The type of the field. """ def __init__(self, *, field: str = None, type: str = None) -> None: """ Initialize a Field object. :param str field: (optional) The name of the field. :param str type: (optional) The type of the field. """ self.field = field self.type = type @classmethod def from_dict(cls, _dict: Dict) -> 'Field': """Initialize a Field object from a json dictionary.""" args = {} valid_keys = ['field', 'type'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Field: ' + ', '.join(bad_keys)) if 'field' in _dict: args['field'] = _dict.get('field') if 'type' in _dict: args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Field object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'field') and self.field is not None: _dict['field'] = self.field if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Field object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Field') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Field') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TypeEnum(Enum): """ The type of the field. """ NESTED = "nested" STRING = "string" DATE = "date" LONG = "long" INTEGER = "integer" SHORT = "short" BYTE = "byte" DOUBLE = "double" FLOAT = "float" BOOLEAN = "boolean" BINARY = "binary" class FontSetting(): """ Font matching configuration. :attr int level: (optional) The HTML heading level that any content with the matching font is converted to. :attr int min_size: (optional) The minimum size of the font to match. :attr int max_size: (optional) The maximum size of the font to match. :attr bool bold: (optional) When `true`, the font is matched if it is bold. :attr bool italic: (optional) When `true`, the font is matched if it is italic. :attr str name: (optional) The name of the font. """ def __init__(self, *, level: int = None, min_size: int = None, max_size: int = None, bold: bool = None, italic: bool = None, name: str = None) -> None: """ Initialize a FontSetting object. :param int level: (optional) The HTML heading level that any content with the matching font is converted to. :param int min_size: (optional) The minimum size of the font to match. :param int max_size: (optional) The maximum size of the font to match. :param bool bold: (optional) When `true`, the font is matched if it is bold. :param bool italic: (optional) When `true`, the font is matched if it is italic. :param str name: (optional) The name of the font. """ self.level = level self.min_size = min_size self.max_size = max_size self.bold = bold self.italic = italic self.name = name @classmethod def from_dict(cls, _dict: Dict) -> 'FontSetting': """Initialize a FontSetting object from a json dictionary.""" args = {} valid_keys = ['level', 'min_size', 'max_size', 'bold', 'italic', 'name'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class FontSetting: ' + ', '.join(bad_keys)) if 'level' in _dict: args['level'] = _dict.get('level') if 'min_size' in _dict: args['min_size'] = _dict.get('min_size') if 'max_size' in _dict: args['max_size'] = _dict.get('max_size') if 'bold' in _dict: args['bold'] = _dict.get('bold') if 'italic' in _dict: args['italic'] = _dict.get('italic') if 'name' in _dict: args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a FontSetting object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'level') and self.level is not None: _dict['level'] = self.level if hasattr(self, 'min_size') and self.min_size is not None: _dict['min_size'] = self.min_size if hasattr(self, 'max_size') and self.max_size is not None: _dict['max_size'] = self.max_size if hasattr(self, 'bold') and self.bold is not None: _dict['bold'] = self.bold if hasattr(self, 'italic') and self.italic is not None: _dict['italic'] = self.italic if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this FontSetting object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'FontSetting') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'FontSetting') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Gateway(): """ Object describing a specific gateway. :attr str gateway_id: (optional) The gateway ID of the gateway. :attr str name: (optional) The user defined name of the gateway. :attr str status: (optional) The current status of the gateway. `connected` means the gateway is connected to the remotly installed gateway. `idle` means this gateway is not currently in use. :attr str token: (optional) The generated **token** for this gateway. The value of this field is used when configuring the remotly installed gateway. :attr str token_id: (optional) The generated **token_id** for this gateway. The value of this field is used when configuring the remotly installed gateway. """ def __init__(self, *, gateway_id: str = None, name: str = None, status: str = None, token: str = None, token_id: str = None) -> None: """ Initialize a Gateway object. :param str gateway_id: (optional) The gateway ID of the gateway. :param str name: (optional) The user defined name of the gateway. :param str status: (optional) The current status of the gateway. `connected` means the gateway is connected to the remotly installed gateway. `idle` means this gateway is not currently in use. :param str token: (optional) The generated **token** for this gateway. The value of this field is used when configuring the remotly installed gateway. :param str token_id: (optional) The generated **token_id** for this gateway. The value of this field is used when configuring the remotly installed gateway. """ self.gateway_id = gateway_id self.name = name self.status = status self.token = token self.token_id = token_id @classmethod def from_dict(cls, _dict: Dict) -> 'Gateway': """Initialize a Gateway object from a json dictionary.""" args = {} valid_keys = ['gateway_id', 'name', 'status', 'token', 'token_id'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Gateway: ' + ', '.join(bad_keys)) if 'gateway_id' in _dict: args['gateway_id'] = _dict.get('gateway_id') if 'name' in _dict: args['name'] = _dict.get('name') if 'status' in _dict: args['status'] = _dict.get('status') if 'token' in _dict: args['token'] = _dict.get('token') if 'token_id' in _dict: args['token_id'] = _dict.get('token_id') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Gateway object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'gateway_id') and self.gateway_id is not None: _dict['gateway_id'] = self.gateway_id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'token') and self.token is not None: _dict['token'] = self.token if hasattr(self, 'token_id') and self.token_id is not None: _dict['token_id'] = self.token_id return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Gateway object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Gateway') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Gateway') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ The current status of the gateway. `connected` means the gateway is connected to the remotly installed gateway. `idle` means this gateway is not currently in use. """ CONNECTED = "connected" IDLE = "idle" class GatewayDelete(): """ Gatway deletion confirmation. :attr str gateway_id: (optional) The gateway ID of the deleted gateway. :attr str status: (optional) The status of the request. """ def __init__(self, *, gateway_id: str = None, status: str = None) -> None: """ Initialize a GatewayDelete object. :param str gateway_id: (optional) The gateway ID of the deleted gateway. :param str status: (optional) The status of the request. """ self.gateway_id = gateway_id self.status = status @classmethod def from_dict(cls, _dict: Dict) -> 'GatewayDelete': """Initialize a GatewayDelete object from a json dictionary.""" args = {} valid_keys = ['gateway_id', 'status'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class GatewayDelete: ' + ', '.join(bad_keys)) if 'gateway_id' in _dict: args['gateway_id'] = _dict.get('gateway_id') if 'status' in _dict: args['status'] = _dict.get('status') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a GatewayDelete object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'gateway_id') and self.gateway_id is not None: _dict['gateway_id'] = self.gateway_id if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this GatewayDelete object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'GatewayDelete') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'GatewayDelete') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class GatewayList(): """ Object containing gateways array. :attr List[Gateway] gateways: (optional) Array of configured gateway connections. """ def __init__(self, *, gateways: List['Gateway'] = None) -> None: """ Initialize a GatewayList object. :param List[Gateway] gateways: (optional) Array of configured gateway connections. """ self.gateways = gateways @classmethod def from_dict(cls, _dict: Dict) -> 'GatewayList': """Initialize a GatewayList object from a json dictionary.""" args = {} valid_keys = ['gateways'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class GatewayList: ' + ', '.join(bad_keys)) if 'gateways' in _dict: args['gateways'] = [ Gateway._from_dict(x) for x in (_dict.get('gateways')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a GatewayList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'gateways') and self.gateways is not None: _dict['gateways'] = [x._to_dict() for x in self.gateways] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this GatewayList object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'GatewayList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'GatewayList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class HtmlSettings(): """ A list of HTML conversion settings. :attr List[str] exclude_tags_completely: (optional) Array of HTML tags that are excluded completely. :attr List[str] exclude_tags_keep_content: (optional) Array of HTML tags which are excluded but still retain content. :attr XPathPatterns keep_content: (optional) Object containing an array of XPaths. :attr XPathPatterns exclude_content: (optional) Object containing an array of XPaths. :attr List[str] keep_tag_attributes: (optional) An array of HTML tag attributes to keep in the converted document. :attr List[str] exclude_tag_attributes: (optional) Array of HTML tag attributes to exclude. """ def __init__(self, *, exclude_tags_completely: List[str] = None, exclude_tags_keep_content: List[str] = None, keep_content: 'XPathPatterns' = None, exclude_content: 'XPathPatterns' = None, keep_tag_attributes: List[str] = None, exclude_tag_attributes: List[str] = None) -> None: """ Initialize a HtmlSettings object. :param List[str] exclude_tags_completely: (optional) Array of HTML tags that are excluded completely. :param List[str] exclude_tags_keep_content: (optional) Array of HTML tags which are excluded but still retain content. :param XPathPatterns keep_content: (optional) Object containing an array of XPaths. :param XPathPatterns exclude_content: (optional) Object containing an array of XPaths. :param List[str] keep_tag_attributes: (optional) An array of HTML tag attributes to keep in the converted document. :param List[str] exclude_tag_attributes: (optional) Array of HTML tag attributes to exclude. """ self.exclude_tags_completely = exclude_tags_completely self.exclude_tags_keep_content = exclude_tags_keep_content self.keep_content = keep_content self.exclude_content = exclude_content self.keep_tag_attributes = keep_tag_attributes self.exclude_tag_attributes = exclude_tag_attributes @classmethod def from_dict(cls, _dict: Dict) -> 'HtmlSettings': """Initialize a HtmlSettings object from a json dictionary.""" args = {} valid_keys = [ 'exclude_tags_completely', 'exclude_tags_keep_content', 'keep_content', 'exclude_content', 'keep_tag_attributes', 'exclude_tag_attributes' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class HtmlSettings: ' + ', '.join(bad_keys)) if 'exclude_tags_completely' in _dict: args['exclude_tags_completely'] = _dict.get( 'exclude_tags_completely') if 'exclude_tags_keep_content' in _dict: args['exclude_tags_keep_content'] = _dict.get( 'exclude_tags_keep_content') if 'keep_content' in _dict: args['keep_content'] = XPathPatterns._from_dict( _dict.get('keep_content')) if 'exclude_content' in _dict: args['exclude_content'] = XPathPatterns._from_dict( _dict.get('exclude_content')) if 'keep_tag_attributes' in _dict: args['keep_tag_attributes'] = _dict.get('keep_tag_attributes') if 'exclude_tag_attributes' in _dict: args['exclude_tag_attributes'] = _dict.get('exclude_tag_attributes') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a HtmlSettings object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'exclude_tags_completely' ) and self.exclude_tags_completely is not None: _dict['exclude_tags_completely'] = self.exclude_tags_completely if hasattr(self, 'exclude_tags_keep_content' ) and self.exclude_tags_keep_content is not None: _dict['exclude_tags_keep_content'] = self.exclude_tags_keep_content if hasattr(self, 'keep_content') and self.keep_content is not None: _dict['keep_content'] = self.keep_content._to_dict() if hasattr(self, 'exclude_content') and self.exclude_content is not None: _dict['exclude_content'] = self.exclude_content._to_dict() if hasattr( self, 'keep_tag_attributes') and self.keep_tag_attributes is not None: _dict['keep_tag_attributes'] = self.keep_tag_attributes if hasattr(self, 'exclude_tag_attributes' ) and self.exclude_tag_attributes is not None: _dict['exclude_tag_attributes'] = self.exclude_tag_attributes return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this HtmlSettings object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'HtmlSettings') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'HtmlSettings') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class IndexCapacity(): """ Details about the resource usage and capacity of the environment. :attr EnvironmentDocuments documents: (optional) Summary of the document usage statistics for the environment. :attr DiskUsage disk_usage: (optional) Summary of the disk usage statistics for the environment. :attr CollectionUsage collections: (optional) Summary of the collection usage in the environment. """ def __init__(self, *, documents: 'EnvironmentDocuments' = None, disk_usage: 'DiskUsage' = None, collections: 'CollectionUsage' = None) -> None: """ Initialize a IndexCapacity object. :param EnvironmentDocuments documents: (optional) Summary of the document usage statistics for the environment. :param DiskUsage disk_usage: (optional) Summary of the disk usage statistics for the environment. :param CollectionUsage collections: (optional) Summary of the collection usage in the environment. """ self.documents = documents self.disk_usage = disk_usage self.collections = collections @classmethod def from_dict(cls, _dict: Dict) -> 'IndexCapacity': """Initialize a IndexCapacity object from a json dictionary.""" args = {} valid_keys = ['documents', 'disk_usage', 'collections'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class IndexCapacity: ' + ', '.join(bad_keys)) if 'documents' in _dict: args['documents'] = EnvironmentDocuments._from_dict( _dict.get('documents')) if 'disk_usage' in _dict: args['disk_usage'] = DiskUsage._from_dict(_dict.get('disk_usage')) if 'collections' in _dict: args['collections'] = CollectionUsage._from_dict( _dict.get('collections')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a IndexCapacity object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'documents') and self.documents is not None: _dict['documents'] = self.documents._to_dict() if hasattr(self, 'disk_usage') and self.disk_usage is not None: _dict['disk_usage'] = self.disk_usage._to_dict() if hasattr(self, 'collections') and self.collections is not None: _dict['collections'] = self.collections._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this IndexCapacity object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'IndexCapacity') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'IndexCapacity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ListCollectionFieldsResponse(): """ The list of fetched fields. The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations. * Fields which contain nested JSON objects are assigned a type of "nested". * Fields which belong to a nested object are prefixed with `.properties` (for example, `warnings.properties.severity` means that the `warnings` object has a property called `severity`). * Fields returned from the News collection are prefixed with `v{N}-fullnews-t3-{YEAR}.mappings` (for example, `v5-fullnews-t3-2016.mappings.text.properties.author`). :attr List[Field] fields: (optional) An array containing information about each field in the collections. """ def __init__(self, *, fields: List['Field'] = None) -> None: """ Initialize a ListCollectionFieldsResponse object. :param List[Field] fields: (optional) An array containing information about each field in the collections. """ self.fields = fields @classmethod def from_dict(cls, _dict: Dict) -> 'ListCollectionFieldsResponse': """Initialize a ListCollectionFieldsResponse object from a json dictionary.""" args = {} valid_keys = ['fields'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class ListCollectionFieldsResponse: ' + ', '.join(bad_keys)) if 'fields' in _dict: args['fields'] = [ Field._from_dict(x) for x in (_dict.get('fields')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a ListCollectionFieldsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'fields') and self.fields is not None: _dict['fields'] = [x._to_dict() for x in self.fields] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this ListCollectionFieldsResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'ListCollectionFieldsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'ListCollectionFieldsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ListCollectionsResponse(): """ Response object containing an array of collection details. :attr List[Collection] collections: (optional) An array containing information about each collection in the environment. """ def __init__(self, *, collections: List['Collection'] = None) -> None: """ Initialize a ListCollectionsResponse object. :param List[Collection] collections: (optional) An array containing information about each collection in the environment. """ self.collections = collections @classmethod def from_dict(cls, _dict: Dict) -> 'ListCollectionsResponse': """Initialize a ListCollectionsResponse object from a json dictionary.""" args = {} valid_keys = ['collections'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class ListCollectionsResponse: ' + ', '.join(bad_keys)) if 'collections' in _dict: args['collections'] = [ Collection._from_dict(x) for x in (_dict.get('collections')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a ListCollectionsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'collections') and self.collections is not None: _dict['collections'] = [x._to_dict() for x in self.collections] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this ListCollectionsResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'ListCollectionsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'ListCollectionsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ListConfigurationsResponse(): """ Object containing an array of available configurations. :attr List[Configuration] configurations: (optional) An array of configurations that are available for the service instance. """ def __init__(self, *, configurations: List['Configuration'] = None) -> None: """ Initialize a ListConfigurationsResponse object. :param List[Configuration] configurations: (optional) An array of configurations that are available for the service instance. """ self.configurations = configurations @classmethod def from_dict(cls, _dict: Dict) -> 'ListConfigurationsResponse': """Initialize a ListConfigurationsResponse object from a json dictionary.""" args = {} valid_keys = ['configurations'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class ListConfigurationsResponse: ' + ', '.join(bad_keys)) if 'configurations' in _dict: args['configurations'] = [ Configuration._from_dict(x) for x in (_dict.get('configurations')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a ListConfigurationsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'configurations') and self.configurations is not None: _dict['configurations'] = [ x._to_dict() for x in self.configurations ] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this ListConfigurationsResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'ListConfigurationsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'ListConfigurationsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ListEnvironmentsResponse(): """ Response object containing an array of configured environments. :attr List[Environment] environments: (optional) An array of [environments] that are available for the service instance. """ def __init__(self, *, environments: List['Environment'] = None) -> None: """ Initialize a ListEnvironmentsResponse object. :param List[Environment] environments: (optional) An array of [environments] that are available for the service instance. """ self.environments = environments @classmethod def from_dict(cls, _dict: Dict) -> 'ListEnvironmentsResponse': """Initialize a ListEnvironmentsResponse object from a json dictionary.""" args = {} valid_keys = ['environments'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class ListEnvironmentsResponse: ' + ', '.join(bad_keys)) if 'environments' in _dict: args['environments'] = [ Environment._from_dict(x) for x in (_dict.get('environments')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a ListEnvironmentsResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environments') and self.environments is not None: _dict['environments'] = [x._to_dict() for x in self.environments] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this ListEnvironmentsResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'ListEnvironmentsResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'ListEnvironmentsResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class LogQueryResponse(): """ Object containing results that match the requested **logs** query. :attr int matching_results: (optional) Number of matching results. :attr List[LogQueryResponseResult] results: (optional) Array of log query response results. """ def __init__(self, *, matching_results: int = None, results: List['LogQueryResponseResult'] = None) -> None: """ Initialize a LogQueryResponse object. :param int matching_results: (optional) Number of matching results. :param List[LogQueryResponseResult] results: (optional) Array of log query response results. """ self.matching_results = matching_results self.results = results @classmethod def from_dict(cls, _dict: Dict) -> 'LogQueryResponse': """Initialize a LogQueryResponse object from a json dictionary.""" args = {} valid_keys = ['matching_results', 'results'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class LogQueryResponse: ' + ', '.join(bad_keys)) if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'results' in _dict: args['results'] = [ LogQueryResponseResult._from_dict(x) for x in (_dict.get('results')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a LogQueryResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this LogQueryResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'LogQueryResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'LogQueryResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class LogQueryResponseResult(): """ Individual result object for a **logs** query. Each object represents either a query to a Discovery collection or an event that is associated with a query. :attr str environment_id: (optional) The environment ID that is associated with this log entry. :attr str customer_id: (optional) The **customer_id** label that was specified in the header of the query or event API call that corresponds to this log entry. :attr str document_type: (optional) The type of log entry returned. **query** indicates that the log represents the results of a call to the single collection **query** method. **event** indicates that the log represents a call to the **events** API. :attr str natural_language_query: (optional) The value of the **natural_language_query** query parameter that was used to create these results. Only returned with logs of type **query**. **Note:** Other query parameters (such as **filter** or **deduplicate**) might have been used with this query, but are not recorded. :attr LogQueryResponseResultDocuments document_results: (optional) Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type `query`. :attr datetime created_timestamp: (optional) Date that the log result was created. Returned in `YYYY-MM-DDThh:mm:ssZ` format. :attr datetime client_timestamp: (optional) Date specified by the user when recording an event. Returned in `YYYY-MM-DDThh:mm:ssZ` format. Only returned with logs of type **event**. :attr str query_id: (optional) Identifier that corresponds to the **natural_language_query** string used in the original or associated query. All **event** and **query** log entries that have the same original **natural_language_query** string also have them same **query_id**. This field can be used to recall all **event** and **query** log results that have the same original query (**event** logs do not contain the original **natural_language_query** field). :attr str session_token: (optional) Unique identifier (within a 24-hour period) that identifies a single `query` log and any `event` logs that were created for it. **Note:** If the exact same query is run at the exact same time on different days, the **session_token** for those queries might be identical. However, the **created_timestamp** differs. **Note:** Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (`::`) when you query for a specific session token. :attr str collection_id: (optional) The collection ID of the document associated with this event. Only returned with logs of type `event`. :attr int display_rank: (optional) The original display rank of the document associated with this event. Only returned with logs of type `event`. :attr str document_id: (optional) The document ID of the document associated with this event. Only returned with logs of type `event`. :attr str event_type: (optional) The type of event that this object respresents. Possible values are - `query` the log of a query to a collection - `click` the result of a call to the **events** endpoint. :attr str result_type: (optional) The type of result that this **event** is associated with. Only returned with logs of type `event`. """ def __init__(self, *, environment_id: str = None, customer_id: str = None, document_type: str = None, natural_language_query: str = None, document_results: 'LogQueryResponseResultDocuments' = None, created_timestamp: datetime = None, client_timestamp: datetime = None, query_id: str = None, session_token: str = None, collection_id: str = None, display_rank: int = None, document_id: str = None, event_type: str = None, result_type: str = None) -> None: """ Initialize a LogQueryResponseResult object. :param str environment_id: (optional) The environment ID that is associated with this log entry. :param str customer_id: (optional) The **customer_id** label that was specified in the header of the query or event API call that corresponds to this log entry. :param str document_type: (optional) The type of log entry returned. **query** indicates that the log represents the results of a call to the single collection **query** method. **event** indicates that the log represents a call to the **events** API. :param str natural_language_query: (optional) The value of the **natural_language_query** query parameter that was used to create these results. Only returned with logs of type **query**. **Note:** Other query parameters (such as **filter** or **deduplicate**) might have been used with this query, but are not recorded. :param LogQueryResponseResultDocuments document_results: (optional) Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type `query`. :param datetime created_timestamp: (optional) Date that the log result was created. Returned in `YYYY-MM-DDThh:mm:ssZ` format. :param datetime client_timestamp: (optional) Date specified by the user when recording an event. Returned in `YYYY-MM-DDThh:mm:ssZ` format. Only returned with logs of type **event**. :param str query_id: (optional) Identifier that corresponds to the **natural_language_query** string used in the original or associated query. All **event** and **query** log entries that have the same original **natural_language_query** string also have them same **query_id**. This field can be used to recall all **event** and **query** log results that have the same original query (**event** logs do not contain the original **natural_language_query** field). :param str session_token: (optional) Unique identifier (within a 24-hour period) that identifies a single `query` log and any `event` logs that were created for it. **Note:** If the exact same query is run at the exact same time on different days, the **session_token** for those queries might be identical. However, the **created_timestamp** differs. **Note:** Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (`::`) when you query for a specific session token. :param str collection_id: (optional) The collection ID of the document associated with this event. Only returned with logs of type `event`. :param int display_rank: (optional) The original display rank of the document associated with this event. Only returned with logs of type `event`. :param str document_id: (optional) The document ID of the document associated with this event. Only returned with logs of type `event`. :param str event_type: (optional) The type of event that this object respresents. Possible values are - `query` the log of a query to a collection - `click` the result of a call to the **events** endpoint. :param str result_type: (optional) The type of result that this **event** is associated with. Only returned with logs of type `event`. """ self.environment_id = environment_id self.customer_id = customer_id self.document_type = document_type self.natural_language_query = natural_language_query self.document_results = document_results self.created_timestamp = created_timestamp self.client_timestamp = client_timestamp self.query_id = query_id self.session_token = session_token self.collection_id = collection_id self.display_rank = display_rank self.document_id = document_id self.event_type = event_type self.result_type = result_type @classmethod def from_dict(cls, _dict: Dict) -> 'LogQueryResponseResult': """Initialize a LogQueryResponseResult object from a json dictionary.""" args = {} valid_keys = [ 'environment_id', 'customer_id', 'document_type', 'natural_language_query', 'document_results', 'created_timestamp', 'client_timestamp', 'query_id', 'session_token', 'collection_id', 'display_rank', 'document_id', 'event_type', 'result_type' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class LogQueryResponseResult: ' + ', '.join(bad_keys)) if 'environment_id' in _dict: args['environment_id'] = _dict.get('environment_id') if 'customer_id' in _dict: args['customer_id'] = _dict.get('customer_id') if 'document_type' in _dict: args['document_type'] = _dict.get('document_type') if 'natural_language_query' in _dict: args['natural_language_query'] = _dict.get('natural_language_query') if 'document_results' in _dict: args[ 'document_results'] = LogQueryResponseResultDocuments._from_dict( _dict.get('document_results')) if 'created_timestamp' in _dict: args['created_timestamp'] = string_to_datetime( _dict.get('created_timestamp')) if 'client_timestamp' in _dict: args['client_timestamp'] = string_to_datetime( _dict.get('client_timestamp')) if 'query_id' in _dict: args['query_id'] = _dict.get('query_id') if 'session_token' in _dict: args['session_token'] = _dict.get('session_token') if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') if 'display_rank' in _dict: args['display_rank'] = _dict.get('display_rank') if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'event_type' in _dict: args['event_type'] = _dict.get('event_type') if 'result_type' in _dict: args['result_type'] = _dict.get('result_type') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a LogQueryResponseResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environment_id') and self.environment_id is not None: _dict['environment_id'] = self.environment_id if hasattr(self, 'customer_id') and self.customer_id is not None: _dict['customer_id'] = self.customer_id if hasattr(self, 'document_type') and self.document_type is not None: _dict['document_type'] = self.document_type if hasattr(self, 'natural_language_query' ) and self.natural_language_query is not None: _dict['natural_language_query'] = self.natural_language_query if hasattr(self, 'document_results') and self.document_results is not None: _dict['document_results'] = self.document_results._to_dict() if hasattr(self, 'created_timestamp') and self.created_timestamp is not None: _dict['created_timestamp'] = datetime_to_string( self.created_timestamp) if hasattr(self, 'client_timestamp') and self.client_timestamp is not None: _dict['client_timestamp'] = datetime_to_string( self.client_timestamp) if hasattr(self, 'query_id') and self.query_id is not None: _dict['query_id'] = self.query_id if hasattr(self, 'session_token') and self.session_token is not None: _dict['session_token'] = self.session_token if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'display_rank') and self.display_rank is not None: _dict['display_rank'] = self.display_rank if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'event_type') and self.event_type is not None: _dict['event_type'] = self.event_type if hasattr(self, 'result_type') and self.result_type is not None: _dict['result_type'] = self.result_type return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this LogQueryResponseResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'LogQueryResponseResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'LogQueryResponseResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class DocumentTypeEnum(Enum): """ The type of log entry returned. **query** indicates that the log represents the results of a call to the single collection **query** method. **event** indicates that the log represents a call to the **events** API. """ QUERY = "query" EVENT = "event" class EventTypeEnum(Enum): """ The type of event that this object respresents. Possible values are - `query` the log of a query to a collection - `click` the result of a call to the **events** endpoint. """ CLICK = "click" QUERY = "query" class ResultTypeEnum(Enum): """ The type of result that this **event** is associated with. Only returned with logs of type `event`. """ DOCUMENT = "document" class LogQueryResponseResultDocuments(): """ Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type `query`. :attr List[LogQueryResponseResultDocumentsResult] results: (optional) Array of log query response results. :attr int count: (optional) The number of results returned in the query associate with this log. """ def __init__(self, *, results: List['LogQueryResponseResultDocumentsResult'] = None, count: int = None) -> None: """ Initialize a LogQueryResponseResultDocuments object. :param List[LogQueryResponseResultDocumentsResult] results: (optional) Array of log query response results. :param int count: (optional) The number of results returned in the query associate with this log. """ self.results = results self.count = count @classmethod def from_dict(cls, _dict: Dict) -> 'LogQueryResponseResultDocuments': """Initialize a LogQueryResponseResultDocuments object from a json dictionary.""" args = {} valid_keys = ['results', 'count'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class LogQueryResponseResultDocuments: ' + ', '.join(bad_keys)) if 'results' in _dict: args['results'] = [ LogQueryResponseResultDocumentsResult._from_dict(x) for x in (_dict.get('results')) ] if 'count' in _dict: args['count'] = _dict.get('count') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a LogQueryResponseResultDocuments object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'count') and self.count is not None: _dict['count'] = self.count return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this LogQueryResponseResultDocuments object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'LogQueryResponseResultDocuments') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'LogQueryResponseResultDocuments') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class LogQueryResponseResultDocumentsResult(): """ Each object in the **results** array corresponds to an individual document returned by the original query. :attr int position: (optional) The result rank of this document. A position of `1` indicates that it was the first returned result. :attr str document_id: (optional) The **document_id** of the document that this result represents. :attr float score: (optional) The raw score of this result. A higher score indicates a greater match to the query parameters. :attr float confidence: (optional) The confidence score of the result's analysis. A higher score indicating greater confidence. :attr str collection_id: (optional) The **collection_id** of the document represented by this result. """ def __init__(self, *, position: int = None, document_id: str = None, score: float = None, confidence: float = None, collection_id: str = None) -> None: """ Initialize a LogQueryResponseResultDocumentsResult object. :param int position: (optional) The result rank of this document. A position of `1` indicates that it was the first returned result. :param str document_id: (optional) The **document_id** of the document that this result represents. :param float score: (optional) The raw score of this result. A higher score indicates a greater match to the query parameters. :param float confidence: (optional) The confidence score of the result's analysis. A higher score indicating greater confidence. :param str collection_id: (optional) The **collection_id** of the document represented by this result. """ self.position = position self.document_id = document_id self.score = score self.confidence = confidence self.collection_id = collection_id @classmethod def from_dict(cls, _dict: Dict) -> 'LogQueryResponseResultDocumentsResult': """Initialize a LogQueryResponseResultDocumentsResult object from a json dictionary.""" args = {} valid_keys = [ 'position', 'document_id', 'score', 'confidence', 'collection_id' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class LogQueryResponseResultDocumentsResult: ' + ', '.join(bad_keys)) if 'position' in _dict: args['position'] = _dict.get('position') if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'score' in _dict: args['score'] = _dict.get('score') if 'confidence' in _dict: args['confidence'] = _dict.get('confidence') if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a LogQueryResponseResultDocumentsResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'position') and self.position is not None: _dict['position'] = self.position if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'score') and self.score is not None: _dict['score'] = self.score if hasattr(self, 'confidence') and self.confidence is not None: _dict['confidence'] = self.confidence if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this LogQueryResponseResultDocumentsResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'LogQueryResponseResultDocumentsResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'LogQueryResponseResultDocumentsResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class MetricAggregation(): """ An aggregation analyzing log information for queries and events. :attr str interval: (optional) The measurement interval for this metric. Metric intervals are always 1 day (`1d`). :attr str event_type: (optional) The event type associated with this metric result. This field, when present, will always be `click`. :attr List[MetricAggregationResult] results: (optional) Array of metric aggregation query results. """ def __init__(self, *, interval: str = None, event_type: str = None, results: List['MetricAggregationResult'] = None) -> None: """ Initialize a MetricAggregation object. :param str interval: (optional) The measurement interval for this metric. Metric intervals are always 1 day (`1d`). :param str event_type: (optional) The event type associated with this metric result. This field, when present, will always be `click`. :param List[MetricAggregationResult] results: (optional) Array of metric aggregation query results. """ self.interval = interval self.event_type = event_type self.results = results @classmethod def from_dict(cls, _dict: Dict) -> 'MetricAggregation': """Initialize a MetricAggregation object from a json dictionary.""" args = {} valid_keys = ['interval', 'event_type', 'results'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class MetricAggregation: ' + ', '.join(bad_keys)) if 'interval' in _dict: args['interval'] = _dict.get('interval') if 'event_type' in _dict: args['event_type'] = _dict.get('event_type') if 'results' in _dict: args['results'] = [ MetricAggregationResult._from_dict(x) for x in (_dict.get('results')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a MetricAggregation object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'interval') and self.interval is not None: _dict['interval'] = self.interval if hasattr(self, 'event_type') and self.event_type is not None: _dict['event_type'] = self.event_type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this MetricAggregation object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'MetricAggregation') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'MetricAggregation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class MetricAggregationResult(): """ Aggregation result data for the requested metric. :attr datetime key_as_string: (optional) Date in string form representing the start of this interval. :attr int key: (optional) Unix epoch time equivalent of the **key_as_string**, that represents the start of this interval. :attr int matching_results: (optional) Number of matching results. :attr float event_rate: (optional) The number of queries with associated events divided by the total number of queries for the interval. Only returned with **event_rate** metrics. """ def __init__(self, *, key_as_string: datetime = None, key: int = None, matching_results: int = None, event_rate: float = None) -> None: """ Initialize a MetricAggregationResult object. :param datetime key_as_string: (optional) Date in string form representing the start of this interval. :param int key: (optional) Unix epoch time equivalent of the **key_as_string**, that represents the start of this interval. :param int matching_results: (optional) Number of matching results. :param float event_rate: (optional) The number of queries with associated events divided by the total number of queries for the interval. Only returned with **event_rate** metrics. """ self.key_as_string = key_as_string self.key = key self.matching_results = matching_results self.event_rate = event_rate @classmethod def from_dict(cls, _dict: Dict) -> 'MetricAggregationResult': """Initialize a MetricAggregationResult object from a json dictionary.""" args = {} valid_keys = ['key_as_string', 'key', 'matching_results', 'event_rate'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class MetricAggregationResult: ' + ', '.join(bad_keys)) if 'key_as_string' in _dict: args['key_as_string'] = string_to_datetime( _dict.get('key_as_string')) if 'key' in _dict: args['key'] = _dict.get('key') if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'event_rate' in _dict: args['event_rate'] = _dict.get('event_rate') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a MetricAggregationResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'key_as_string') and self.key_as_string is not None: _dict['key_as_string'] = datetime_to_string(self.key_as_string) if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'event_rate') and self.event_rate is not None: _dict['event_rate'] = self.event_rate return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this MetricAggregationResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'MetricAggregationResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'MetricAggregationResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class MetricResponse(): """ The response generated from a call to a **metrics** method. :attr List[MetricAggregation] aggregations: (optional) Array of metric aggregations. """ def __init__(self, *, aggregations: List['MetricAggregation'] = None) -> None: """ Initialize a MetricResponse object. :param List[MetricAggregation] aggregations: (optional) Array of metric aggregations. """ self.aggregations = aggregations @classmethod def from_dict(cls, _dict: Dict) -> 'MetricResponse': """Initialize a MetricResponse object from a json dictionary.""" args = {} valid_keys = ['aggregations'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class MetricResponse: ' + ', '.join(bad_keys)) if 'aggregations' in _dict: args['aggregations'] = [ MetricAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a MetricResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this MetricResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'MetricResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'MetricResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class MetricTokenAggregation(): """ An aggregation analyzing log information for queries and events. :attr str event_type: (optional) The event type associated with this metric result. This field, when present, will always be `click`. :attr List[MetricTokenAggregationResult] results: (optional) Array of results for the metric token aggregation. """ def __init__(self, *, event_type: str = None, results: List['MetricTokenAggregationResult'] = None) -> None: """ Initialize a MetricTokenAggregation object. :param str event_type: (optional) The event type associated with this metric result. This field, when present, will always be `click`. :param List[MetricTokenAggregationResult] results: (optional) Array of results for the metric token aggregation. """ self.event_type = event_type self.results = results @classmethod def from_dict(cls, _dict: Dict) -> 'MetricTokenAggregation': """Initialize a MetricTokenAggregation object from a json dictionary.""" args = {} valid_keys = ['event_type', 'results'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class MetricTokenAggregation: ' + ', '.join(bad_keys)) if 'event_type' in _dict: args['event_type'] = _dict.get('event_type') if 'results' in _dict: args['results'] = [ MetricTokenAggregationResult._from_dict(x) for x in (_dict.get('results')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a MetricTokenAggregation object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'event_type') and self.event_type is not None: _dict['event_type'] = self.event_type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this MetricTokenAggregation object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'MetricTokenAggregation') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'MetricTokenAggregation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class MetricTokenAggregationResult(): """ Aggregation result data for the requested metric. :attr str key: (optional) The content of the **natural_language_query** parameter used in the query that this result represents. :attr int matching_results: (optional) Number of matching results. :attr float event_rate: (optional) The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days). """ def __init__(self, *, key: str = None, matching_results: int = None, event_rate: float = None) -> None: """ Initialize a MetricTokenAggregationResult object. :param str key: (optional) The content of the **natural_language_query** parameter used in the query that this result represents. :param int matching_results: (optional) Number of matching results. :param float event_rate: (optional) The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days). """ self.key = key self.matching_results = matching_results self.event_rate = event_rate @classmethod def from_dict(cls, _dict: Dict) -> 'MetricTokenAggregationResult': """Initialize a MetricTokenAggregationResult object from a json dictionary.""" args = {} valid_keys = ['key', 'matching_results', 'event_rate'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class MetricTokenAggregationResult: ' + ', '.join(bad_keys)) if 'key' in _dict: args['key'] = _dict.get('key') if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'event_rate' in _dict: args['event_rate'] = _dict.get('event_rate') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a MetricTokenAggregationResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'event_rate') and self.event_rate is not None: _dict['event_rate'] = self.event_rate return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this MetricTokenAggregationResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'MetricTokenAggregationResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'MetricTokenAggregationResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class MetricTokenResponse(): """ The response generated from a call to a **metrics** method that evaluates tokens. :attr List[MetricTokenAggregation] aggregations: (optional) Array of metric token aggregations. """ def __init__(self, *, aggregations: List['MetricTokenAggregation'] = None) -> None: """ Initialize a MetricTokenResponse object. :param List[MetricTokenAggregation] aggregations: (optional) Array of metric token aggregations. """ self.aggregations = aggregations @classmethod def from_dict(cls, _dict: Dict) -> 'MetricTokenResponse': """Initialize a MetricTokenResponse object from a json dictionary.""" args = {} valid_keys = ['aggregations'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class MetricTokenResponse: ' + ', '.join(bad_keys)) if 'aggregations' in _dict: args['aggregations'] = [ MetricTokenAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a MetricTokenResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this MetricTokenResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'MetricTokenResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'MetricTokenResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentCategories(): """ An object that indicates the Categories enrichment will be applied to the specified field. """ def __init__(self, **kwargs) -> None: """ Initialize a NluEnrichmentCategories object. :param **kwargs: (optional) Any additional properties. """ for _key, _value in kwargs.items(): setattr(self, _key, _value) @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentCategories': """Initialize a NluEnrichmentCategories object from a json dictionary.""" args = {} xtra = _dict.copy() args.update(xtra) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentCategories object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, '_additionalProperties'): for _key in self._additionalProperties: _value = getattr(self, _key, None) if _value is not None: _dict[_key] = _value return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __setattr__(self, name: str, value: object) -> None: properties = {} if not hasattr(self, '_additionalProperties'): super(NluEnrichmentCategories, self).__setattr__('_additionalProperties', set()) if name not in properties: self._additionalProperties.add(name) super(NluEnrichmentCategories, self).__setattr__(name, value) def __str__(self) -> str: """Return a `str` version of this NluEnrichmentCategories object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentCategories') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentCategories') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentConcepts(): """ An object specifiying the concepts enrichment and related parameters. :attr int limit: (optional) The maximum number of concepts enrichments to extact from each instance of the specified field. """ def __init__(self, *, limit: int = None) -> None: """ Initialize a NluEnrichmentConcepts object. :param int limit: (optional) The maximum number of concepts enrichments to extact from each instance of the specified field. """ self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentConcepts': """Initialize a NluEnrichmentConcepts object from a json dictionary.""" args = {} valid_keys = ['limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentConcepts: ' + ', '.join(bad_keys)) if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentConcepts object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentConcepts object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentConcepts') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentConcepts') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentEmotion(): """ An object specifying the emotion detection enrichment and related parameters. :attr bool document: (optional) When `true`, emotion detection is performed on the entire field. :attr List[str] targets: (optional) A comma-separated list of target strings that will have any associated emotions detected. """ def __init__(self, *, document: bool = None, targets: List[str] = None) -> None: """ Initialize a NluEnrichmentEmotion object. :param bool document: (optional) When `true`, emotion detection is performed on the entire field. :param List[str] targets: (optional) A comma-separated list of target strings that will have any associated emotions detected. """ self.document = document self.targets = targets @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentEmotion': """Initialize a NluEnrichmentEmotion object from a json dictionary.""" args = {} valid_keys = ['document', 'targets'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentEmotion: ' + ', '.join(bad_keys)) if 'document' in _dict: args['document'] = _dict.get('document') if 'targets' in _dict: args['targets'] = _dict.get('targets') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentEmotion object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document') and self.document is not None: _dict['document'] = self.document if hasattr(self, 'targets') and self.targets is not None: _dict['targets'] = self.targets return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentEmotion object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentEmotion') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentEmotion') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentEntities(): """ An object speficying the Entities enrichment and related parameters. :attr bool sentiment: (optional) When `true`, sentiment analysis of entities will be performed on the specified field. :attr bool emotion: (optional) When `true`, emotion detection of entities will be performed on the specified field. :attr int limit: (optional) The maximum number of entities to extract for each instance of the specified field. :attr bool mentions: (optional) When `true`, the number of mentions of each identified entity is recorded. The default is `false`. :attr bool mention_types: (optional) When `true`, the types of mentions for each idetifieid entity is recorded. The default is `false`. :attr bool sentence_locations: (optional) When `true`, a list of sentence locations for each instance of each identified entity is recorded. The default is `false`. :attr str model: (optional) The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model `alchemy`. """ def __init__(self, *, sentiment: bool = None, emotion: bool = None, limit: int = None, mentions: bool = None, mention_types: bool = None, sentence_locations: bool = None, model: str = None) -> None: """ Initialize a NluEnrichmentEntities object. :param bool sentiment: (optional) When `true`, sentiment analysis of entities will be performed on the specified field. :param bool emotion: (optional) When `true`, emotion detection of entities will be performed on the specified field. :param int limit: (optional) The maximum number of entities to extract for each instance of the specified field. :param bool mentions: (optional) When `true`, the number of mentions of each identified entity is recorded. The default is `false`. :param bool mention_types: (optional) When `true`, the types of mentions for each idetifieid entity is recorded. The default is `false`. :param bool sentence_locations: (optional) When `true`, a list of sentence locations for each instance of each identified entity is recorded. The default is `false`. :param str model: (optional) The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model `alchemy`. """ self.sentiment = sentiment self.emotion = emotion self.limit = limit self.mentions = mentions self.mention_types = mention_types self.sentence_locations = sentence_locations self.model = model @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentEntities': """Initialize a NluEnrichmentEntities object from a json dictionary.""" args = {} valid_keys = [ 'sentiment', 'emotion', 'limit', 'mentions', 'mention_types', 'sentence_locations', 'model' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentEntities: ' + ', '.join(bad_keys)) if 'sentiment' in _dict: args['sentiment'] = _dict.get('sentiment') if 'emotion' in _dict: args['emotion'] = _dict.get('emotion') if 'limit' in _dict: args['limit'] = _dict.get('limit') if 'mentions' in _dict: args['mentions'] = _dict.get('mentions') if 'mention_types' in _dict: args['mention_types'] = _dict.get('mention_types') if 'sentence_locations' in _dict: args['sentence_locations'] = _dict.get('sentence_locations') if 'model' in _dict: args['model'] = _dict.get('model') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentEntities object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'sentiment') and self.sentiment is not None: _dict['sentiment'] = self.sentiment if hasattr(self, 'emotion') and self.emotion is not None: _dict['emotion'] = self.emotion if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'mentions') and self.mentions is not None: _dict['mentions'] = self.mentions if hasattr(self, 'mention_types') and self.mention_types is not None: _dict['mention_types'] = self.mention_types if hasattr( self, 'sentence_locations') and self.sentence_locations is not None: _dict['sentence_locations'] = self.sentence_locations if hasattr(self, 'model') and self.model is not None: _dict['model'] = self.model return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentEntities object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentEntities') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentEntities') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentFeatures(): """ Object containing Natural Language Understanding features to be used. :attr NluEnrichmentKeywords keywords: (optional) An object specifying the Keyword enrichment and related parameters. :attr NluEnrichmentEntities entities: (optional) An object speficying the Entities enrichment and related parameters. :attr NluEnrichmentSentiment sentiment: (optional) An object specifying the sentiment extraction enrichment and related parameters. :attr NluEnrichmentEmotion emotion: (optional) An object specifying the emotion detection enrichment and related parameters. :attr NluEnrichmentCategories categories: (optional) An object that indicates the Categories enrichment will be applied to the specified field. :attr NluEnrichmentSemanticRoles semantic_roles: (optional) An object specifiying the semantic roles enrichment and related parameters. :attr NluEnrichmentRelations relations: (optional) An object specifying the relations enrichment and related parameters. :attr NluEnrichmentConcepts concepts: (optional) An object specifiying the concepts enrichment and related parameters. """ def __init__(self, *, keywords: 'NluEnrichmentKeywords' = None, entities: 'NluEnrichmentEntities' = None, sentiment: 'NluEnrichmentSentiment' = None, emotion: 'NluEnrichmentEmotion' = None, categories: 'NluEnrichmentCategories' = None, semantic_roles: 'NluEnrichmentSemanticRoles' = None, relations: 'NluEnrichmentRelations' = None, concepts: 'NluEnrichmentConcepts' = None) -> None: """ Initialize a NluEnrichmentFeatures object. :param NluEnrichmentKeywords keywords: (optional) An object specifying the Keyword enrichment and related parameters. :param NluEnrichmentEntities entities: (optional) An object speficying the Entities enrichment and related parameters. :param NluEnrichmentSentiment sentiment: (optional) An object specifying the sentiment extraction enrichment and related parameters. :param NluEnrichmentEmotion emotion: (optional) An object specifying the emotion detection enrichment and related parameters. :param NluEnrichmentCategories categories: (optional) An object that indicates the Categories enrichment will be applied to the specified field. :param NluEnrichmentSemanticRoles semantic_roles: (optional) An object specifiying the semantic roles enrichment and related parameters. :param NluEnrichmentRelations relations: (optional) An object specifying the relations enrichment and related parameters. :param NluEnrichmentConcepts concepts: (optional) An object specifiying the concepts enrichment and related parameters. """ self.keywords = keywords self.entities = entities self.sentiment = sentiment self.emotion = emotion self.categories = categories self.semantic_roles = semantic_roles self.relations = relations self.concepts = concepts @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentFeatures': """Initialize a NluEnrichmentFeatures object from a json dictionary.""" args = {} valid_keys = [ 'keywords', 'entities', 'sentiment', 'emotion', 'categories', 'semantic_roles', 'relations', 'concepts' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentFeatures: ' + ', '.join(bad_keys)) if 'keywords' in _dict: args['keywords'] = NluEnrichmentKeywords._from_dict( _dict.get('keywords')) if 'entities' in _dict: args['entities'] = NluEnrichmentEntities._from_dict( _dict.get('entities')) if 'sentiment' in _dict: args['sentiment'] = NluEnrichmentSentiment._from_dict( _dict.get('sentiment')) if 'emotion' in _dict: args['emotion'] = NluEnrichmentEmotion._from_dict( _dict.get('emotion')) if 'categories' in _dict: args['categories'] = NluEnrichmentCategories._from_dict( _dict.get('categories')) if 'semantic_roles' in _dict: args['semantic_roles'] = NluEnrichmentSemanticRoles._from_dict( _dict.get('semantic_roles')) if 'relations' in _dict: args['relations'] = NluEnrichmentRelations._from_dict( _dict.get('relations')) if 'concepts' in _dict: args['concepts'] = NluEnrichmentConcepts._from_dict( _dict.get('concepts')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentFeatures object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'keywords') and self.keywords is not None: _dict['keywords'] = self.keywords._to_dict() if hasattr(self, 'entities') and self.entities is not None: _dict['entities'] = self.entities._to_dict() if hasattr(self, 'sentiment') and self.sentiment is not None: _dict['sentiment'] = self.sentiment._to_dict() if hasattr(self, 'emotion') and self.emotion is not None: _dict['emotion'] = self.emotion._to_dict() if hasattr(self, 'categories') and self.categories is not None: _dict['categories'] = self.categories._to_dict() if hasattr(self, 'semantic_roles') and self.semantic_roles is not None: _dict['semantic_roles'] = self.semantic_roles._to_dict() if hasattr(self, 'relations') and self.relations is not None: _dict['relations'] = self.relations._to_dict() if hasattr(self, 'concepts') and self.concepts is not None: _dict['concepts'] = self.concepts._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentFeatures object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentFeatures') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentFeatures') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentKeywords(): """ An object specifying the Keyword enrichment and related parameters. :attr bool sentiment: (optional) When `true`, sentiment analysis of keywords will be performed on the specified field. :attr bool emotion: (optional) When `true`, emotion detection of keywords will be performed on the specified field. :attr int limit: (optional) The maximum number of keywords to extract for each instance of the specified field. """ def __init__(self, *, sentiment: bool = None, emotion: bool = None, limit: int = None) -> None: """ Initialize a NluEnrichmentKeywords object. :param bool sentiment: (optional) When `true`, sentiment analysis of keywords will be performed on the specified field. :param bool emotion: (optional) When `true`, emotion detection of keywords will be performed on the specified field. :param int limit: (optional) The maximum number of keywords to extract for each instance of the specified field. """ self.sentiment = sentiment self.emotion = emotion self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentKeywords': """Initialize a NluEnrichmentKeywords object from a json dictionary.""" args = {} valid_keys = ['sentiment', 'emotion', 'limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentKeywords: ' + ', '.join(bad_keys)) if 'sentiment' in _dict: args['sentiment'] = _dict.get('sentiment') if 'emotion' in _dict: args['emotion'] = _dict.get('emotion') if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentKeywords object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'sentiment') and self.sentiment is not None: _dict['sentiment'] = self.sentiment if hasattr(self, 'emotion') and self.emotion is not None: _dict['emotion'] = self.emotion if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentKeywords object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentKeywords') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentKeywords') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentRelations(): """ An object specifying the relations enrichment and related parameters. :attr str model: (optional) *For use with `natural_language_understanding` enrichments only.* The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model is`en-news`. """ def __init__(self, *, model: str = None) -> None: """ Initialize a NluEnrichmentRelations object. :param str model: (optional) *For use with `natural_language_understanding` enrichments only.* The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model is`en-news`. """ self.model = model @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentRelations': """Initialize a NluEnrichmentRelations object from a json dictionary.""" args = {} valid_keys = ['model'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentRelations: ' + ', '.join(bad_keys)) if 'model' in _dict: args['model'] = _dict.get('model') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentRelations object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'model') and self.model is not None: _dict['model'] = self.model return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentRelations object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentRelations') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentRelations') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentSemanticRoles(): """ An object specifiying the semantic roles enrichment and related parameters. :attr bool entities: (optional) When `true`, entities are extracted from the identified sentence parts. :attr bool keywords: (optional) When `true`, keywords are extracted from the identified sentence parts. :attr int limit: (optional) The maximum number of semantic roles enrichments to extact from each instance of the specified field. """ def __init__(self, *, entities: bool = None, keywords: bool = None, limit: int = None) -> None: """ Initialize a NluEnrichmentSemanticRoles object. :param bool entities: (optional) When `true`, entities are extracted from the identified sentence parts. :param bool keywords: (optional) When `true`, keywords are extracted from the identified sentence parts. :param int limit: (optional) The maximum number of semantic roles enrichments to extact from each instance of the specified field. """ self.entities = entities self.keywords = keywords self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentSemanticRoles': """Initialize a NluEnrichmentSemanticRoles object from a json dictionary.""" args = {} valid_keys = ['entities', 'keywords', 'limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentSemanticRoles: ' + ', '.join(bad_keys)) if 'entities' in _dict: args['entities'] = _dict.get('entities') if 'keywords' in _dict: args['keywords'] = _dict.get('keywords') if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentSemanticRoles object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'entities') and self.entities is not None: _dict['entities'] = self.entities if hasattr(self, 'keywords') and self.keywords is not None: _dict['keywords'] = self.keywords if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentSemanticRoles object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentSemanticRoles') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentSemanticRoles') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NluEnrichmentSentiment(): """ An object specifying the sentiment extraction enrichment and related parameters. :attr bool document: (optional) When `true`, sentiment analysis is performed on the entire field. :attr List[str] targets: (optional) A comma-separated list of target strings that will have any associated sentiment analyzed. """ def __init__(self, *, document: bool = None, targets: List[str] = None) -> None: """ Initialize a NluEnrichmentSentiment object. :param bool document: (optional) When `true`, sentiment analysis is performed on the entire field. :param List[str] targets: (optional) A comma-separated list of target strings that will have any associated sentiment analyzed. """ self.document = document self.targets = targets @classmethod def from_dict(cls, _dict: Dict) -> 'NluEnrichmentSentiment': """Initialize a NluEnrichmentSentiment object from a json dictionary.""" args = {} valid_keys = ['document', 'targets'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NluEnrichmentSentiment: ' + ', '.join(bad_keys)) if 'document' in _dict: args['document'] = _dict.get('document') if 'targets' in _dict: args['targets'] = _dict.get('targets') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NluEnrichmentSentiment object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document') and self.document is not None: _dict['document'] = self.document if hasattr(self, 'targets') and self.targets is not None: _dict['targets'] = self.targets return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NluEnrichmentSentiment object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NluEnrichmentSentiment') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NluEnrichmentSentiment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class NormalizationOperation(): """ Object containing normalization operations. :attr str operation: (optional) Identifies what type of operation to perform. **copy** - Copies the value of the **source_field** to the **destination_field** field. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. **move** - Renames (moves) the **source_field** to the **destination_field**. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. Rename is identical to copy, except that the **source_field** is removed after the value has been copied to the **destination_field** (it is the same as a _copy_ followed by a _remove_). **merge** - Merges the value of the **source_field** with the value of the **destination_field**. The **destination_field** is converted into an array if it is not already an array, and the value of the **source_field** is appended to the array. This operation removes the **source_field** after the merge. If the **source_field** does not exist in the current document, then the **destination_field** is still converted into an array (if it is not an array already). This conversion ensures the type for **destination_field** is consistent across all documents. **remove** - Deletes the **source_field** field. The **destination_field** is ignored for this operation. **remove_nulls** - Removes all nested null (blank) field values from the ingested document. **source_field** and **destination_field** are ignored by this operation because _remove_nulls_ operates on the entire ingested document. Typically, **remove_nulls** is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive). :attr str source_field: (optional) The source field for the operation. :attr str destination_field: (optional) The destination field for the operation. """ def __init__(self, *, operation: str = None, source_field: str = None, destination_field: str = None) -> None: """ Initialize a NormalizationOperation object. :param str operation: (optional) Identifies what type of operation to perform. **copy** - Copies the value of the **source_field** to the **destination_field** field. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. **move** - Renames (moves) the **source_field** to the **destination_field**. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. Rename is identical to copy, except that the **source_field** is removed after the value has been copied to the **destination_field** (it is the same as a _copy_ followed by a _remove_). **merge** - Merges the value of the **source_field** with the value of the **destination_field**. The **destination_field** is converted into an array if it is not already an array, and the value of the **source_field** is appended to the array. This operation removes the **source_field** after the merge. If the **source_field** does not exist in the current document, then the **destination_field** is still converted into an array (if it is not an array already). This conversion ensures the type for **destination_field** is consistent across all documents. **remove** - Deletes the **source_field** field. The **destination_field** is ignored for this operation. **remove_nulls** - Removes all nested null (blank) field values from the ingested document. **source_field** and **destination_field** are ignored by this operation because _remove_nulls_ operates on the entire ingested document. Typically, **remove_nulls** is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive). :param str source_field: (optional) The source field for the operation. :param str destination_field: (optional) The destination field for the operation. """ self.operation = operation self.source_field = source_field self.destination_field = destination_field @classmethod def from_dict(cls, _dict: Dict) -> 'NormalizationOperation': """Initialize a NormalizationOperation object from a json dictionary.""" args = {} valid_keys = ['operation', 'source_field', 'destination_field'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class NormalizationOperation: ' + ', '.join(bad_keys)) if 'operation' in _dict: args['operation'] = _dict.get('operation') if 'source_field' in _dict: args['source_field'] = _dict.get('source_field') if 'destination_field' in _dict: args['destination_field'] = _dict.get('destination_field') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a NormalizationOperation object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'operation') and self.operation is not None: _dict['operation'] = self.operation if hasattr(self, 'source_field') and self.source_field is not None: _dict['source_field'] = self.source_field if hasattr(self, 'destination_field') and self.destination_field is not None: _dict['destination_field'] = self.destination_field return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this NormalizationOperation object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'NormalizationOperation') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'NormalizationOperation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class OperationEnum(Enum): """ Identifies what type of operation to perform. **copy** - Copies the value of the **source_field** to the **destination_field** field. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. **move** - Renames (moves) the **source_field** to the **destination_field**. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. Rename is identical to copy, except that the **source_field** is removed after the value has been copied to the **destination_field** (it is the same as a _copy_ followed by a _remove_). **merge** - Merges the value of the **source_field** with the value of the **destination_field**. The **destination_field** is converted into an array if it is not already an array, and the value of the **source_field** is appended to the array. This operation removes the **source_field** after the merge. If the **source_field** does not exist in the current document, then the **destination_field** is still converted into an array (if it is not an array already). This conversion ensures the type for **destination_field** is consistent across all documents. **remove** - Deletes the **source_field** field. The **destination_field** is ignored for this operation. **remove_nulls** - Removes all nested null (blank) field values from the ingested document. **source_field** and **destination_field** are ignored by this operation because _remove_nulls_ operates on the entire ingested document. Typically, **remove_nulls** is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive). """ COPY = "copy" MOVE = "move" MERGE = "merge" REMOVE = "remove" REMOVE_NULLS = "remove_nulls" class Notice(): """ A notice produced for the collection. :attr str notice_id: (optional) Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include: `index_failed`, `index_failed_too_many_requests`, `index_failed_incompatible_field`, `index_failed_cluster_unavailable`, `ingestion_timeout`, `ingestion_error`, `bad_request`, `internal_error`, `missing_model`, `unsupported_model`, `smart_document_understanding_failed_incompatible_field`, `smart_document_understanding_failed_internal_error`, `smart_document_understanding_failed_internal_error`, `smart_document_understanding_failed_warning`, `smart_document_understanding_page_error`, `smart_document_understanding_page_warning`. **Note:** This is not a complete list, other values might be returned. :attr datetime created: (optional) The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :attr str document_id: (optional) Unique identifier of the document. :attr str query_id: (optional) Unique identifier of the query used for relevance training. :attr str severity: (optional) Severity level of the notice. :attr str step: (optional) Ingestion or training step in which the notice occurred. Typical step values include: `classify_elements`, `smartDocumentUnderstanding`, `ingestion`, `indexing`, `convert`. **Note:** This is not a complete list, other values might be returned. :attr str description: (optional) The description of the notice. """ def __init__(self, *, notice_id: str = None, created: datetime = None, document_id: str = None, query_id: str = None, severity: str = None, step: str = None, description: str = None) -> None: """ Initialize a Notice object. :param str notice_id: (optional) Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include: `index_failed`, `index_failed_too_many_requests`, `index_failed_incompatible_field`, `index_failed_cluster_unavailable`, `ingestion_timeout`, `ingestion_error`, `bad_request`, `internal_error`, `missing_model`, `unsupported_model`, `smart_document_understanding_failed_incompatible_field`, `smart_document_understanding_failed_internal_error`, `smart_document_understanding_failed_internal_error`, `smart_document_understanding_failed_warning`, `smart_document_understanding_page_error`, `smart_document_understanding_page_warning`. **Note:** This is not a complete list, other values might be returned. :param datetime created: (optional) The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. :param str document_id: (optional) Unique identifier of the document. :param str query_id: (optional) Unique identifier of the query used for relevance training. :param str severity: (optional) Severity level of the notice. :param str step: (optional) Ingestion or training step in which the notice occurred. Typical step values include: `classify_elements`, `smartDocumentUnderstanding`, `ingestion`, `indexing`, `convert`. **Note:** This is not a complete list, other values might be returned. :param str description: (optional) The description of the notice. """ self.notice_id = notice_id self.created = created self.document_id = document_id self.query_id = query_id self.severity = severity self.step = step self.description = description @classmethod def from_dict(cls, _dict: Dict) -> 'Notice': """Initialize a Notice object from a json dictionary.""" args = {} valid_keys = [ 'notice_id', 'created', 'document_id', 'query_id', 'severity', 'step', 'description' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Notice: ' + ', '.join(bad_keys)) if 'notice_id' in _dict: args['notice_id'] = _dict.get('notice_id') if 'created' in _dict: args['created'] = string_to_datetime(_dict.get('created')) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'query_id' in _dict: args['query_id'] = _dict.get('query_id') if 'severity' in _dict: args['severity'] = _dict.get('severity') if 'step' in _dict: args['step'] = _dict.get('step') if 'description' in _dict: args['description'] = _dict.get('description') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Notice object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'notice_id') and self.notice_id is not None: _dict['notice_id'] = self.notice_id if hasattr(self, 'created') and self.created is not None: _dict['created'] = datetime_to_string(self.created) if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'query_id') and self.query_id is not None: _dict['query_id'] = self.query_id if hasattr(self, 'severity') and self.severity is not None: _dict['severity'] = self.severity if hasattr(self, 'step') and self.step is not None: _dict['step'] = self.step if hasattr(self, 'description') and self.description is not None: _dict['description'] = self.description return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Notice object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Notice') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Notice') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SeverityEnum(Enum): """ Severity level of the notice. """ WARNING = "warning" ERROR = "error" class PdfHeadingDetection(): """ Object containing heading detection conversion settings for PDF documents. :attr List[FontSetting] fonts: (optional) Array of font matching configurations. """ def __init__(self, *, fonts: List['FontSetting'] = None) -> None: """ Initialize a PdfHeadingDetection object. :param List[FontSetting] fonts: (optional) Array of font matching configurations. """ self.fonts = fonts @classmethod def from_dict(cls, _dict: Dict) -> 'PdfHeadingDetection': """Initialize a PdfHeadingDetection object from a json dictionary.""" args = {} valid_keys = ['fonts'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class PdfHeadingDetection: ' + ', '.join(bad_keys)) if 'fonts' in _dict: args['fonts'] = [ FontSetting._from_dict(x) for x in (_dict.get('fonts')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a PdfHeadingDetection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'fonts') and self.fonts is not None: _dict['fonts'] = [x._to_dict() for x in self.fonts] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this PdfHeadingDetection object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'PdfHeadingDetection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'PdfHeadingDetection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class PdfSettings(): """ A list of PDF conversion settings. :attr PdfHeadingDetection heading: (optional) Object containing heading detection conversion settings for PDF documents. """ def __init__(self, *, heading: 'PdfHeadingDetection' = None) -> None: """ Initialize a PdfSettings object. :param PdfHeadingDetection heading: (optional) Object containing heading detection conversion settings for PDF documents. """ self.heading = heading @classmethod def from_dict(cls, _dict: Dict) -> 'PdfSettings': """Initialize a PdfSettings object from a json dictionary.""" args = {} valid_keys = ['heading'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class PdfSettings: ' + ', '.join(bad_keys)) if 'heading' in _dict: args['heading'] = PdfHeadingDetection._from_dict( _dict.get('heading')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a PdfSettings object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'heading') and self.heading is not None: _dict['heading'] = self.heading._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this PdfSettings object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'PdfSettings') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'PdfSettings') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class QueryAggregation(): """ An aggregation produced by Discovery to analyze the input provided. :attr str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :attr List[AggregationResult] results: (optional) Array of aggregation results. :attr int matching_results: (optional) Number of matching results. :attr List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None) -> None: """ Initialize a QueryAggregation object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations @classmethod def from_dict(cls, _dict: Dict) -> 'QueryAggregation': """Initialize a QueryAggregation object from a json dictionary.""" disc_class = cls._get_class_by_discriminator(_dict) if disc_class != cls: return disc_class.from_dict(_dict) args = {} valid_keys = ['type', 'results', 'matching_results', 'aggregations'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class QueryAggregation: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryAggregation object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this QueryAggregation object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryAggregation') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryAggregation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @classmethod def _get_class_by_discriminator(cls, _dict: Dict) -> object: mapping = {} mapping['histogram'] = 'Histogram' mapping['max'] = 'Calculation' mapping['min'] = 'Calculation' mapping['average'] = 'Calculation' mapping['sum'] = 'Calculation' mapping['unique_count'] = 'Calculation' mapping['term'] = 'Term' mapping['filter'] = 'Filter' mapping['nested'] = 'Nested' mapping['timeslice'] = 'Timeslice' mapping['top_hits'] = 'TopHits' disc_value = _dict.get('type') if disc_value is None: raise ValueError( 'Discriminator property \'type\' not found in QueryAggregation JSON' ) class_name = mapping.get(disc_value, disc_value) try: disc_class = getattr(sys.modules[__name__], class_name) except AttributeError: disc_class = cls if isinstance(disc_class, object): return disc_class raise TypeError('%s is not a discriminator class' % class_name) class QueryNoticesResponse(): """ Object containing notice query results. :attr int matching_results: (optional) The number of matching results. :attr List[QueryNoticesResult] results: (optional) Array of document results that match the query. :attr List[QueryAggregation] aggregations: (optional) Array of aggregation results that match the query. :attr List[QueryPassages] passages: (optional) Array of passage results that match the query. :attr int duplicates_removed: (optional) The number of duplicates removed from this notices query. """ def __init__(self, *, matching_results: int = None, results: List['QueryNoticesResult'] = None, aggregations: List['QueryAggregation'] = None, passages: List['QueryPassages'] = None, duplicates_removed: int = None) -> None: """ Initialize a QueryNoticesResponse object. :param int matching_results: (optional) The number of matching results. :param List[QueryNoticesResult] results: (optional) Array of document results that match the query. :param List[QueryAggregation] aggregations: (optional) Array of aggregation results that match the query. :param List[QueryPassages] passages: (optional) Array of passage results that match the query. :param int duplicates_removed: (optional) The number of duplicates removed from this notices query. """ self.matching_results = matching_results self.results = results self.aggregations = aggregations self.passages = passages self.duplicates_removed = duplicates_removed @classmethod def from_dict(cls, _dict: Dict) -> 'QueryNoticesResponse': """Initialize a QueryNoticesResponse object from a json dictionary.""" args = {} valid_keys = [ 'matching_results', 'results', 'aggregations', 'passages', 'duplicates_removed' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class QueryNoticesResponse: ' + ', '.join(bad_keys)) if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'results' in _dict: args['results'] = [ QueryNoticesResult._from_dict(x) for x in (_dict.get('results')) ] if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'passages' in _dict: args['passages'] = [ QueryPassages._from_dict(x) for x in (_dict.get('passages')) ] if 'duplicates_removed' in _dict: args['duplicates_removed'] = _dict.get('duplicates_removed') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryNoticesResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'passages') and self.passages is not None: _dict['passages'] = [x._to_dict() for x in self.passages] if hasattr( self, 'duplicates_removed') and self.duplicates_removed is not None: _dict['duplicates_removed'] = self.duplicates_removed return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this QueryNoticesResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryNoticesResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryNoticesResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class QueryNoticesResult(): """ Query result object. :attr str id: (optional) The unique identifier of the document. :attr dict metadata: (optional) Metadata of the document. :attr str collection_id: (optional) The collection ID of the collection containing the document for this result. :attr QueryResultMetadata result_metadata: (optional) Metadata of a query result. :attr int code: (optional) The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document. :attr str filename: (optional) Name of the original source file (if available). :attr str file_type: (optional) The type of the original source file. :attr str sha1: (optional) The SHA-1 hash of the original source file (formatted as a hexadecimal string). :attr List[Notice] notices: (optional) Array of notices for the document. """ def __init__(self, *, id: str = None, metadata: dict = None, collection_id: str = None, result_metadata: 'QueryResultMetadata' = None, code: int = None, filename: str = None, file_type: str = None, sha1: str = None, notices: List['Notice'] = None, **kwargs) -> None: """ Initialize a QueryNoticesResult object. :param str id: (optional) The unique identifier of the document. :param dict metadata: (optional) Metadata of the document. :param str collection_id: (optional) The collection ID of the collection containing the document for this result. :param QueryResultMetadata result_metadata: (optional) Metadata of a query result. :param int code: (optional) The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document. :param str filename: (optional) Name of the original source file (if available). :param str file_type: (optional) The type of the original source file. :param str sha1: (optional) The SHA-1 hash of the original source file (formatted as a hexadecimal string). :param List[Notice] notices: (optional) Array of notices for the document. :param **kwargs: (optional) Any additional properties. """ self.id = id self.metadata = metadata self.collection_id = collection_id self.result_metadata = result_metadata self.code = code self.filename = filename self.file_type = file_type self.sha1 = sha1 self.notices = notices for _key, _value in kwargs.items(): setattr(self, _key, _value) @classmethod def from_dict(cls, _dict: Dict) -> 'QueryNoticesResult': """Initialize a QueryNoticesResult object from a json dictionary.""" args = {} xtra = _dict.copy() if 'id' in _dict: args['id'] = _dict.get('id') del xtra['id'] if 'metadata' in _dict: args['metadata'] = _dict.get('metadata') del xtra['metadata'] if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') del xtra['collection_id'] if 'result_metadata' in _dict: args['result_metadata'] = QueryResultMetadata._from_dict( _dict.get('result_metadata')) del xtra['result_metadata'] if 'code' in _dict: args['code'] = _dict.get('code') del xtra['code'] if 'filename' in _dict: args['filename'] = _dict.get('filename') del xtra['filename'] if 'file_type' in _dict: args['file_type'] = _dict.get('file_type') del xtra['file_type'] if 'sha1' in _dict: args['sha1'] = _dict.get('sha1') del xtra['sha1'] if 'notices' in _dict: args['notices'] = [ Notice._from_dict(x) for x in (_dict.get('notices')) ] del xtra['notices'] args.update(xtra) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryNoticesResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'metadata') and self.metadata is not None: _dict['metadata'] = self.metadata if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'result_metadata') and self.result_metadata is not None: _dict['result_metadata'] = self.result_metadata._to_dict() if hasattr(self, 'code') and self.code is not None: _dict['code'] = self.code if hasattr(self, 'filename') and self.filename is not None: _dict['filename'] = self.filename if hasattr(self, 'file_type') and self.file_type is not None: _dict['file_type'] = self.file_type if hasattr(self, 'sha1') and self.sha1 is not None: _dict['sha1'] = self.sha1 if hasattr(self, 'notices') and self.notices is not None: _dict['notices'] = [x._to_dict() for x in self.notices] if hasattr(self, '_additionalProperties'): for _key in self._additionalProperties: _value = getattr(self, _key, None) if _value is not None: _dict[_key] = _value return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __setattr__(self, name: str, value: object) -> None: properties = { 'id', 'metadata', 'collection_id', 'result_metadata', 'code', 'filename', 'file_type', 'sha1', 'notices' } if not hasattr(self, '_additionalProperties'): super(QueryNoticesResult, self).__setattr__('_additionalProperties', set()) if name not in properties: self._additionalProperties.add(name) super(QueryNoticesResult, self).__setattr__(name, value) def __str__(self) -> str: """Return a `str` version of this QueryNoticesResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryNoticesResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryNoticesResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class FileTypeEnum(Enum): """ The type of the original source file. """ PDF = "pdf" HTML = "html" WORD = "word" JSON = "json" class QueryPassages(): """ A passage query result. :attr str document_id: (optional) The unique identifier of the document from which the passage has been extracted. :attr float passage_score: (optional) The confidence score of the passages's analysis. A higher score indicates greater confidence. :attr str passage_text: (optional) The content of the extracted passage. :attr int start_offset: (optional) The position of the first character of the extracted passage in the originating field. :attr int end_offset: (optional) The position of the last character of the extracted passage in the originating field. :attr str field: (optional) The label of the field from which the passage has been extracted. """ def __init__(self, *, document_id: str = None, passage_score: float = None, passage_text: str = None, start_offset: int = None, end_offset: int = None, field: str = None) -> None: """ Initialize a QueryPassages object. :param str document_id: (optional) The unique identifier of the document from which the passage has been extracted. :param float passage_score: (optional) The confidence score of the passages's analysis. A higher score indicates greater confidence. :param str passage_text: (optional) The content of the extracted passage. :param int start_offset: (optional) The position of the first character of the extracted passage in the originating field. :param int end_offset: (optional) The position of the last character of the extracted passage in the originating field. :param str field: (optional) The label of the field from which the passage has been extracted. """ self.document_id = document_id self.passage_score = passage_score self.passage_text = passage_text self.start_offset = start_offset self.end_offset = end_offset self.field = field @classmethod def from_dict(cls, _dict: Dict) -> 'QueryPassages': """Initialize a QueryPassages object from a json dictionary.""" args = {} valid_keys = [ 'document_id', 'passage_score', 'passage_text', 'start_offset', 'end_offset', 'field' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class QueryPassages: ' + ', '.join(bad_keys)) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'passage_score' in _dict: args['passage_score'] = _dict.get('passage_score') if 'passage_text' in _dict: args['passage_text'] = _dict.get('passage_text') if 'start_offset' in _dict: args['start_offset'] = _dict.get('start_offset') if 'end_offset' in _dict: args['end_offset'] = _dict.get('end_offset') if 'field' in _dict: args['field'] = _dict.get('field') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryPassages object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'passage_score') and self.passage_score is not None: _dict['passage_score'] = self.passage_score if hasattr(self, 'passage_text') and self.passage_text is not None: _dict['passage_text'] = self.passage_text if hasattr(self, 'start_offset') and self.start_offset is not None: _dict['start_offset'] = self.start_offset if hasattr(self, 'end_offset') and self.end_offset is not None: _dict['end_offset'] = self.end_offset if hasattr(self, 'field') and self.field is not None: _dict['field'] = self.field return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this QueryPassages object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryPassages') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryPassages') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class QueryResponse(): """ A response containing the documents and aggregations for the query. :attr int matching_results: (optional) The number of matching results for the query. :attr List[QueryResult] results: (optional) Array of document results for the query. :attr List[QueryAggregation] aggregations: (optional) Array of aggregation results for the query. :attr List[QueryPassages] passages: (optional) Array of passage results for the query. :attr int duplicates_removed: (optional) The number of duplicate results removed. :attr str session_token: (optional) The session token for this query. The session token can be used to add events associated with this query to the query and event log. **Important:** Session tokens are case sensitive. :attr RetrievalDetails retrieval_details: (optional) An object contain retrieval type information. :attr str suggested_query: (optional) The suggestions for a misspelled natural language query. """ def __init__(self, *, matching_results: int = None, results: List['QueryResult'] = None, aggregations: List['QueryAggregation'] = None, passages: List['QueryPassages'] = None, duplicates_removed: int = None, session_token: str = None, retrieval_details: 'RetrievalDetails' = None, suggested_query: str = None) -> None: """ Initialize a QueryResponse object. :param int matching_results: (optional) The number of matching results for the query. :param List[QueryResult] results: (optional) Array of document results for the query. :param List[QueryAggregation] aggregations: (optional) Array of aggregation results for the query. :param List[QueryPassages] passages: (optional) Array of passage results for the query. :param int duplicates_removed: (optional) The number of duplicate results removed. :param str session_token: (optional) The session token for this query. The session token can be used to add events associated with this query to the query and event log. **Important:** Session tokens are case sensitive. :param RetrievalDetails retrieval_details: (optional) An object contain retrieval type information. :param str suggested_query: (optional) The suggestions for a misspelled natural language query. """ self.matching_results = matching_results self.results = results self.aggregations = aggregations self.passages = passages self.duplicates_removed = duplicates_removed self.session_token = session_token self.retrieval_details = retrieval_details self.suggested_query = suggested_query @classmethod def from_dict(cls, _dict: Dict) -> 'QueryResponse': """Initialize a QueryResponse object from a json dictionary.""" args = {} valid_keys = [ 'matching_results', 'results', 'aggregations', 'passages', 'duplicates_removed', 'session_token', 'retrieval_details', 'suggested_query' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class QueryResponse: ' + ', '.join(bad_keys)) if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'results' in _dict: args['results'] = [ QueryResult._from_dict(x) for x in (_dict.get('results')) ] if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'passages' in _dict: args['passages'] = [ QueryPassages._from_dict(x) for x in (_dict.get('passages')) ] if 'duplicates_removed' in _dict: args['duplicates_removed'] = _dict.get('duplicates_removed') if 'session_token' in _dict: args['session_token'] = _dict.get('session_token') if 'retrieval_details' in _dict: args['retrieval_details'] = RetrievalDetails._from_dict( _dict.get('retrieval_details')) if 'suggested_query' in _dict: args['suggested_query'] = _dict.get('suggested_query') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'passages') and self.passages is not None: _dict['passages'] = [x._to_dict() for x in self.passages] if hasattr( self, 'duplicates_removed') and self.duplicates_removed is not None: _dict['duplicates_removed'] = self.duplicates_removed if hasattr(self, 'session_token') and self.session_token is not None: _dict['session_token'] = self.session_token if hasattr(self, 'retrieval_details') and self.retrieval_details is not None: _dict['retrieval_details'] = self.retrieval_details._to_dict() if hasattr(self, 'suggested_query') and self.suggested_query is not None: _dict['suggested_query'] = self.suggested_query return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this QueryResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class QueryResult(): """ Query result object. :attr str id: (optional) The unique identifier of the document. :attr dict metadata: (optional) Metadata of the document. :attr str collection_id: (optional) The collection ID of the collection containing the document for this result. :attr QueryResultMetadata result_metadata: (optional) Metadata of a query result. """ def __init__(self, *, id: str = None, metadata: dict = None, collection_id: str = None, result_metadata: 'QueryResultMetadata' = None, **kwargs) -> None: """ Initialize a QueryResult object. :param str id: (optional) The unique identifier of the document. :param dict metadata: (optional) Metadata of the document. :param str collection_id: (optional) The collection ID of the collection containing the document for this result. :param QueryResultMetadata result_metadata: (optional) Metadata of a query result. :param **kwargs: (optional) Any additional properties. """ self.id = id self.metadata = metadata self.collection_id = collection_id self.result_metadata = result_metadata for _key, _value in kwargs.items(): setattr(self, _key, _value) @classmethod def from_dict(cls, _dict: Dict) -> 'QueryResult': """Initialize a QueryResult object from a json dictionary.""" args = {} xtra = _dict.copy() if 'id' in _dict: args['id'] = _dict.get('id') del xtra['id'] if 'metadata' in _dict: args['metadata'] = _dict.get('metadata') del xtra['metadata'] if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') del xtra['collection_id'] if 'result_metadata' in _dict: args['result_metadata'] = QueryResultMetadata._from_dict( _dict.get('result_metadata')) del xtra['result_metadata'] args.update(xtra) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryResult object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'metadata') and self.metadata is not None: _dict['metadata'] = self.metadata if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'result_metadata') and self.result_metadata is not None: _dict['result_metadata'] = self.result_metadata._to_dict() if hasattr(self, '_additionalProperties'): for _key in self._additionalProperties: _value = getattr(self, _key, None) if _value is not None: _dict[_key] = _value return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __setattr__(self, name: str, value: object) -> None: properties = {'id', 'metadata', 'collection_id', 'result_metadata'} if not hasattr(self, '_additionalProperties'): super(QueryResult, self).__setattr__('_additionalProperties', set()) if name not in properties: self._additionalProperties.add(name) super(QueryResult, self).__setattr__(name, value) def __str__(self) -> str: """Return a `str` version of this QueryResult object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryResult') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryResult') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class QueryResultMetadata(): """ Metadata of a query result. :attr float score: An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters. :attr float confidence: (optional) The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from `0.0` to `1.0`. The higher the number, the more relevant the document. The `confidence` value for a result was calculated using the model specified in the `document_retrieval_strategy` field of the result set. """ def __init__(self, score: float, *, confidence: float = None) -> None: """ Initialize a QueryResultMetadata object. :param float score: An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters. :param float confidence: (optional) The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from `0.0` to `1.0`. The higher the number, the more relevant the document. The `confidence` value for a result was calculated using the model specified in the `document_retrieval_strategy` field of the result set. """ self.score = score self.confidence = confidence @classmethod def from_dict(cls, _dict: Dict) -> 'QueryResultMetadata': """Initialize a QueryResultMetadata object from a json dictionary.""" args = {} valid_keys = ['score', 'confidence'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class QueryResultMetadata: ' + ', '.join(bad_keys)) if 'score' in _dict: args['score'] = _dict.get('score') else: raise ValueError( 'Required property \'score\' not present in QueryResultMetadata JSON' ) if 'confidence' in _dict: args['confidence'] = _dict.get('confidence') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a QueryResultMetadata object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'score') and self.score is not None: _dict['score'] = self.score if hasattr(self, 'confidence') and self.confidence is not None: _dict['confidence'] = self.confidence return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this QueryResultMetadata object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'QueryResultMetadata') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'QueryResultMetadata') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class RetrievalDetails(): """ An object contain retrieval type information. :attr str document_retrieval_strategy: (optional) Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results were returned using a relevancy trained model. `continuous_relevancy_training` indicates that the results were returned using the continuous relevancy training model created by result feedback analysis. `untrained` means the results were returned using the standard untrained model. **Note**: In the event of trained collections being queried, but the trained model is not used to return results, the **document_retrieval_strategy** will be listed as `untrained`. """ def __init__(self, *, document_retrieval_strategy: str = None) -> None: """ Initialize a RetrievalDetails object. :param str document_retrieval_strategy: (optional) Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results were returned using a relevancy trained model. `continuous_relevancy_training` indicates that the results were returned using the continuous relevancy training model created by result feedback analysis. `untrained` means the results were returned using the standard untrained model. **Note**: In the event of trained collections being queried, but the trained model is not used to return results, the **document_retrieval_strategy** will be listed as `untrained`. """ self.document_retrieval_strategy = document_retrieval_strategy @classmethod def from_dict(cls, _dict: Dict) -> 'RetrievalDetails': """Initialize a RetrievalDetails object from a json dictionary.""" args = {} valid_keys = ['document_retrieval_strategy'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class RetrievalDetails: ' + ', '.join(bad_keys)) if 'document_retrieval_strategy' in _dict: args['document_retrieval_strategy'] = _dict.get( 'document_retrieval_strategy') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a RetrievalDetails object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document_retrieval_strategy' ) and self.document_retrieval_strategy is not None: _dict[ 'document_retrieval_strategy'] = self.document_retrieval_strategy return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this RetrievalDetails object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'RetrievalDetails') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'RetrievalDetails') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class DocumentRetrievalStrategyEnum(Enum): """ Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results were returned using a relevancy trained model. `continuous_relevancy_training` indicates that the results were returned using the continuous relevancy training model created by result feedback analysis. `untrained` means the results were returned using the standard untrained model. **Note**: In the event of trained collections being queried, but the trained model is not used to return results, the **document_retrieval_strategy** will be listed as `untrained`. """ UNTRAINED = "untrained" RELEVANCY_TRAINING = "relevancy_training" CONTINUOUS_RELEVANCY_TRAINING = "continuous_relevancy_training" class SduStatus(): """ Object containing smart document understanding information for this collection. :attr bool enabled: (optional) When `true`, smart document understanding conversion is enabled for this collection. All collections created with a version date after `2019-04-30` have smart document understanding enabled. If `false`, documents added to the collection are converted using the **conversion** settings specified in the configuration associated with the collection. :attr int total_annotated_pages: (optional) The total number of pages annotated using smart document understanding in this collection. :attr int total_pages: (optional) The current number of pages that can be used for training smart document understanding. The `total_pages` number is calculated as the total number of pages identified from the documents listed in the **total_documents** field. :attr int total_documents: (optional) The total number of documents in this collection that can be used to train smart document understanding. For **lite** plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding. :attr SduStatusCustomFields custom_fields: (optional) Information about custom smart document understanding fields that exist in this collection. """ def __init__(self, *, enabled: bool = None, total_annotated_pages: int = None, total_pages: int = None, total_documents: int = None, custom_fields: 'SduStatusCustomFields' = None) -> None: """ Initialize a SduStatus object. :param bool enabled: (optional) When `true`, smart document understanding conversion is enabled for this collection. All collections created with a version date after `2019-04-30` have smart document understanding enabled. If `false`, documents added to the collection are converted using the **conversion** settings specified in the configuration associated with the collection. :param int total_annotated_pages: (optional) The total number of pages annotated using smart document understanding in this collection. :param int total_pages: (optional) The current number of pages that can be used for training smart document understanding. The `total_pages` number is calculated as the total number of pages identified from the documents listed in the **total_documents** field. :param int total_documents: (optional) The total number of documents in this collection that can be used to train smart document understanding. For **lite** plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding. :param SduStatusCustomFields custom_fields: (optional) Information about custom smart document understanding fields that exist in this collection. """ self.enabled = enabled self.total_annotated_pages = total_annotated_pages self.total_pages = total_pages self.total_documents = total_documents self.custom_fields = custom_fields @classmethod def from_dict(cls, _dict: Dict) -> 'SduStatus': """Initialize a SduStatus object from a json dictionary.""" args = {} valid_keys = [ 'enabled', 'total_annotated_pages', 'total_pages', 'total_documents', 'custom_fields' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SduStatus: ' + ', '.join(bad_keys)) if 'enabled' in _dict: args['enabled'] = _dict.get('enabled') if 'total_annotated_pages' in _dict: args['total_annotated_pages'] = _dict.get('total_annotated_pages') if 'total_pages' in _dict: args['total_pages'] = _dict.get('total_pages') if 'total_documents' in _dict: args['total_documents'] = _dict.get('total_documents') if 'custom_fields' in _dict: args['custom_fields'] = SduStatusCustomFields._from_dict( _dict.get('custom_fields')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SduStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'enabled') and self.enabled is not None: _dict['enabled'] = self.enabled if hasattr(self, 'total_annotated_pages' ) and self.total_annotated_pages is not None: _dict['total_annotated_pages'] = self.total_annotated_pages if hasattr(self, 'total_pages') and self.total_pages is not None: _dict['total_pages'] = self.total_pages if hasattr(self, 'total_documents') and self.total_documents is not None: _dict['total_documents'] = self.total_documents if hasattr(self, 'custom_fields') and self.custom_fields is not None: _dict['custom_fields'] = self.custom_fields._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SduStatus object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SduStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SduStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SduStatusCustomFields(): """ Information about custom smart document understanding fields that exist in this collection. :attr int defined: (optional) The number of custom fields defined for this collection. :attr int maximum_allowed: (optional) The maximum number of custom fields that are allowed in this collection. """ def __init__(self, *, defined: int = None, maximum_allowed: int = None) -> None: """ Initialize a SduStatusCustomFields object. :param int defined: (optional) The number of custom fields defined for this collection. :param int maximum_allowed: (optional) The maximum number of custom fields that are allowed in this collection. """ self.defined = defined self.maximum_allowed = maximum_allowed @classmethod def from_dict(cls, _dict: Dict) -> 'SduStatusCustomFields': """Initialize a SduStatusCustomFields object from a json dictionary.""" args = {} valid_keys = ['defined', 'maximum_allowed'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SduStatusCustomFields: ' + ', '.join(bad_keys)) if 'defined' in _dict: args['defined'] = _dict.get('defined') if 'maximum_allowed' in _dict: args['maximum_allowed'] = _dict.get('maximum_allowed') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SduStatusCustomFields object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'defined') and self.defined is not None: _dict['defined'] = self.defined if hasattr(self, 'maximum_allowed') and self.maximum_allowed is not None: _dict['maximum_allowed'] = self.maximum_allowed return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SduStatusCustomFields object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SduStatusCustomFields') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SduStatusCustomFields') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SearchStatus(): """ Information about the Continuous Relevancy Training for this environment. :attr str scope: (optional) Current scope of the training. Always returned as `environment`. :attr str status: (optional) The current status of Continuous Relevancy Training for this environment. :attr str status_description: (optional) Long description of the current Continuous Relevancy Training status. :attr date last_trained: (optional) The date stamp of the most recent completed training for this environment. """ def __init__(self, *, scope: str = None, status: str = None, status_description: str = None, last_trained: date = None) -> None: """ Initialize a SearchStatus object. :param str scope: (optional) Current scope of the training. Always returned as `environment`. :param str status: (optional) The current status of Continuous Relevancy Training for this environment. :param str status_description: (optional) Long description of the current Continuous Relevancy Training status. :param date last_trained: (optional) The date stamp of the most recent completed training for this environment. """ self.scope = scope self.status = status self.status_description = status_description self.last_trained = last_trained @classmethod def from_dict(cls, _dict: Dict) -> 'SearchStatus': """Initialize a SearchStatus object from a json dictionary.""" args = {} valid_keys = ['scope', 'status', 'status_description', 'last_trained'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SearchStatus: ' + ', '.join(bad_keys)) if 'scope' in _dict: args['scope'] = _dict.get('scope') if 'status' in _dict: args['status'] = _dict.get('status') if 'status_description' in _dict: args['status_description'] = _dict.get('status_description') if 'last_trained' in _dict: args['last_trained'] = _dict.get('last_trained') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SearchStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'scope') and self.scope is not None: _dict['scope'] = self.scope if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr( self, 'status_description') and self.status_description is not None: _dict['status_description'] = self.status_description if hasattr(self, 'last_trained') and self.last_trained is not None: _dict['last_trained'] = self.last_trained return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SearchStatus object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SearchStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SearchStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ The current status of Continuous Relevancy Training for this environment. """ NO_DATA = "NO_DATA" INSUFFICENT_DATA = "INSUFFICENT_DATA" TRAINING = "TRAINING" TRAINED = "TRAINED" NOT_APPLICABLE = "NOT_APPLICABLE" class SegmentSettings(): """ A list of Document Segmentation settings. :attr bool enabled: (optional) Enables/disables the Document Segmentation feature. :attr List[str] selector_tags: (optional) Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the **title** field for that segmented result. Only valid if used with a collection that has **enabled** set to `false` in the **smart_document_understanding** object. :attr List[str] annotated_fields: (optional) Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the **title** field for that segmented result. For example, if the field `sub-title` is specified, when a document is uploaded each time the smart documement understanding conversion encounters a field of type `sub-title` the document is split at that point and the content of the field used as the title of the remaining content. Thnis split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has **enabled** set to `true` in the **smart_document_understanding** object. """ def __init__(self, *, enabled: bool = None, selector_tags: List[str] = None, annotated_fields: List[str] = None) -> None: """ Initialize a SegmentSettings object. :param bool enabled: (optional) Enables/disables the Document Segmentation feature. :param List[str] selector_tags: (optional) Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the **title** field for that segmented result. Only valid if used with a collection that has **enabled** set to `false` in the **smart_document_understanding** object. :param List[str] annotated_fields: (optional) Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the **title** field for that segmented result. For example, if the field `sub-title` is specified, when a document is uploaded each time the smart documement understanding conversion encounters a field of type `sub-title` the document is split at that point and the content of the field used as the title of the remaining content. Thnis split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has **enabled** set to `true` in the **smart_document_understanding** object. """ self.enabled = enabled self.selector_tags = selector_tags self.annotated_fields = annotated_fields @classmethod def from_dict(cls, _dict: Dict) -> 'SegmentSettings': """Initialize a SegmentSettings object from a json dictionary.""" args = {} valid_keys = ['enabled', 'selector_tags', 'annotated_fields'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SegmentSettings: ' + ', '.join(bad_keys)) if 'enabled' in _dict: args['enabled'] = _dict.get('enabled') if 'selector_tags' in _dict: args['selector_tags'] = _dict.get('selector_tags') if 'annotated_fields' in _dict: args['annotated_fields'] = _dict.get('annotated_fields') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SegmentSettings object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'enabled') and self.enabled is not None: _dict['enabled'] = self.enabled if hasattr(self, 'selector_tags') and self.selector_tags is not None: _dict['selector_tags'] = self.selector_tags if hasattr(self, 'annotated_fields') and self.annotated_fields is not None: _dict['annotated_fields'] = self.annotated_fields return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SegmentSettings object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SegmentSettings') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SegmentSettings') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Source(): """ Object containing source parameters for the configuration. :attr str type: (optional) The type of source to connect to. - `box` indicates the configuration is to connect an instance of Enterprise Box. - `salesforce` indicates the configuration is to connect to Salesforce. - `sharepoint` indicates the configuration is to connect to Microsoft SharePoint Online. - `web_crawl` indicates the configuration is to perform a web page crawl. - `cloud_object_storage` indicates the configuration is to connect to a cloud object store. :attr str credential_id: (optional) The **credential_id** of the credentials to use to connect to the source. Credentials are defined using the **credentials** method. The **source_type** of the credentials used must match the **type** field specified in this object. :attr SourceSchedule schedule: (optional) Object containing the schedule information for the source. :attr SourceOptions options: (optional) The **options** object defines which items to crawl from the source system. """ def __init__(self, *, type: str = None, credential_id: str = None, schedule: 'SourceSchedule' = None, options: 'SourceOptions' = None) -> None: """ Initialize a Source object. :param str type: (optional) The type of source to connect to. - `box` indicates the configuration is to connect an instance of Enterprise Box. - `salesforce` indicates the configuration is to connect to Salesforce. - `sharepoint` indicates the configuration is to connect to Microsoft SharePoint Online. - `web_crawl` indicates the configuration is to perform a web page crawl. - `cloud_object_storage` indicates the configuration is to connect to a cloud object store. :param str credential_id: (optional) The **credential_id** of the credentials to use to connect to the source. Credentials are defined using the **credentials** method. The **source_type** of the credentials used must match the **type** field specified in this object. :param SourceSchedule schedule: (optional) Object containing the schedule information for the source. :param SourceOptions options: (optional) The **options** object defines which items to crawl from the source system. """ self.type = type self.credential_id = credential_id self.schedule = schedule self.options = options @classmethod def from_dict(cls, _dict: Dict) -> 'Source': """Initialize a Source object from a json dictionary.""" args = {} valid_keys = ['type', 'credential_id', 'schedule', 'options'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Source: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'credential_id' in _dict: args['credential_id'] = _dict.get('credential_id') if 'schedule' in _dict: args['schedule'] = SourceSchedule._from_dict(_dict.get('schedule')) if 'options' in _dict: args['options'] = SourceOptions._from_dict(_dict.get('options')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Source object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'credential_id') and self.credential_id is not None: _dict['credential_id'] = self.credential_id if hasattr(self, 'schedule') and self.schedule is not None: _dict['schedule'] = self.schedule._to_dict() if hasattr(self, 'options') and self.options is not None: _dict['options'] = self.options._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Source object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Source') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Source') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TypeEnum(Enum): """ The type of source to connect to. - `box` indicates the configuration is to connect an instance of Enterprise Box. - `salesforce` indicates the configuration is to connect to Salesforce. - `sharepoint` indicates the configuration is to connect to Microsoft SharePoint Online. - `web_crawl` indicates the configuration is to perform a web page crawl. - `cloud_object_storage` indicates the configuration is to connect to a cloud object store. """ BOX = "box" SALESFORCE = "salesforce" SHAREPOINT = "sharepoint" WEB_CRAWL = "web_crawl" CLOUD_OBJECT_STORAGE = "cloud_object_storage" class SourceOptions(): """ The **options** object defines which items to crawl from the source system. :attr List[SourceOptionsFolder] folders: (optional) Array of folders to crawl from the Box source. Only valid, and required, when the **type** field of the **source** object is set to `box`. :attr List[SourceOptionsObject] objects: (optional) Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the **type** field of the **source** object is set to `salesforce`. :attr List[SourceOptionsSiteColl] site_collections: (optional) Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the **type** field of the **source** object is set to `sharepoint`. :attr List[SourceOptionsWebCrawl] urls: (optional) Array of Web page URLs to begin crawling the web from. Only valid and required when the **type** field of the **source** object is set to `web_crawl`. :attr List[SourceOptionsBuckets] buckets: (optional) Array of cloud object store buckets to begin crawling. Only valid and required when the **type** field of the **source** object is set to `cloud_object_store`, and the **crawl_all_buckets** field is `false` or not specified. :attr bool crawl_all_buckets: (optional) When `true`, all buckets in the specified cloud object store are crawled. If set to `true`, the **buckets** array must not be specified. """ def __init__(self, *, folders: List['SourceOptionsFolder'] = None, objects: List['SourceOptionsObject'] = None, site_collections: List['SourceOptionsSiteColl'] = None, urls: List['SourceOptionsWebCrawl'] = None, buckets: List['SourceOptionsBuckets'] = None, crawl_all_buckets: bool = None) -> None: """ Initialize a SourceOptions object. :param List[SourceOptionsFolder] folders: (optional) Array of folders to crawl from the Box source. Only valid, and required, when the **type** field of the **source** object is set to `box`. :param List[SourceOptionsObject] objects: (optional) Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the **type** field of the **source** object is set to `salesforce`. :param List[SourceOptionsSiteColl] site_collections: (optional) Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the **type** field of the **source** object is set to `sharepoint`. :param List[SourceOptionsWebCrawl] urls: (optional) Array of Web page URLs to begin crawling the web from. Only valid and required when the **type** field of the **source** object is set to `web_crawl`. :param List[SourceOptionsBuckets] buckets: (optional) Array of cloud object store buckets to begin crawling. Only valid and required when the **type** field of the **source** object is set to `cloud_object_store`, and the **crawl_all_buckets** field is `false` or not specified. :param bool crawl_all_buckets: (optional) When `true`, all buckets in the specified cloud object store are crawled. If set to `true`, the **buckets** array must not be specified. """ self.folders = folders self.objects = objects self.site_collections = site_collections self.urls = urls self.buckets = buckets self.crawl_all_buckets = crawl_all_buckets @classmethod def from_dict(cls, _dict: Dict) -> 'SourceOptions': """Initialize a SourceOptions object from a json dictionary.""" args = {} valid_keys = [ 'folders', 'objects', 'site_collections', 'urls', 'buckets', 'crawl_all_buckets' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceOptions: ' + ', '.join(bad_keys)) if 'folders' in _dict: args['folders'] = [ SourceOptionsFolder._from_dict(x) for x in (_dict.get('folders')) ] if 'objects' in _dict: args['objects'] = [ SourceOptionsObject._from_dict(x) for x in (_dict.get('objects')) ] if 'site_collections' in _dict: args['site_collections'] = [ SourceOptionsSiteColl._from_dict(x) for x in (_dict.get('site_collections')) ] if 'urls' in _dict: args['urls'] = [ SourceOptionsWebCrawl._from_dict(x) for x in (_dict.get('urls')) ] if 'buckets' in _dict: args['buckets'] = [ SourceOptionsBuckets._from_dict(x) for x in (_dict.get('buckets')) ] if 'crawl_all_buckets' in _dict: args['crawl_all_buckets'] = _dict.get('crawl_all_buckets') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceOptions object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'folders') and self.folders is not None: _dict['folders'] = [x._to_dict() for x in self.folders] if hasattr(self, 'objects') and self.objects is not None: _dict['objects'] = [x._to_dict() for x in self.objects] if hasattr(self, 'site_collections') and self.site_collections is not None: _dict['site_collections'] = [ x._to_dict() for x in self.site_collections ] if hasattr(self, 'urls') and self.urls is not None: _dict['urls'] = [x._to_dict() for x in self.urls] if hasattr(self, 'buckets') and self.buckets is not None: _dict['buckets'] = [x._to_dict() for x in self.buckets] if hasattr(self, 'crawl_all_buckets') and self.crawl_all_buckets is not None: _dict['crawl_all_buckets'] = self.crawl_all_buckets return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceOptions object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceOptions') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceOptions') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SourceOptionsBuckets(): """ Object defining a cloud object store bucket to crawl. :attr str name: The name of the cloud object store bucket to crawl. :attr int limit: (optional) The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled. """ def __init__(self, name: str, *, limit: int = None) -> None: """ Initialize a SourceOptionsBuckets object. :param str name: The name of the cloud object store bucket to crawl. :param int limit: (optional) The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled. """ self.name = name self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'SourceOptionsBuckets': """Initialize a SourceOptionsBuckets object from a json dictionary.""" args = {} valid_keys = ['name', 'limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceOptionsBuckets: ' + ', '.join(bad_keys)) if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( 'Required property \'name\' not present in SourceOptionsBuckets JSON' ) if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceOptionsBuckets object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceOptionsBuckets object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceOptionsBuckets') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceOptionsBuckets') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SourceOptionsFolder(): """ Object that defines a box folder to crawl with this configuration. :attr str owner_user_id: The Box user ID of the user who owns the folder to crawl. :attr str folder_id: The Box folder ID of the folder to crawl. :attr int limit: (optional) The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled. """ def __init__(self, owner_user_id: str, folder_id: str, *, limit: int = None) -> None: """ Initialize a SourceOptionsFolder object. :param str owner_user_id: The Box user ID of the user who owns the folder to crawl. :param str folder_id: The Box folder ID of the folder to crawl. :param int limit: (optional) The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled. """ self.owner_user_id = owner_user_id self.folder_id = folder_id self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'SourceOptionsFolder': """Initialize a SourceOptionsFolder object from a json dictionary.""" args = {} valid_keys = ['owner_user_id', 'folder_id', 'limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceOptionsFolder: ' + ', '.join(bad_keys)) if 'owner_user_id' in _dict: args['owner_user_id'] = _dict.get('owner_user_id') else: raise ValueError( 'Required property \'owner_user_id\' not present in SourceOptionsFolder JSON' ) if 'folder_id' in _dict: args['folder_id'] = _dict.get('folder_id') else: raise ValueError( 'Required property \'folder_id\' not present in SourceOptionsFolder JSON' ) if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceOptionsFolder object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'owner_user_id') and self.owner_user_id is not None: _dict['owner_user_id'] = self.owner_user_id if hasattr(self, 'folder_id') and self.folder_id is not None: _dict['folder_id'] = self.folder_id if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceOptionsFolder object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceOptionsFolder') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceOptionsFolder') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SourceOptionsObject(): """ Object that defines a Salesforce document object type crawl with this configuration. :attr str name: The name of the Salesforce document object to crawl. For example, `case`. :attr int limit: (optional) The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled. """ def __init__(self, name: str, *, limit: int = None) -> None: """ Initialize a SourceOptionsObject object. :param str name: The name of the Salesforce document object to crawl. For example, `case`. :param int limit: (optional) The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled. """ self.name = name self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'SourceOptionsObject': """Initialize a SourceOptionsObject object from a json dictionary.""" args = {} valid_keys = ['name', 'limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceOptionsObject: ' + ', '.join(bad_keys)) if 'name' in _dict: args['name'] = _dict.get('name') else: raise ValueError( 'Required property \'name\' not present in SourceOptionsObject JSON' ) if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceOptionsObject object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceOptionsObject object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceOptionsObject') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceOptionsObject') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SourceOptionsSiteColl(): """ Object that defines a Microsoft SharePoint site collection to crawl with this configuration. :attr str site_collection_path: The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the **organization_url** that was specified in the credentials associated with this source configuration. :attr int limit: (optional) The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled. """ def __init__(self, site_collection_path: str, *, limit: int = None) -> None: """ Initialize a SourceOptionsSiteColl object. :param str site_collection_path: The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the **organization_url** that was specified in the credentials associated with this source configuration. :param int limit: (optional) The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled. """ self.site_collection_path = site_collection_path self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'SourceOptionsSiteColl': """Initialize a SourceOptionsSiteColl object from a json dictionary.""" args = {} valid_keys = ['site_collection_path', 'limit'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceOptionsSiteColl: ' + ', '.join(bad_keys)) if 'site_collection_path' in _dict: args['site_collection_path'] = _dict.get('site_collection_path') else: raise ValueError( 'Required property \'site_collection_path\' not present in SourceOptionsSiteColl JSON' ) if 'limit' in _dict: args['limit'] = _dict.get('limit') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceOptionsSiteColl object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'site_collection_path' ) and self.site_collection_path is not None: _dict['site_collection_path'] = self.site_collection_path if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceOptionsSiteColl object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceOptionsSiteColl') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceOptionsSiteColl') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class SourceOptionsWebCrawl(): """ Object defining which URL to crawl and how to crawl it. :attr str url: The starting URL to crawl. :attr bool limit_to_starting_hosts: (optional) When `true`, crawls of the specified URL are limited to the host part of the **url** field. :attr str crawl_speed: (optional) The number of concurrent URLs to fetch. `gentle` means one URL is fetched at a time with a delay between each call. `normal` means as many as two URLs are fectched concurrently with a short delay between fetch calls. `aggressive` means that up to ten URLs are fetched concurrently with a short delay between fetch calls. :attr bool allow_untrusted_certificate: (optional) When `true`, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers. :attr int maximum_hops: (optional) The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the **maximum_hops** from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on. :attr int request_timeout: (optional) The maximum milliseconds to wait for a response from the web server. :attr bool override_robots_txt: (optional) When `true`, the crawler will ignore any `robots.txt` encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set to `true` when a **gateway_id** is specied in the **credentials**. :attr List[str] blacklist: (optional) Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing `https://ibm.com/watson` also excludes `https://ibm.com/watson/discovery`. """ def __init__(self, url: str, *, limit_to_starting_hosts: bool = None, crawl_speed: str = None, allow_untrusted_certificate: bool = None, maximum_hops: int = None, request_timeout: int = None, override_robots_txt: bool = None, blacklist: List[str] = None) -> None: """ Initialize a SourceOptionsWebCrawl object. :param str url: The starting URL to crawl. :param bool limit_to_starting_hosts: (optional) When `true`, crawls of the specified URL are limited to the host part of the **url** field. :param str crawl_speed: (optional) The number of concurrent URLs to fetch. `gentle` means one URL is fetched at a time with a delay between each call. `normal` means as many as two URLs are fectched concurrently with a short delay between fetch calls. `aggressive` means that up to ten URLs are fetched concurrently with a short delay between fetch calls. :param bool allow_untrusted_certificate: (optional) When `true`, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers. :param int maximum_hops: (optional) The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the **maximum_hops** from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on. :param int request_timeout: (optional) The maximum milliseconds to wait for a response from the web server. :param bool override_robots_txt: (optional) When `true`, the crawler will ignore any `robots.txt` encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set to `true` when a **gateway_id** is specied in the **credentials**. :param List[str] blacklist: (optional) Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing `https://ibm.com/watson` also excludes `https://ibm.com/watson/discovery`. """ self.url = url self.limit_to_starting_hosts = limit_to_starting_hosts self.crawl_speed = crawl_speed self.allow_untrusted_certificate = allow_untrusted_certificate self.maximum_hops = maximum_hops self.request_timeout = request_timeout self.override_robots_txt = override_robots_txt self.blacklist = blacklist @classmethod def from_dict(cls, _dict: Dict) -> 'SourceOptionsWebCrawl': """Initialize a SourceOptionsWebCrawl object from a json dictionary.""" args = {} valid_keys = [ 'url', 'limit_to_starting_hosts', 'crawl_speed', 'allow_untrusted_certificate', 'maximum_hops', 'request_timeout', 'override_robots_txt', 'blacklist' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceOptionsWebCrawl: ' + ', '.join(bad_keys)) if 'url' in _dict: args['url'] = _dict.get('url') else: raise ValueError( 'Required property \'url\' not present in SourceOptionsWebCrawl JSON' ) if 'limit_to_starting_hosts' in _dict: args['limit_to_starting_hosts'] = _dict.get( 'limit_to_starting_hosts') if 'crawl_speed' in _dict: args['crawl_speed'] = _dict.get('crawl_speed') if 'allow_untrusted_certificate' in _dict: args['allow_untrusted_certificate'] = _dict.get( 'allow_untrusted_certificate') if 'maximum_hops' in _dict: args['maximum_hops'] = _dict.get('maximum_hops') if 'request_timeout' in _dict: args['request_timeout'] = _dict.get('request_timeout') if 'override_robots_txt' in _dict: args['override_robots_txt'] = _dict.get('override_robots_txt') if 'blacklist' in _dict: args['blacklist'] = _dict.get('blacklist') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceOptionsWebCrawl object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url if hasattr(self, 'limit_to_starting_hosts' ) and self.limit_to_starting_hosts is not None: _dict['limit_to_starting_hosts'] = self.limit_to_starting_hosts if hasattr(self, 'crawl_speed') and self.crawl_speed is not None: _dict['crawl_speed'] = self.crawl_speed if hasattr(self, 'allow_untrusted_certificate' ) and self.allow_untrusted_certificate is not None: _dict[ 'allow_untrusted_certificate'] = self.allow_untrusted_certificate if hasattr(self, 'maximum_hops') and self.maximum_hops is not None: _dict['maximum_hops'] = self.maximum_hops if hasattr(self, 'request_timeout') and self.request_timeout is not None: _dict['request_timeout'] = self.request_timeout if hasattr( self, 'override_robots_txt') and self.override_robots_txt is not None: _dict['override_robots_txt'] = self.override_robots_txt if hasattr(self, 'blacklist') and self.blacklist is not None: _dict['blacklist'] = self.blacklist return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceOptionsWebCrawl object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceOptionsWebCrawl') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceOptionsWebCrawl') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class CrawlSpeedEnum(Enum): """ The number of concurrent URLs to fetch. `gentle` means one URL is fetched at a time with a delay between each call. `normal` means as many as two URLs are fectched concurrently with a short delay between fetch calls. `aggressive` means that up to ten URLs are fetched concurrently with a short delay between fetch calls. """ GENTLE = "gentle" NORMAL = "normal" AGGRESSIVE = "aggressive" class SourceSchedule(): """ Object containing the schedule information for the source. :attr bool enabled: (optional) When `true`, the source is re-crawled based on the **frequency** field in this object. When `false` the source is not re-crawled; When `false` and connecting to Salesforce the source is crawled annually. :attr str time_zone: (optional) The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list. :attr str frequency: (optional) The crawl schedule in the specified **time_zone**. - `five_minutes`: Runs every five minutes. - `hourly`: Runs every hour. - `daily`: Runs every day between 00:00 and 06:00. - `weekly`: Runs every week on Sunday between 00:00 and 06:00. - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. """ def __init__(self, *, enabled: bool = None, time_zone: str = None, frequency: str = None) -> None: """ Initialize a SourceSchedule object. :param bool enabled: (optional) When `true`, the source is re-crawled based on the **frequency** field in this object. When `false` the source is not re-crawled; When `false` and connecting to Salesforce the source is crawled annually. :param str time_zone: (optional) The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list. :param str frequency: (optional) The crawl schedule in the specified **time_zone**. - `five_minutes`: Runs every five minutes. - `hourly`: Runs every hour. - `daily`: Runs every day between 00:00 and 06:00. - `weekly`: Runs every week on Sunday between 00:00 and 06:00. - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. """ self.enabled = enabled self.time_zone = time_zone self.frequency = frequency @classmethod def from_dict(cls, _dict: Dict) -> 'SourceSchedule': """Initialize a SourceSchedule object from a json dictionary.""" args = {} valid_keys = ['enabled', 'time_zone', 'frequency'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceSchedule: ' + ', '.join(bad_keys)) if 'enabled' in _dict: args['enabled'] = _dict.get('enabled') if 'time_zone' in _dict: args['time_zone'] = _dict.get('time_zone') if 'frequency' in _dict: args['frequency'] = _dict.get('frequency') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceSchedule object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'enabled') and self.enabled is not None: _dict['enabled'] = self.enabled if hasattr(self, 'time_zone') and self.time_zone is not None: _dict['time_zone'] = self.time_zone if hasattr(self, 'frequency') and self.frequency is not None: _dict['frequency'] = self.frequency return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceSchedule object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceSchedule') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceSchedule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class FrequencyEnum(Enum): """ The crawl schedule in the specified **time_zone**. - `five_minutes`: Runs every five minutes. - `hourly`: Runs every hour. - `daily`: Runs every day between 00:00 and 06:00. - `weekly`: Runs every week on Sunday between 00:00 and 06:00. - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. """ DAILY = "daily" WEEKLY = "weekly" MONTHLY = "monthly" FIVE_MINUTES = "five_minutes" HOURLY = "hourly" class SourceStatus(): """ Object containing source crawl status information. :attr str status: (optional) The current status of the source crawl for this collection. This field returns `not_configured` if the default configuration for this source does not have a **source** object defined. - `running` indicates that a crawl to fetch more documents is in progress. - `complete` indicates that the crawl has completed with no errors. - `queued` indicates that the crawl has been paused by the system and will automatically restart when possible. - `unknown` indicates that an unidentified error has occured in the service. :attr datetime next_crawl: (optional) Date in `RFC 3339` format indicating the time of the next crawl attempt. """ def __init__(self, *, status: str = None, next_crawl: datetime = None) -> None: """ Initialize a SourceStatus object. :param str status: (optional) The current status of the source crawl for this collection. This field returns `not_configured` if the default configuration for this source does not have a **source** object defined. - `running` indicates that a crawl to fetch more documents is in progress. - `complete` indicates that the crawl has completed with no errors. - `queued` indicates that the crawl has been paused by the system and will automatically restart when possible. - `unknown` indicates that an unidentified error has occured in the service. :param datetime next_crawl: (optional) Date in `RFC 3339` format indicating the time of the next crawl attempt. """ self.status = status self.next_crawl = next_crawl @classmethod def from_dict(cls, _dict: Dict) -> 'SourceStatus': """Initialize a SourceStatus object from a json dictionary.""" args = {} valid_keys = ['status', 'next_crawl'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class SourceStatus: ' + ', '.join(bad_keys)) if 'status' in _dict: args['status'] = _dict.get('status') if 'next_crawl' in _dict: args['next_crawl'] = string_to_datetime(_dict.get('next_crawl')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a SourceStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'next_crawl') and self.next_crawl is not None: _dict['next_crawl'] = datetime_to_string(self.next_crawl) return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this SourceStatus object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'SourceStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'SourceStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ The current status of the source crawl for this collection. This field returns `not_configured` if the default configuration for this source does not have a **source** object defined. - `running` indicates that a crawl to fetch more documents is in progress. - `complete` indicates that the crawl has completed with no errors. - `queued` indicates that the crawl has been paused by the system and will automatically restart when possible. - `unknown` indicates that an unidentified error has occured in the service. """ RUNNING = "running" COMPLETE = "complete" NOT_CONFIGURED = "not_configured" QUEUED = "queued" UNKNOWN = "unknown" class TokenDictRule(): """ An object defining a single tokenizaion rule. :attr str text: The string to tokenize. :attr List[str] tokens: Array of tokens that the `text` field is split into when found. :attr List[str] readings: (optional) Array of tokens that represent the content of the `text` field in an alternate character set. :attr str part_of_speech: The part of speech that the `text` string belongs to. For example `noun`. Custom parts of speech can be specified. """ def __init__(self, text: str, tokens: List[str], part_of_speech: str, *, readings: List[str] = None) -> None: """ Initialize a TokenDictRule object. :param str text: The string to tokenize. :param List[str] tokens: Array of tokens that the `text` field is split into when found. :param str part_of_speech: The part of speech that the `text` string belongs to. For example `noun`. Custom parts of speech can be specified. :param List[str] readings: (optional) Array of tokens that represent the content of the `text` field in an alternate character set. """ self.text = text self.tokens = tokens self.readings = readings self.part_of_speech = part_of_speech @classmethod def from_dict(cls, _dict: Dict) -> 'TokenDictRule': """Initialize a TokenDictRule object from a json dictionary.""" args = {} valid_keys = ['text', 'tokens', 'readings', 'part_of_speech'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TokenDictRule: ' + ', '.join(bad_keys)) if 'text' in _dict: args['text'] = _dict.get('text') else: raise ValueError( 'Required property \'text\' not present in TokenDictRule JSON') if 'tokens' in _dict: args['tokens'] = _dict.get('tokens') else: raise ValueError( 'Required property \'tokens\' not present in TokenDictRule JSON' ) if 'readings' in _dict: args['readings'] = _dict.get('readings') if 'part_of_speech' in _dict: args['part_of_speech'] = _dict.get('part_of_speech') else: raise ValueError( 'Required property \'part_of_speech\' not present in TokenDictRule JSON' ) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TokenDictRule object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'text') and self.text is not None: _dict['text'] = self.text if hasattr(self, 'tokens') and self.tokens is not None: _dict['tokens'] = self.tokens if hasattr(self, 'readings') and self.readings is not None: _dict['readings'] = self.readings if hasattr(self, 'part_of_speech') and self.part_of_speech is not None: _dict['part_of_speech'] = self.part_of_speech return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TokenDictRule object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TokenDictRule') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TokenDictRule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TokenDictStatusResponse(): """ Object describing the current status of the wordlist. :attr str status: (optional) Current wordlist status for the specified collection. :attr str type: (optional) The type for this wordlist. Can be `tokenization_dictionary` or `stopwords`. """ def __init__(self, *, status: str = None, type: str = None) -> None: """ Initialize a TokenDictStatusResponse object. :param str status: (optional) Current wordlist status for the specified collection. :param str type: (optional) The type for this wordlist. Can be `tokenization_dictionary` or `stopwords`. """ self.status = status self.type = type @classmethod def from_dict(cls, _dict: Dict) -> 'TokenDictStatusResponse': """Initialize a TokenDictStatusResponse object from a json dictionary.""" args = {} valid_keys = ['status', 'type'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TokenDictStatusResponse: ' + ', '.join(bad_keys)) if 'status' in _dict: args['status'] = _dict.get('status') if 'type' in _dict: args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TokenDictStatusResponse object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TokenDictStatusResponse object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TokenDictStatusResponse') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TokenDictStatusResponse') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(Enum): """ Current wordlist status for the specified collection. """ ACTIVE = "active" PENDING = "pending" NOT_FOUND = "not found" class TopHitsResults(): """ Top hit information for this query. :attr int matching_results: (optional) Number of matching results. :attr List[QueryResult] hits: (optional) Top results returned by the aggregation. """ def __init__(self, *, matching_results: int = None, hits: List['QueryResult'] = None) -> None: """ Initialize a TopHitsResults object. :param int matching_results: (optional) Number of matching results. :param List[QueryResult] hits: (optional) Top results returned by the aggregation. """ self.matching_results = matching_results self.hits = hits @classmethod def from_dict(cls, _dict: Dict) -> 'TopHitsResults': """Initialize a TopHitsResults object from a json dictionary.""" args = {} valid_keys = ['matching_results', 'hits'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TopHitsResults: ' + ', '.join(bad_keys)) if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'hits' in _dict: args['hits'] = [ QueryResult._from_dict(x) for x in (_dict.get('hits')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TopHitsResults object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'hits') and self.hits is not None: _dict['hits'] = [x._to_dict() for x in self.hits] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TopHitsResults object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TopHitsResults') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TopHitsResults') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TrainingDataSet(): """ Training information for a specific collection. :attr str environment_id: (optional) The environment id associated with this training data set. :attr str collection_id: (optional) The collection id associated with this training data set. :attr List[TrainingQuery] queries: (optional) Array of training queries. """ def __init__(self, *, environment_id: str = None, collection_id: str = None, queries: List['TrainingQuery'] = None) -> None: """ Initialize a TrainingDataSet object. :param str environment_id: (optional) The environment id associated with this training data set. :param str collection_id: (optional) The collection id associated with this training data set. :param List[TrainingQuery] queries: (optional) Array of training queries. """ self.environment_id = environment_id self.collection_id = collection_id self.queries = queries @classmethod def from_dict(cls, _dict: Dict) -> 'TrainingDataSet': """Initialize a TrainingDataSet object from a json dictionary.""" args = {} valid_keys = ['environment_id', 'collection_id', 'queries'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TrainingDataSet: ' + ', '.join(bad_keys)) if 'environment_id' in _dict: args['environment_id'] = _dict.get('environment_id') if 'collection_id' in _dict: args['collection_id'] = _dict.get('collection_id') if 'queries' in _dict: args['queries'] = [ TrainingQuery._from_dict(x) for x in (_dict.get('queries')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TrainingDataSet object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environment_id') and self.environment_id is not None: _dict['environment_id'] = self.environment_id if hasattr(self, 'collection_id') and self.collection_id is not None: _dict['collection_id'] = self.collection_id if hasattr(self, 'queries') and self.queries is not None: _dict['queries'] = [x._to_dict() for x in self.queries] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TrainingDataSet object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TrainingDataSet') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TrainingDataSet') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TrainingExample(): """ Training example details. :attr str document_id: (optional) The document ID associated with this training example. :attr str cross_reference: (optional) The cross reference associated with this training example. :attr int relevance: (optional) The relevance of the training example. """ def __init__(self, *, document_id: str = None, cross_reference: str = None, relevance: int = None) -> None: """ Initialize a TrainingExample object. :param str document_id: (optional) The document ID associated with this training example. :param str cross_reference: (optional) The cross reference associated with this training example. :param int relevance: (optional) The relevance of the training example. """ self.document_id = document_id self.cross_reference = cross_reference self.relevance = relevance @classmethod def from_dict(cls, _dict: Dict) -> 'TrainingExample': """Initialize a TrainingExample object from a json dictionary.""" args = {} valid_keys = ['document_id', 'cross_reference', 'relevance'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TrainingExample: ' + ', '.join(bad_keys)) if 'document_id' in _dict: args['document_id'] = _dict.get('document_id') if 'cross_reference' in _dict: args['cross_reference'] = _dict.get('cross_reference') if 'relevance' in _dict: args['relevance'] = _dict.get('relevance') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TrainingExample object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'document_id') and self.document_id is not None: _dict['document_id'] = self.document_id if hasattr(self, 'cross_reference') and self.cross_reference is not None: _dict['cross_reference'] = self.cross_reference if hasattr(self, 'relevance') and self.relevance is not None: _dict['relevance'] = self.relevance return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TrainingExample object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TrainingExample') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TrainingExample') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TrainingExampleList(): """ Object containing an array of training examples. :attr List[TrainingExample] examples: (optional) Array of training examples. """ def __init__(self, *, examples: List['TrainingExample'] = None) -> None: """ Initialize a TrainingExampleList object. :param List[TrainingExample] examples: (optional) Array of training examples. """ self.examples = examples @classmethod def from_dict(cls, _dict: Dict) -> 'TrainingExampleList': """Initialize a TrainingExampleList object from a json dictionary.""" args = {} valid_keys = ['examples'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TrainingExampleList: ' + ', '.join(bad_keys)) if 'examples' in _dict: args['examples'] = [ TrainingExample._from_dict(x) for x in (_dict.get('examples')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TrainingExampleList object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'examples') and self.examples is not None: _dict['examples'] = [x._to_dict() for x in self.examples] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TrainingExampleList object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TrainingExampleList') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TrainingExampleList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TrainingQuery(): """ Training query details. :attr str query_id: (optional) The query ID associated with the training query. :attr str natural_language_query: (optional) The natural text query for the training query. :attr str filter: (optional) The filter used on the collection before the **natural_language_query** is applied. :attr List[TrainingExample] examples: (optional) Array of training examples. """ def __init__(self, *, query_id: str = None, natural_language_query: str = None, filter: str = None, examples: List['TrainingExample'] = None) -> None: """ Initialize a TrainingQuery object. :param str query_id: (optional) The query ID associated with the training query. :param str natural_language_query: (optional) The natural text query for the training query. :param str filter: (optional) The filter used on the collection before the **natural_language_query** is applied. :param List[TrainingExample] examples: (optional) Array of training examples. """ self.query_id = query_id self.natural_language_query = natural_language_query self.filter = filter self.examples = examples @classmethod def from_dict(cls, _dict: Dict) -> 'TrainingQuery': """Initialize a TrainingQuery object from a json dictionary.""" args = {} valid_keys = [ 'query_id', 'natural_language_query', 'filter', 'examples' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TrainingQuery: ' + ', '.join(bad_keys)) if 'query_id' in _dict: args['query_id'] = _dict.get('query_id') if 'natural_language_query' in _dict: args['natural_language_query'] = _dict.get('natural_language_query') if 'filter' in _dict: args['filter'] = _dict.get('filter') if 'examples' in _dict: args['examples'] = [ TrainingExample._from_dict(x) for x in (_dict.get('examples')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TrainingQuery object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'query_id') and self.query_id is not None: _dict['query_id'] = self.query_id if hasattr(self, 'natural_language_query' ) and self.natural_language_query is not None: _dict['natural_language_query'] = self.natural_language_query if hasattr(self, 'filter') and self.filter is not None: _dict['filter'] = self.filter if hasattr(self, 'examples') and self.examples is not None: _dict['examples'] = [x._to_dict() for x in self.examples] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TrainingQuery object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TrainingQuery') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TrainingQuery') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TrainingStatus(): """ Training status details. :attr int total_examples: (optional) The total number of training examples uploaded to this collection. :attr bool available: (optional) When `true`, the collection has been successfully trained. :attr bool processing: (optional) When `true`, the collection is currently processing training. :attr bool minimum_queries_added: (optional) When `true`, the collection has a sufficent amount of queries added for training to occur. :attr bool minimum_examples_added: (optional) When `true`, the collection has a sufficent amount of examples added for training to occur. :attr bool sufficient_label_diversity: (optional) When `true`, the collection has a sufficent amount of diversity in labeled results for training to occur. :attr int notices: (optional) The number of notices associated with this data set. :attr datetime successfully_trained: (optional) The timestamp of when the collection was successfully trained. :attr datetime data_updated: (optional) The timestamp of when the data was uploaded. """ def __init__(self, *, total_examples: int = None, available: bool = None, processing: bool = None, minimum_queries_added: bool = None, minimum_examples_added: bool = None, sufficient_label_diversity: bool = None, notices: int = None, successfully_trained: datetime = None, data_updated: datetime = None) -> None: """ Initialize a TrainingStatus object. :param int total_examples: (optional) The total number of training examples uploaded to this collection. :param bool available: (optional) When `true`, the collection has been successfully trained. :param bool processing: (optional) When `true`, the collection is currently processing training. :param bool minimum_queries_added: (optional) When `true`, the collection has a sufficent amount of queries added for training to occur. :param bool minimum_examples_added: (optional) When `true`, the collection has a sufficent amount of examples added for training to occur. :param bool sufficient_label_diversity: (optional) When `true`, the collection has a sufficent amount of diversity in labeled results for training to occur. :param int notices: (optional) The number of notices associated with this data set. :param datetime successfully_trained: (optional) The timestamp of when the collection was successfully trained. :param datetime data_updated: (optional) The timestamp of when the data was uploaded. """ self.total_examples = total_examples self.available = available self.processing = processing self.minimum_queries_added = minimum_queries_added self.minimum_examples_added = minimum_examples_added self.sufficient_label_diversity = sufficient_label_diversity self.notices = notices self.successfully_trained = successfully_trained self.data_updated = data_updated @classmethod def from_dict(cls, _dict: Dict) -> 'TrainingStatus': """Initialize a TrainingStatus object from a json dictionary.""" args = {} valid_keys = [ 'total_examples', 'available', 'processing', 'minimum_queries_added', 'minimum_examples_added', 'sufficient_label_diversity', 'notices', 'successfully_trained', 'data_updated' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TrainingStatus: ' + ', '.join(bad_keys)) if 'total_examples' in _dict: args['total_examples'] = _dict.get('total_examples') if 'available' in _dict: args['available'] = _dict.get('available') if 'processing' in _dict: args['processing'] = _dict.get('processing') if 'minimum_queries_added' in _dict: args['minimum_queries_added'] = _dict.get('minimum_queries_added') if 'minimum_examples_added' in _dict: args['minimum_examples_added'] = _dict.get('minimum_examples_added') if 'sufficient_label_diversity' in _dict: args['sufficient_label_diversity'] = _dict.get( 'sufficient_label_diversity') if 'notices' in _dict: args['notices'] = _dict.get('notices') if 'successfully_trained' in _dict: args['successfully_trained'] = string_to_datetime( _dict.get('successfully_trained')) if 'data_updated' in _dict: args['data_updated'] = string_to_datetime(_dict.get('data_updated')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TrainingStatus object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'total_examples') and self.total_examples is not None: _dict['total_examples'] = self.total_examples if hasattr(self, 'available') and self.available is not None: _dict['available'] = self.available if hasattr(self, 'processing') and self.processing is not None: _dict['processing'] = self.processing if hasattr(self, 'minimum_queries_added' ) and self.minimum_queries_added is not None: _dict['minimum_queries_added'] = self.minimum_queries_added if hasattr(self, 'minimum_examples_added' ) and self.minimum_examples_added is not None: _dict['minimum_examples_added'] = self.minimum_examples_added if hasattr(self, 'sufficient_label_diversity' ) and self.sufficient_label_diversity is not None: _dict[ 'sufficient_label_diversity'] = self.sufficient_label_diversity if hasattr(self, 'notices') and self.notices is not None: _dict['notices'] = self.notices if hasattr(self, 'successfully_trained' ) and self.successfully_trained is not None: _dict['successfully_trained'] = datetime_to_string( self.successfully_trained) if hasattr(self, 'data_updated') and self.data_updated is not None: _dict['data_updated'] = datetime_to_string(self.data_updated) return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TrainingStatus object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TrainingStatus') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TrainingStatus') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class WordHeadingDetection(): """ Object containing heading detection conversion settings for Microsoft Word documents. :attr List[FontSetting] fonts: (optional) Array of font matching configurations. :attr List[WordStyle] styles: (optional) Array of Microsoft Word styles to convert. """ def __init__(self, *, fonts: List['FontSetting'] = None, styles: List['WordStyle'] = None) -> None: """ Initialize a WordHeadingDetection object. :param List[FontSetting] fonts: (optional) Array of font matching configurations. :param List[WordStyle] styles: (optional) Array of Microsoft Word styles to convert. """ self.fonts = fonts self.styles = styles @classmethod def from_dict(cls, _dict: Dict) -> 'WordHeadingDetection': """Initialize a WordHeadingDetection object from a json dictionary.""" args = {} valid_keys = ['fonts', 'styles'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class WordHeadingDetection: ' + ', '.join(bad_keys)) if 'fonts' in _dict: args['fonts'] = [ FontSetting._from_dict(x) for x in (_dict.get('fonts')) ] if 'styles' in _dict: args['styles'] = [ WordStyle._from_dict(x) for x in (_dict.get('styles')) ] return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a WordHeadingDetection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'fonts') and self.fonts is not None: _dict['fonts'] = [x._to_dict() for x in self.fonts] if hasattr(self, 'styles') and self.styles is not None: _dict['styles'] = [x._to_dict() for x in self.styles] return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this WordHeadingDetection object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'WordHeadingDetection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'WordHeadingDetection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class WordSettings(): """ A list of Word conversion settings. :attr WordHeadingDetection heading: (optional) Object containing heading detection conversion settings for Microsoft Word documents. """ def __init__(self, *, heading: 'WordHeadingDetection' = None) -> None: """ Initialize a WordSettings object. :param WordHeadingDetection heading: (optional) Object containing heading detection conversion settings for Microsoft Word documents. """ self.heading = heading @classmethod def from_dict(cls, _dict: Dict) -> 'WordSettings': """Initialize a WordSettings object from a json dictionary.""" args = {} valid_keys = ['heading'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class WordSettings: ' + ', '.join(bad_keys)) if 'heading' in _dict: args['heading'] = WordHeadingDetection._from_dict( _dict.get('heading')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a WordSettings object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'heading') and self.heading is not None: _dict['heading'] = self.heading._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this WordSettings object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'WordSettings') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'WordSettings') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class WordStyle(): """ Microsoft Word styles to convert into a specified HTML head level. :attr int level: (optional) HTML head level that content matching this style is tagged with. :attr List[str] names: (optional) Array of word style names to convert. """ def __init__(self, *, level: int = None, names: List[str] = None) -> None: """ Initialize a WordStyle object. :param int level: (optional) HTML head level that content matching this style is tagged with. :param List[str] names: (optional) Array of word style names to convert. """ self.level = level self.names = names @classmethod def from_dict(cls, _dict: Dict) -> 'WordStyle': """Initialize a WordStyle object from a json dictionary.""" args = {} valid_keys = ['level', 'names'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class WordStyle: ' + ', '.join(bad_keys)) if 'level' in _dict: args['level'] = _dict.get('level') if 'names' in _dict: args['names'] = _dict.get('names') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a WordStyle object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'level') and self.level is not None: _dict['level'] = self.level if hasattr(self, 'names') and self.names is not None: _dict['names'] = self.names return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this WordStyle object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'WordStyle') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'WordStyle') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class XPathPatterns(): """ Object containing an array of XPaths. :attr List[str] xpaths: (optional) An array to XPaths. """ def __init__(self, *, xpaths: List[str] = None) -> None: """ Initialize a XPathPatterns object. :param List[str] xpaths: (optional) An array to XPaths. """ self.xpaths = xpaths @classmethod def from_dict(cls, _dict: Dict) -> 'XPathPatterns': """Initialize a XPathPatterns object from a json dictionary.""" args = {} valid_keys = ['xpaths'] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class XPathPatterns: ' + ', '.join(bad_keys)) if 'xpaths' in _dict: args['xpaths'] = _dict.get('xpaths') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a XPathPatterns object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'xpaths') and self.xpaths is not None: _dict['xpaths'] = self.xpaths return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this XPathPatterns object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'XPathPatterns') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'XPathPatterns') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Calculation(QueryAggregation): """ Calculation. :attr str field: (optional) The field where the aggregation is located in the document. :attr float value: (optional) Value of the aggregation. """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, field: str = None, value: float = None) -> None: """ Initialize a Calculation object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param str field: (optional) The field where the aggregation is located in the document. :param float value: (optional) Value of the aggregation. """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.field = field self.value = value @classmethod def from_dict(cls, _dict: Dict) -> 'Calculation': """Initialize a Calculation object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'field', 'value' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Calculation: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'field' in _dict: args['field'] = _dict.get('field') if 'value' in _dict: args['value'] = _dict.get('value') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Calculation object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'field') and self.field is not None: _dict['field'] = self.field if hasattr(self, 'value') and self.value is not None: _dict['value'] = self.value return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Calculation object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Calculation') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Calculation') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Filter(QueryAggregation): """ Filter. :attr str match: (optional) The match the aggregated results queried for. """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, match: str = None) -> None: """ Initialize a Filter object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param str match: (optional) The match the aggregated results queried for. """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.match = match @classmethod def from_dict(cls, _dict: Dict) -> 'Filter': """Initialize a Filter object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'match' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Filter: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'match' in _dict: args['match'] = _dict.get('match') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Filter object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'match') and self.match is not None: _dict['match'] = self.match return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Filter object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Filter') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Filter') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Histogram(QueryAggregation): """ Histogram. :attr str field: (optional) The field where the aggregation is located in the document. :attr int interval: (optional) Interval of the aggregation. (For 'histogram' type). """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, field: str = None, interval: int = None) -> None: """ Initialize a Histogram object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param str field: (optional) The field where the aggregation is located in the document. :param int interval: (optional) Interval of the aggregation. (For 'histogram' type). """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.field = field self.interval = interval @classmethod def from_dict(cls, _dict: Dict) -> 'Histogram': """Initialize a Histogram object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'field', 'interval' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Histogram: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'field' in _dict: args['field'] = _dict.get('field') if 'interval' in _dict: args['interval'] = _dict.get('interval') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Histogram object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'field') and self.field is not None: _dict['field'] = self.field if hasattr(self, 'interval') and self.interval is not None: _dict['interval'] = self.interval return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Histogram object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Histogram') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Histogram') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Nested(QueryAggregation): """ Nested. :attr str path: (optional) The area of the results the aggregation was restricted to. """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, path: str = None) -> None: """ Initialize a Nested object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param str path: (optional) The area of the results the aggregation was restricted to. """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.path = path @classmethod def from_dict(cls, _dict: Dict) -> 'Nested': """Initialize a Nested object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'path' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Nested: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'path' in _dict: args['path'] = _dict.get('path') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Nested object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'path') and self.path is not None: _dict['path'] = self.path return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Nested object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Nested') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Nested') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Term(QueryAggregation): """ Term. :attr str field: (optional) The field where the aggregation is located in the document. :attr int count: (optional) The number of terms identified. """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, field: str = None, count: int = None) -> None: """ Initialize a Term object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param str field: (optional) The field where the aggregation is located in the document. :param int count: (optional) The number of terms identified. """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.field = field self.count = count @classmethod def from_dict(cls, _dict: Dict) -> 'Term': """Initialize a Term object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'field', 'count' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Term: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'field' in _dict: args['field'] = _dict.get('field') if 'count' in _dict: args['count'] = _dict.get('count') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Term object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'field') and self.field is not None: _dict['field'] = self.field if hasattr(self, 'count') and self.count is not None: _dict['count'] = self.count return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Term object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Term') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Term') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class Timeslice(QueryAggregation): """ Timeslice. :attr str field: (optional) The field where the aggregation is located in the document. :attr str interval: (optional) Interval of the aggregation. Valid date interval values are second/seconds minute/minutes, hour/hours, day/days, week/weeks, month/months, and year/years. :attr bool anomaly: (optional) Used to indicate that anomaly detection should be performed. Anomaly detection is used to locate unusual datapoints within a time series. """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, field: str = None, interval: str = None, anomaly: bool = None) -> None: """ Initialize a Timeslice object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param str field: (optional) The field where the aggregation is located in the document. :param str interval: (optional) Interval of the aggregation. Valid date interval values are second/seconds minute/minutes, hour/hours, day/days, week/weeks, month/months, and year/years. :param bool anomaly: (optional) Used to indicate that anomaly detection should be performed. Anomaly detection is used to locate unusual datapoints within a time series. """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.field = field self.interval = interval self.anomaly = anomaly @classmethod def from_dict(cls, _dict: Dict) -> 'Timeslice': """Initialize a Timeslice object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'field', 'interval', 'anomaly' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class Timeslice: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'field' in _dict: args['field'] = _dict.get('field') if 'interval' in _dict: args['interval'] = _dict.get('interval') if 'anomaly' in _dict: args['anomaly'] = _dict.get('anomaly') return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a Timeslice object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'field') and self.field is not None: _dict['field'] = self.field if hasattr(self, 'interval') and self.interval is not None: _dict['interval'] = self.interval if hasattr(self, 'anomaly') and self.anomaly is not None: _dict['anomaly'] = self.anomaly return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this Timeslice object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'Timeslice') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'Timeslice') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class TopHits(QueryAggregation): """ TopHits. :attr int size: (optional) Number of top hits returned by the aggregation. :attr TopHitsResults hits: (optional) """ def __init__(self, *, type: str = None, results: List['AggregationResult'] = None, matching_results: int = None, aggregations: List['QueryAggregation'] = None, size: int = None, hits: 'TopHitsResults' = None) -> None: """ Initialize a TopHits object. :param str type: (optional) The type of aggregation command used. For example: term, filter, max, min, etc. :param List[AggregationResult] results: (optional) Array of aggregation results. :param int matching_results: (optional) Number of matching results. :param List[QueryAggregation] aggregations: (optional) Aggregations returned by Discovery. :param int size: (optional) Number of top hits returned by the aggregation. :param TopHitsResults hits: (optional) """ self.type = type self.results = results self.matching_results = matching_results self.aggregations = aggregations self.size = size self.hits = hits @classmethod def from_dict(cls, _dict: Dict) -> 'TopHits': """Initialize a TopHits object from a json dictionary.""" args = {} valid_keys = [ 'type', 'results', 'matching_results', 'aggregations', 'size', 'hits' ] bad_keys = set(_dict.keys()) - set(valid_keys) if bad_keys: raise ValueError( 'Unrecognized keys detected in dictionary for class TopHits: ' + ', '.join(bad_keys)) if 'type' in _dict: args['type'] = _dict.get('type') if 'results' in _dict: args['results'] = [ AggregationResult._from_dict(x) for x in (_dict.get('results')) ] if 'matching_results' in _dict: args['matching_results'] = _dict.get('matching_results') if 'aggregations' in _dict: args['aggregations'] = [ QueryAggregation._from_dict(x) for x in (_dict.get('aggregations')) ] if 'size' in _dict: args['size'] = _dict.get('size') if 'hits' in _dict: args['hits'] = TopHitsResults._from_dict(_dict.get('hits')) return cls(**args) @classmethod def _from_dict(cls, _dict): """Initialize a TopHits object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'results') and self.results is not None: _dict['results'] = [x._to_dict() for x in self.results] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matching_results'] = self.matching_results if hasattr(self, 'aggregations') and self.aggregations is not None: _dict['aggregations'] = [x._to_dict() for x in self.aggregations] if hasattr(self, 'size') and self.size is not None: _dict['size'] = self.size if hasattr(self, 'hits') and self.hits is not None: _dict['hits'] = self.hits._to_dict() return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() def __str__(self) -> str: """Return a `str` version of this TopHits object.""" return json.dumps(self._to_dict(), indent=2) def __eq__(self, other: 'TopHits') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'TopHits') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other
43.254228
161
0.604766
68,598
611,312
5.217076
0.020278
0.00845
0.017101
0.014203
0.850545
0.833269
0.818943
0.805913
0.778818
0.764374
0
0.001704
0.305124
611,312
14,132
162
43.257288
0.840793
0.38457
0
0.715093
0
0
0.150741
0.026464
0
0
0
0
0
1
0.113423
false
0.009377
0.001798
0
0.247399
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
2202089462c7519a5c9335ff18dcf377974487c0
2,171
py
Python
operations/migrations/0005_auto_20210606_1117.py
mark-bondo/moondance
3347c3fb8ac3e40a5c66b61a21cfb562841531ba
[ "MIT" ]
null
null
null
operations/migrations/0005_auto_20210606_1117.py
mark-bondo/moondance
3347c3fb8ac3e40a5c66b61a21cfb562841531ba
[ "MIT" ]
null
null
null
operations/migrations/0005_auto_20210606_1117.py
mark-bondo/moondance
3347c3fb8ac3e40a5c66b61a21cfb562841531ba
[ "MIT" ]
null
null
null
# Generated by Django 3.1.5 on 2021-06-06 15:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('operations', '0004_auto_20210606_0938'), ] operations = [ migrations.AlterField( model_name='historicalorder_cost_overlay', name='name', field=models.CharField(max_length=200), ), migrations.AlterField( model_name='historicalorder_cost_overlay', name='sales_channel', field=models.CharField(choices=[('Shopify Website', 'Shopify Website'), ('Amazon FBA', 'Amazon FBA'), ('Amazon FBM', 'Amazon FBM'), ('Farmers Market - Wake Forest', 'Farmers Market - Wake Forest'), ('Farmers Market - Durham', 'Farmers Market - Durham')], max_length=200), ), migrations.AlterField( model_name='historicalorder_cost_overlay', name='type', field=models.CharField(choices=[('Fulfillment Labor', 'Fulfillment Labor'), ('Shipping Materials', 'Shipping Materials'), ('Sales Channel Fees', 'Sales Channel Fees')], max_length=200), ), migrations.AlterField( model_name='order_cost_overlay', name='name', field=models.CharField(max_length=200), ), migrations.AlterField( model_name='order_cost_overlay', name='sales_channel', field=models.CharField(choices=[('Shopify Website', 'Shopify Website'), ('Amazon FBA', 'Amazon FBA'), ('Amazon FBM', 'Amazon FBM'), ('Farmers Market - Wake Forest', 'Farmers Market - Wake Forest'), ('Farmers Market - Durham', 'Farmers Market - Durham')], max_length=200), ), migrations.AlterField( model_name='order_cost_overlay', name='type', field=models.CharField(choices=[('Fulfillment Labor', 'Fulfillment Labor'), ('Shipping Materials', 'Shipping Materials'), ('Sales Channel Fees', 'Sales Channel Fees')], max_length=200), ), migrations.AlterUniqueTogether( name='order_cost_overlay', unique_together={('name', 'sales_channel')}, ), ]
45.229167
283
0.617688
216
2,171
6.055556
0.268519
0.079511
0.114679
0.133028
0.830275
0.830275
0.830275
0.830275
0.796636
0.796636
0
0.029842
0.243667
2,171
47
284
46.191489
0.766748
0.020728
0
0.756098
1
0
0.378531
0.050377
0
0
0
0
0
1
0
false
0
0.02439
0
0.097561
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
22233694636e3d50d2f09780f707e2405506d2af
86,531
py
Python
skidl/libs/transistors_sklib.py
arjenroodselaar/skidl
0bf801bd3b74e6ef94bd9aa1b68eef756b568276
[ "MIT" ]
700
2016-08-16T21:12:50.000Z
2021-10-10T02:15:18.000Z
skidl/libs/transistors_sklib.py
0dvictor/skidl
458709a10b28a864d25ae2c2b44c6103d4ddb291
[ "MIT" ]
118
2016-08-16T20:51:05.000Z
2021-10-10T08:07:18.000Z
skidl/libs/transistors_sklib.py
0dvictor/skidl
458709a10b28a864d25ae2c2b44c6103d4ddb291
[ "MIT" ]
94
2016-08-25T14:02:28.000Z
2021-09-12T05:17:08.000Z
from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib SKIDL_lib_version = '0.0.1' transistors = SchLib(tool=SKIDL).add_parts(*[ Part(name='2N2219',dest=TEMPLATE,tool=SKIDL,keywords='NPN transistor',description='Vce 60V, Ic 1000mA, NPN Transistor, TO-39',ref_prefix='Q',num_units=1,fplist=['TO?39*'],do_erc=True,aliases=['BC140', 'BC141'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='2N2646',dest=TEMPLATE,tool=SKIDL,keywords='UJT',description='Unijunction transistor',ref_prefix='Q',num_units=1,fplist=['TO?18*'],do_erc=True,aliases=['2N2647'],pins=[ Pin(num='1',name='B2',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='E',do_erc=True), Pin(num='3',name='B1',func=Pin.PASSIVE,do_erc=True)]), Part(name='2N3055',dest=TEMPLATE,tool=SKIDL,keywords='NPN power transistor',description='60V Vce, 15A Ic, NPN, Power Transistor, TO-3',ref_prefix='Q',num_units=1,fplist=['TO?3*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='2N3904',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='40V Vce, 0.2A Ic, NPN, Small Signal Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='2N3906',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='-40V Vce, -0.2A Ic, PNP, Small Signal Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['2N3905'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='2N7000',dest=TEMPLATE,tool=SKIDL,keywords='P-Channel MOSFET',description='-60V Vds, -0.18A Id, P-Channel MOSFET, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['TP0610L', 'VP0610L'],pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='2SA1015',dest=TEMPLATE,tool=SKIDL,keywords='Low Noise Audio PNP Transistor',description='-50V Vce, -0.15A Ic, Low Noise Audio PNP Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='2SB631',dest=TEMPLATE,tool=SKIDL,keywords='High Voltage Transistor',description='Vce -100V, Ic -1A, High Voltage Power Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='2SB817',dest=TEMPLATE,tool=SKIDL,keywords='Power Transistor PNP',description='-12A Ic, -140V Vce, Silicon Power Transistors PNP, TO-3PB',ref_prefix='Q',num_units=1,fplist=['TO-3PB*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='2SC1815',dest=TEMPLATE,tool=SKIDL,keywords='Low Noise Audio NPN Transistor',description='50V Vce, 0.15A Ic, Low Noise Audio NPN Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='2SC1941',dest=TEMPLATE,tool=SKIDL,keywords='Audio High Voltage NPN Transistor',description='160V Vce, 0.05A Ic, Audio High Voltage NPN Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='2SC1945',dest=TEMPLATE,tool=SKIDL,keywords='RF Power Transistor NPN',description='6A Ic, 80V Vce, Silicon 27MHz RF Power Transistors NPN, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='2SD1047',dest=TEMPLATE,tool=SKIDL,keywords='Power Transistor NPN',description='12A Ic, 140V Vce, Silicon Power Transistors NPN, TO-3PB',ref_prefix='Q',num_units=1,fplist=['TO-3PB*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='2SD600',dest=TEMPLATE,tool=SKIDL,keywords='High Voltage Power Transistor',description='Vce 100V, Ic 1A, High Voltage Power Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='3SK263',dest=TEMPLATE,tool=SKIDL,keywords='NMOS Dual Gate',description='30mA Id, 15V Vds, N-Channel Dual Gate MOSFET, SOT-143/343',ref_prefix='Q',num_units=1,fplist=['SOT-143*', 'SOT-343*'],do_erc=True,pins=[ Pin(num='1',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='G1',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G2',func=Pin.PASSIVE,do_erc=True)]), Part(name='AUIR3315S',dest=TEMPLATE,tool=SKIDL,keywords='Hiside power switch',description='Automotive Q101 Programmable Current Sense High Side Switch in a 5-Lead (TO-263-5) Package',ref_prefix='U',num_units=1,fplist=['TO-263*'],do_erc=True,pins=[ Pin(num='1',name='IN',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='Ifb',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='Vcc',func=Pin.PWRIN,do_erc=True), Pin(num='4',name='OUT',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='OUT',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC107',dest=TEMPLATE,tool=SKIDL,keywords='NPN low noise transistor',description='25V Vce, 0.2A Ic, NPN, Low Noise General Purpose Transistor, TO-18',ref_prefix='Q',num_units=1,fplist=['TO?18*'],do_erc=True,aliases=['BC108', 'BC109'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC160',dest=TEMPLATE,tool=SKIDL,keywords='PNP power transistor',description='60V Vce, 1A Ic, PNP, Power Transistor, TO-39',ref_prefix='Q',num_units=1,fplist=['TO?39*'],do_erc=True,aliases=['BC161'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC237',dest=TEMPLATE,tool=SKIDL,keywords='NPN Epitaxial Silicon Transistor',description='Vce 50V, Ic 100mA, NPN Epitaxial Silicon Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC240',dest=TEMPLATE,tool=SKIDL,keywords='NPN RF Transistor',description='40V Vce, 0.05A Ic, NPN, RF Signal Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BC307',dest=TEMPLATE,tool=SKIDL,keywords='PNP Epitaxial Silicon Transistor',description='Vce 45V, Ic 100mA, PNP Epitaxial Silicon Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC413',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='45V Vce, 0.1A Ic, NPN, Small Signal Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['BC413B', 'BC413C', 'BC414', 'BC414B', 'BC414C'],pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC516',dest=TEMPLATE,tool=SKIDL,keywords='PNP Darlington Darl Transistor',description='30V Vce, 1A Ic, PNP Darlington Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC517',dest=TEMPLATE,tool=SKIDL,keywords='NPN Darlington Darl Transistor',description='30V Vce, 1A Ic, NPN Darlington Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC547',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='45V Vce, 0.1A Ic, NPN, Small Signal Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['BC546', 'BC548', 'BC549', 'BC550', 'BC337', 'BC338'],pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC557',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='45V Vce, 0.1A Ic, PNP Small Signal Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['BC556', 'BC558', 'BC559', 'BC560', 'BC327', 'BC328'],pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC636',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='45V Vce, 1A Ic, PNP Medium Power Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BC807',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='-40V Vce, -0.2A Ic, PNP, Small Signal Transistor, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*'],do_erc=True,aliases=['BC808', 'BC856', 'BC857', 'BC858', 'BC859', 'BC860', 'MMBT3906'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC807W',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='45V Vce, 0.1A Ic, PNP Small Signal Transistor, SOT-323',ref_prefix='Q',num_units=1,fplist=['SOT?323*'],do_erc=True,aliases=['BC808W', 'BC856W', 'BC857W', 'BC858W', 'BC859W', 'BC860W'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC817',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='40V Vce, 0.2A Ic, NPN, Small Signal Transistor, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*'],do_erc=True,aliases=['BC818', 'BC847', 'BC848', 'BC849', 'BC850', 'MMBT3904'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC817W',dest=TEMPLATE,tool=SKIDL,keywords='NPN Small Signal Transistor',description='45V Vce, 0.1A Ic, NPN, SOT-323',ref_prefix='Q',num_units=1,fplist=['SOT?323*'],do_erc=True,aliases=['BC818W', 'BC847W', 'BC848W', 'BC849W', 'BC850W'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BC846BPN',dest=TEMPLATE,tool=SKIDL,keywords='Transistor NPN/PNP',description='40V Vce, 200mA IC, Dual NPN/PNP Transistors, SOT-363',ref_prefix='Q',num_units=2,fplist=['SC?70*', 'SC?88*', 'SOT?363*'],do_erc=True,aliases=['BC846BPDW1', 'BC847BPN', 'BC847BPDW1', 'PMBT3946YPN', 'MMDT3946', 'MBT3946DW1T1', 'FFB3946'],pins=[ Pin(num='1',name='E1',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B1',do_erc=True), Pin(num='6',name='C1',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C2',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='E2',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='B2',do_erc=True)]), Part(name='BC846BS',dest=TEMPLATE,tool=SKIDL,keywords='Transistor NPN/NPN',description='40V Vce, 200mA IC, Dual NPN/NPN Transistors, SOT-363',ref_prefix='Q',num_units=2,fplist=['SC?70*', 'SC?88*', 'SOT?363*'],do_erc=True,aliases=['BC846BDW1', 'BC847BS', 'BC847BDW1', 'PMBT2222AYS', 'MMDT2222A', 'MBT2222ADW1T1', 'FFB2222A', 'PMBT3904YS', 'MMDT3904', 'MBT3904DW1', 'FFB3904', 'MMDT5551', 'FFB5551'],pins=[ Pin(num='1',name='E1',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B1',do_erc=True), Pin(num='6',name='C1',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C2',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='E2',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='B2',do_erc=True)]), Part(name='BC856BS',dest=TEMPLATE,tool=SKIDL,keywords='Transistor PNP/PNP',description='40V Vce, 200mA IC, Dual PNP/PNP Transistors, SOT-363',ref_prefix='Q',num_units=2,fplist=['SC?70*', 'SC?88*', 'SOT?363*'],do_erc=True,aliases=['BC856BDW1', 'BC857BS', 'BC857BDW1', 'PMBT3906YS', 'MMDT3906', 'MBT3906DW1', 'FFB3906', 'MMDT5401'],pins=[ Pin(num='1',name='E1',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B1',do_erc=True), Pin(num='6',name='C1',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C2',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='E2',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='B2',do_erc=True)]), Part(name='BCP51',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='45V Vce, 1A Ic, PNP Medium Power Transistor, SOT-223',ref_prefix='Q',num_units=1,fplist=['SOT?223*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BCV61',dest=TEMPLATE,tool=SKIDL,keywords='Transistor Double NPN',description='30V Vce, 100mA IC, Double NPN Transistors, Current mirror configuration, SOT-143',ref_prefix='Q',num_units=1,fplist=['SOT?143*'],do_erc=True,pins=[ Pin(num='1',name='C2',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C1',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E1',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='E2',func=Pin.PASSIVE,do_erc=True)]), Part(name='BCV62',dest=TEMPLATE,tool=SKIDL,keywords='Transistor Double PNP',description='30V Vce, 100mA IC, Double PNP Transistors, Current mirror configuration, SOT-143',ref_prefix='Q',num_units=1,fplist=['SOT?143*'],do_erc=True,pins=[ Pin(num='1',name='C2',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C1',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E1',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='E2',func=Pin.PASSIVE,do_erc=True)]), Part(name='BCX51',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='80V Vce, 1A Ic, PNP Medium Power Transistor, SOT-89',ref_prefix='Q',num_units=1,fplist=['SOT?89*'],do_erc=True,aliases=['BCX52', 'BCX53'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BCX56',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='80V Vce, 1A Ic, NPN Medium Power Transistor, SOT-89',ref_prefix='Q',num_units=1,fplist=['SOT?89*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BD139',dest=TEMPLATE,tool=SKIDL,keywords='Low Voltage Transistor',description='Vce 80V, Ic 2A, Low Voltage Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,aliases=['BD135', 'BD137', 'BD233', 'BD235', 'BD237'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BD140',dest=TEMPLATE,tool=SKIDL,keywords='Low Voltage Transistor',description='Vce 80V, Ic 2A, Low Voltage Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,aliases=['BD136', 'BD138', 'BD234', 'BD236', 'BD238'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BD249',dest=TEMPLATE,tool=SKIDL,keywords='Power Transistor NPN',description='25A Ic, 115V Vce, Silicon Power Transistors NPN, SOT-93',ref_prefix='Q',num_units=1,fplist=['SOT?93*'],do_erc=True,aliases=['BD249A', 'BD249B', 'BD249C'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BD250',dest=TEMPLATE,tool=SKIDL,keywords='Power Transistor PNP',description='25A Ic, 115V Vce, Silicon Power Transistors PNP, SOT-93',ref_prefix='Q',num_units=1,fplist=['SOT?93*'],do_erc=True,aliases=['BD250A', 'BD250B', 'BD250C'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BD433',dest=TEMPLATE,tool=SKIDL,keywords='NPN Power Transistor',description='80V Vce, 4A Ic, NPN Power Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,aliases=['BD435', 'BD437', 'BD439', 'BD441'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BD434',dest=TEMPLATE,tool=SKIDL,keywords='PNP Power Transistor',description='80V Vce, 4A Ic, PNP Power Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,aliases=['BD436', 'BD438', 'BD440', 'BD442'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BD910',dest=TEMPLATE,tool=SKIDL,keywords='PNP power transistor',description='-100V Vce, -6A Ic, PNP, Power Transistor, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['BD912', 'TIP42', 'TIP42A', 'TIP42B', 'TIP42C'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BD911',dest=TEMPLATE,tool=SKIDL,keywords='NPN power transistor',description='100V Vce, 6A Ic, NPN, Power Transistor, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['BD909', 'TIP41A', 'TIP41B', 'TIP41C', 'TIP41'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BDW93',dest=TEMPLATE,tool=SKIDL,keywords='NPN Darlington Transistor',description='100V Vce, 12A Ic, NPN Power Darlington Transistor, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['BDW93A', 'BDW93B', 'BDW93C'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BDW94',dest=TEMPLATE,tool=SKIDL,keywords='PNP Darlington Transistor',description='100V Vce, 12A Ic, PNP Power Darlington Transistor, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['BDW94A', 'BDW94B', 'BDW94C'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BF199',dest=TEMPLATE,tool=SKIDL,keywords='NPN RF Transistor',description='25V Vce, 0.05A Ic, NPN Radio Frequency Transistor, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BF244A',dest=TEMPLATE,tool=SKIDL,keywords='N-Channel FET Transistor Low Voltage',description='30V Vgs, 0.05A Id, N-Cannel FET Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['BF244B', 'BF244C'],pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BF245A',dest=TEMPLATE,tool=SKIDL,keywords='N-Channel FET Transistor Low Voltage',description='30V Vgs, 0.01A Id, N-Cannel FET Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['BF245B', 'BF245C'],pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='BF457',dest=TEMPLATE,tool=SKIDL,keywords='NPN HV High Voltage Transistor',description='300V Vce, 0.1A Ic, NPN, High Voltage Transistor, TO-126',ref_prefix='Q',num_units=1,fplist=['TO?126*'],do_erc=True,aliases=['BF458', 'BF459'],pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='B',do_erc=True)]), Part(name='BFR92',dest=TEMPLATE,tool=SKIDL,keywords='RF 5GHz NPN Transistor',description='15V Vce, 0.025A Ic, NPN 5GHz Wideband Transistor, SOT-323',ref_prefix='Q',num_units=1,fplist=['SOT?323*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BFT92',dest=TEMPLATE,tool=SKIDL,keywords='RF 5GHz NPN Transistor',description='15V Vce, 0.025A Ic, PNP 5GHz Wideband Transistor, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='BS107',dest=TEMPLATE,tool=SKIDL,keywords='N-Channel MOSFET',description='60V Vds 0.5A Id, N-Channel MOSFET, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,aliases=['BS108', 'BS170'],pins=[ Pin(num='1',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True)]), Part(name='BS250',dest=TEMPLATE,tool=SKIDL,keywords='P-Channel MOSFET',description='-60V Vds, -0.18A Id, P-Channel MOSFET, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True)]), Part(name='BSS138',dest=TEMPLATE,tool=SKIDL,keywords='P-Channel MOSFET',description='-60V Vds, -0.18A Id, P-Channel MOSFET, SOT-23-3',ref_prefix='Q',num_units=1,fplist=['SOT?23*'],do_erc=True,aliases=['2N7002', 'TP0610T', 'VP0610T'],pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='BUT11',dest=TEMPLATE,tool=SKIDL,keywords='High Voltage Power Transistor NPN',description='5A 450V, Silicon Power Transistors NPN, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['BUT11A'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='BUZ11',dest=TEMPLATE,tool=SKIDL,keywords='Single N-Channel HEXFET Power MOSFET',description='47A Id, 55V Vds, 22mOhm Rds, Single N-Channel HEXFET Power MOSFET in a TO-220AB package',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['IRLZ44N', 'IRLIZ44N', 'IRLZ34N', 'IRF3205', 'IRF540N'],pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True)]), Part(name='CSD17578Q5A',dest=TEMPLATE,tool=SKIDL,keywords='NexFET Power MOSFET N-MOS',description='NexFET N-Channel Power MOSFET, Vds 100V, Rdson 15.1mOhm, Id 50A, Qg (typ) 17nC, SON8 5x6mm',ref_prefix='Q',num_units=1,fplist=['TDSON*'],do_erc=True,aliases=['CSD17579Q5A', 'CSD16570Q5B', 'CSD17577Q5A', 'CSD18509Q5B', 'CSD18540Q5B', 'CSD17573Q5B', 'CSD17576Q5B', 'CSD19534Q5A', 'CSD17570Q5B', 'CSD19533Q5A', 'CSD19502Q5B', 'CSD19532Q5B', 'CSD19531Q5A', 'CSD18563Q5A', 'CSD18537NQ5A', 'CSD18532NQ5B', 'CSD17556Q5B', 'CSD18502Q5B', 'CSD18532Q5B', 'CSD17552Q5A', 'CSD17559Q5', 'CSD18534Q5A', 'CSD18533Q5A', 'CSD17555Q5A', 'CSD17551Q5A', 'CSD18501Q5A', 'CSD18503Q5A', 'CSD18504Q5A', 'CSD18531Q5A', 'CSD17553Q5A', 'CSD16342Q5A', 'CSD17322Q5A', 'CSD17327Q5A', 'CSD17522Q5A', 'CSD17527Q5A', 'CSD17501Q5A', 'CSD17506Q5A', 'CSD17505Q5A', 'CSD17507Q5A', 'CSD17510Q5A', 'CSD17311Q5', 'CSD17312Q5', 'CSD17303Q5', 'CSD16415Q5', 'CSD17302Q5A', 'CSD17305Q5A', 'CSD17306Q5A', 'CSD17307Q5A', 'CSD17310Q5A', 'CSD17301Q5A', 'CSD16408Q5', 'CSD16322Q5', 'CSD16325Q5', 'CSD16321Q5', 'CSD16414Q5', 'CSD16401Q5', 'CSD16403Q5A', 'CSD16404Q5A', 'CSD16407Q5', 'CSD16410Q5A', 'CSD16412Q5A', 'CSD16413Q5A', 'BSC026N08NS5ATMA1', 'BSC030N08NS5ATMA1', 'BSC035N10NS5ATMA1', 'BSC037N08NS5ATMA1', 'BSC040N10NS5ATMA1', 'BSC040N08NS5ATMA1', 'BSC046N10NS3GATMA1', 'BSC047N08NS3GATMA1', 'BSC052N08NS5ATMA1', 'BSC057N08NS3GATMA1', 'BSC060N10NS3GATMA1', 'BSC061N08NS5ATMA1', 'BSC070N10NS3GATMA1', 'BSC070N10NS5ATMA1', 'BSC072N08NS5ATMA1', 'BSC079N10NSGATMA1', 'BSC082N10LSGATMA1', 'BSC098N10NS5ATMA1', 'BSC100N10NSFGATMA1', 'BSC105N10LSFGATMA1', 'BSC109N10NS3GATMA1', 'BSC117N08NS5ATMA1', 'BSC118N10NSGATMA1', 'BSC123N08NS3GATMA1', 'BSC123N10LSGATMA1', 'BSC159N10LSFGATMA1', 'BSC160N10NS3GATMA1', 'BSC196N10NSGATMA1', 'BSC252N10NSFGATMA1', 'BSC265N10LSFGATMA1', 'BSC340N08NS3GATMA1', 'BSC440N10NS3GATMA1', 'BSC028N06LS3'],pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='CSD19537Q3',dest=TEMPLATE,tool=SKIDL,keywords='NexFET Power MOSFET N-MOS',description='NexFET N-Channel Power MOSFET, Vds 100V, Rdson 13mOhm, Id 50A, Qg Typ 16.0nC, VSON8 3.3x3.3mm',ref_prefix='Q',num_units=1,fplist=['SON*3.3x3.3mm*Pitch0.65mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA113T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA113Z',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA114E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA114G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA114T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA114W',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/4.7k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA114Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA115E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='DTA114E, Digital Transistor, 100k/100k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA115G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/100k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA115T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 100k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA115U',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='DTA114U, Digital Transistor, 100k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA123E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/2k2, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA123J',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA123Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA124E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 22k/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA124G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA124T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 22k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA124X',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 22k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA125T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 200k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA143E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/4k7, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA143T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA143X',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA143Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA143Z',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA144E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA144G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA144T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA144V',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA144W',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA1D3R',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k7/1k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTA214Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB113E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/1k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB113Z',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB114E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB114G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB114T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB122J',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k22/4k7, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB123E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/2k2, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB123T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB123Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB133H',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 3k3/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB143T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTB163T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 6k8/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC113T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC113Z',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC114E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC114G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC114T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC114W',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/4k7, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC114Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC115E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 100k/100k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC115G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/100k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC115T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 100k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC115U',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 100k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC123E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/2k2, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC123J',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC123Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC124E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 22k/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC124G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC124T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 22k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC124X',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 22k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC125T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 200k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC143E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/4k7, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC143T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC143X',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC143Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC143Z',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC144E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC144G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC144T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC144V',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC144W',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 47k/22k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC1D3R',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k7/1k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTC214Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/47k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD113E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/1k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD113Z',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 1k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD114E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD114G',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD114T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 10k/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD122J',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 0k22/4k7, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD123E',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/2k2, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD123T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD123Y',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 2k2/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD133H',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 3k3/10k, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD143T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 4k7/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='DTD163T',dest=TEMPLATE,tool=SKIDL,keywords='ROHM Digital Transistor',description='Digital Transistor, 6k8/NONE, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*', 'SC-59*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='FDG1024NZ',dest=TEMPLATE,tool=SKIDL,keywords='Dual N-Channel MOSFET Logic Level',description='20V Vds, 1.2A Id, 175mOhm Rds, Dual N-Channel MOSFET, SC-70-6',ref_prefix='Q',num_units=2,fplist=['*SC-70*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='G',func=Pin.PASSIVE,do_erc=True)]), Part(name='FDMS8350LET40',dest=TEMPLATE,tool=SKIDL,keywords='dual-cool-powertrench mosfet fairchild',description='N-Channel Dual Cool PowerTrench MOSFET, Vds=80V, Rds=1.35mΩ, Id(const)=36A, Qg(max)=273nC, Temp=-55 to 150 °C, SON8 5x6mm package',ref_prefix='Q',num_units=1,fplist=['SON*'],do_erc=True,aliases=['FDMT80060DC', 'FDMT80080DC', 'FDMT800120DC', 'FDMT800100DC', 'FDMT800150DC', 'FDMT800152DC', 'FDMS8050ET30', 'FDMS86202ET120', 'FDMS86150ET100', 'FDMS86255ET150', 'FDMS86350ET80', 'FDMS86550ET60', 'FDMS8050', 'FDMS8350L', 'FDMS86255', 'FDMS86550', 'FDMS86202', 'FDMS86350', 'FDMS86152', 'FDMS86150'],pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='FDS6890A',dest=TEMPLATE,tool=SKIDL,keywords='Dual N-Channel MOSFET',description='20V Vds, 6.5A Id, 30mOhm Rds, Dual N-Channel MOSFET, SO-8',ref_prefix='Q',num_units=2,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,aliases=['FDS6892A', 'FDS6898A', 'FDS9926A'],pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='~',func=Pin.PASSIVE,do_erc=True)]), Part(name='FDS9934C',dest=TEMPLATE,tool=SKIDL,keywords='Dual N-Channel P-Channel MOSFET',description='Dual N and P Channel MOSFET, 30V Vds, 6A Id, 28mΩ Rds @ 10V Vgs, SO8L',ref_prefix='Q',num_units=2,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,aliases=['Si4542DY', 'FDS4559', 'Si4532DY', 'FDS4897AC', 'FDS4897C', 'FDS8960C'],pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',do_erc=True), Pin(num='7',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='~',func=Pin.PASSIVE,do_erc=True)]), Part(name='IPS6011PBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='39V, 5A, Intelligent Power Switch High Side, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['IPS6021PBF', 'IPS6031PBF', 'IPS6041PBF'],pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='4',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='5',name='OUT',func=Pin.OUTPUT,do_erc=True)]), Part(name='IPS6011RPBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='39V, 5A, Intelligent Power Switch High Side, DPAK 5pin',ref_prefix='Q',num_units=1,do_erc=True,aliases=['IPS6021RPBF', 'IPS6031RPBF', 'IPS6041RPBF'],pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='4',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='5',name='OUT',func=Pin.OUTPUT,do_erc=True)]), Part(name='IPS6011SPBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='39V, 5A, Intelligent Power Switch High Side, D2PAK 5pin',ref_prefix='Q',num_units=1,do_erc=True,aliases=['IPS6021SPBF', 'IPS6031SPBF', 'IPS6041SPBF'],pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='4',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='5',name='OUT',func=Pin.OUTPUT,do_erc=True)]), Part(name='IPS6041GPBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='39V, 5A, Intelligent Power Switch High Side, SO-8',ref_prefix='Q',num_units=1,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='4',name='OUT',func=Pin.OUTPUT,do_erc=True), Pin(num='5',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='6',name='~',func=Pin.PWRIN,do_erc=True), Pin(num='7',name='~',func=Pin.PWRIN,do_erc=True), Pin(num='8',name='~',func=Pin.PWRIN,do_erc=True)]), Part(name='IPS7091GPBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='70V, 5A, Intelligent Power Switch High Side, D2-PAK 5pin',ref_prefix='Q',num_units=1,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='4',name='OUT',func=Pin.OUTPUT,do_erc=True), Pin(num='5',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='6',name='~',func=Pin.PWRIN,do_erc=True), Pin(num='7',name='~',func=Pin.PWRIN,do_erc=True), Pin(num='8',name='~',func=Pin.PWRIN,do_erc=True)]), Part(name='IPS7091PBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='70V, 5A, Intelligent Power Switch High Side, TO-220-5',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='4',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='5',name='OUT',func=Pin.OUTPUT,do_erc=True)]), Part(name='IPS7091SPBF',dest=TEMPLATE,tool=SKIDL,keywords='Intelligent Power Switch High Side MOSFET',description='70V, 5A, Intelligent Power Switch High Side, D2-PAK 5pin',ref_prefix='Q',num_units=1,do_erc=True,pins=[ Pin(num='1',name='GND',func=Pin.PWRIN,do_erc=True), Pin(num='2',name='IN',do_erc=True), Pin(num='3',name='VCC',func=Pin.PWRIN,do_erc=True), Pin(num='4',name='DG',func=Pin.BIDIR,do_erc=True), Pin(num='5',name='OUT',func=Pin.OUTPUT,do_erc=True)]), Part(name='IPT012N08N5ATMA1',dest=TEMPLATE,tool=SKIDL,keywords='OptiMOS Power MOSFET N-MOS',description='OptiMOS N-Channel Power MOSFET, Vds 100V, Rdson 2.0mOhm, Id 300A, Qg (typ) 156.0nC, PG-HSOF-8',ref_prefix='Q',num_units=1,do_erc=True,aliases=['IPT015N10N5ATMA1', 'IPT020N10N3ATMA1'],pins=[ Pin(num='1',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='9',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF7309IPBF',dest=TEMPLATE,tool=SKIDL,keywords='Dual HEXFET N-Channel P-Channel MOSFET',description='30V Vds, 3A Id, Dual HEXFET MOSFET, SO-8',ref_prefix='Q',num_units=2,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',do_erc=True), Pin(num='7',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='1',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',do_erc=True), Pin(num='5',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF7324',dest=TEMPLATE,tool=SKIDL,keywords='Dual HEXFET P-Channel MOSFET',description='-20V Vds, 9A Id, Dual HEXFET P-Channel MOSFET, SO-8',ref_prefix='Q',num_units=2,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',do_erc=True), Pin(num='7',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='1',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',do_erc=True), Pin(num='5',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF7343PBF',dest=TEMPLATE,tool=SKIDL,keywords='Dual HEXFET N-Channel P-Channel MOSFET',description='55V Vds, 4A Id, Dual HEXFET MOSFET, SO-8',ref_prefix='Q',num_units=2,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='G',do_erc=True), Pin(num='7',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='1',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',do_erc=True), Pin(num='5',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF7404',dest=TEMPLATE,tool=SKIDL,keywords='P-Channel MOSFET',description='-20V Vds, -6.7A Id, P-Channel HEXFET Power MOSFET, SO-8',ref_prefix='U',num_units=1,fplist=['SO*', 'SOIC*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF7606PBF',dest=TEMPLATE,tool=SKIDL,keywords='HexFET Power Mosfet P-MOS',description='HexFET P-MOS Power Mosfet, Vds -30V, Rdson 0.09R, Id -3.6A, Micro8',ref_prefix='Q',num_units=1,fplist=['MSOP*3x3mm?Pitch0.65mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF7607PBF',dest=TEMPLATE,tool=SKIDL,keywords='HexFET Power Mosfet N-MOS',description='HexFET N-MOS Power Mosfet, Vds 20V, Rdson 0.03R, Id 5.2A, Micro8',ref_prefix='Q',num_units=1,fplist=['MSOP*3x3mm?Pitch0.65mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF8721PBF-1',dest=TEMPLATE,tool=SKIDL,keywords='HEXFET N-Channel MOSFET',description='30V Vds, 14A Id, HEXFET MOSFET, SO-8',ref_prefix='Q',num_units=1,fplist=['SOIC*3.9x4.9mm*Pitch1.27mm*'],do_erc=True,pins=[ Pin(num='1',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='G',do_erc=True), Pin(num='5',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='7',name='~',func=Pin.PASSIVE,do_erc=True), Pin(num='8',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRF9540N',dest=TEMPLATE,tool=SKIDL,keywords='HEXFET P-Channel MOSFET',description='-100V Vds, -23A Id, HEXFET P-Channel MOSFET, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['IRF4905'],pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRG4PF50W',dest=TEMPLATE,tool=SKIDL,keywords='N-Channel IGBT Power Transistor',description='28A, 900V, N-Channel IGBT',ref_prefix='Q',num_units=1,fplist=['TO?247*'],do_erc=True,pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='IRLB8721PBF',dest=TEMPLATE,tool=SKIDL,keywords='N-Channel HEXFET Power MOSFET',description='30V Vds, 62A Id, N-Channel MOSFET, TO-220',ref_prefix='Q',num_units=1,fplist=['TO-220*'],do_erc=True,pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='D',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='S',func=Pin.PASSIVE,do_erc=True)]), Part(name='KTD1624',dest=TEMPLATE,tool=SKIDL,keywords='NPN Switching Transistor',description='EPITAXIAL PLANAR NPN TRANSISTOR, SOT-89',ref_prefix='Q',num_units=1,fplist=['SOT?89*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='MAT02',dest=TEMPLATE,tool=SKIDL,keywords='Precision Dual Monolithic Transistor Low Noise EOL',description='Precision Dual Monolithic Transistor, Low Noise, Low Offset, Vce 40V, Ic 20mA, TO-78',ref_prefix='Q',num_units=2,do_erc=True,pins=[ Pin(num='1',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='7',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='5',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='6',name='B',do_erc=True), Pin(num='7',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='MJ2955',dest=TEMPLATE,tool=SKIDL,keywords='PNP power transistor',description='-60V Vce, -15A Ic, PNP, Power Transistor, TO-3',ref_prefix='Q',num_units=1,fplist=['TO?3*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='MJE13003',dest=TEMPLATE,tool=SKIDL,keywords='Switching Power High Voltage Transistor NPN',description='1.5A Ic, 400V Vce, Silicon Switching Power Transistor NPN, TO-225',ref_prefix='Q',num_units=1,fplist=['TO?225*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='MJE13007G',dest=TEMPLATE,tool=SKIDL,keywords='Switching Power Transistor NPN',description='12A Ic, 400V Vce, Silicon Switching Power Transistors NPN, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['MJE13005G', 'MJE13009G'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='MMBF170',dest=TEMPLATE,tool=SKIDL,keywords='N-Channel MOSFET',description='60V Vds 0.5A Id, N-Channel MOSFET, SOT-23',ref_prefix='Q',num_units=1,fplist=['SOT?23*'],do_erc=True,pins=[ Pin(num='1',name='G',do_erc=True), Pin(num='2',name='S',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='D',func=Pin.PASSIVE,do_erc=True)]), Part(name='MPSA42',dest=TEMPLATE,tool=SKIDL,keywords='NPN High Voltage Transistor',description='Vce 300V, Ic 500mA, NPN High Voltage Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='MPSA92',dest=TEMPLATE,tool=SKIDL,keywords='PNP High Voltage Transistor',description='Vce 300V, Ic 500mA, PNP High Voltage Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='PN2222A',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='40V Vce, 1A Ic, NPN, General Purpose Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='PZT2222A',dest=TEMPLATE,tool=SKIDL,keywords='NPN General Puprose Transistor SMD',description='40V Vce, 1A Ic, NPN, General Purpose Transistor, SOT-223',ref_prefix='Q',num_units=1,fplist=['SOT?223*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='PZT3904',dest=TEMPLATE,tool=SKIDL,keywords='NPN Transistor',description='40V Vce, 0.2A Ic, NPN, Small Signal Transistor, SOT-223',ref_prefix='Q',num_units=1,fplist=['SOT?223*'],do_erc=True,aliases=['BCP56'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='PZT3906',dest=TEMPLATE,tool=SKIDL,keywords='PNP Transistor',description='-40V Vce, -0.2A Ic, PNP, Small Signal Transistor, SOT-223',ref_prefix='Q',num_units=1,fplist=['SOT?223*'],do_erc=True,aliases=['BCP53'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='4',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='PZTA42',dest=TEMPLATE,tool=SKIDL,keywords='NPN High Voltage Transistor SMD',description='300V Vce, 0.2A Ic, NPN, High Voltage Transistor, SOT-223',ref_prefix='Q',num_units=1,fplist=['SOT?223*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='S8050',dest=TEMPLATE,tool=SKIDL,keywords='S8050 NPN Low Voltage High Current Transistor',description='20V Vce, 0.7A Ic, NPN, Low Voltage High Current Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='S8550',dest=TEMPLATE,tool=SKIDL,keywords='S8550 PNP Low Voltage High Current Transistor',description='20V Vce, 0.7A Ic, PNP Low Voltage High Current Transistor, TO-92',ref_prefix='Q',num_units=1,fplist=['TO?92*'],do_erc=True,pins=[ Pin(num='1',name='E',func=Pin.PASSIVE,do_erc=True), Pin(num='2',name='B',do_erc=True), Pin(num='3',name='C',func=Pin.PASSIVE,do_erc=True)]), Part(name='TIP120',dest=TEMPLATE,tool=SKIDL,keywords='Darlington Power Transistor NPN',description='5A Ic, 100V Vce, Silicon Darlington Power Transistor NPN, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['TIP121', 'TIP122'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='TIP125',dest=TEMPLATE,tool=SKIDL,keywords='Darlington Power Transistor PNP',description='5A Ic, 100V Vce, Silicon Darlington Power Transistor PNP, TO-220',ref_prefix='Q',num_units=1,fplist=['TO?220*'],do_erc=True,aliases=['TIP126', 'TIP127'],pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='TIP2955',dest=TEMPLATE,tool=SKIDL,keywords='PNP power transistor',description='-60V Vce, -15A Ic, PNP, Power Transistor, TO-218/TO-247',ref_prefix='Q',num_units=1,fplist=['TO?247*', 'TO?218*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)]), Part(name='TIP3055',dest=TEMPLATE,tool=SKIDL,keywords='NPN power transistor',description='60V Vce, 15A Ic, NPN, Power Transistor, TO-218/TO-247',ref_prefix='Q',num_units=1,fplist=['TO?247*', 'TO?218*'],do_erc=True,pins=[ Pin(num='1',name='B',do_erc=True), Pin(num='2',name='C',func=Pin.PASSIVE,do_erc=True), Pin(num='3',name='E',func=Pin.PASSIVE,do_erc=True)])])
99.46092
1,894
0.637517
13,873
86,531
3.886758
0.054494
0.080117
0.144211
0.108158
0.899631
0.886074
0.869568
0.853026
0.833089
0.808294
0
0.062281
0.142735
86,531
869
1,895
99.575374
0.6646
0
0
0.747405
0
0.010381
0.241359
0.003571
0
0
0
0
0
1
0
false
0.528258
0.001153
0
0.001153
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
9
97e54be806201fc10c48c6683b4643251f7cd3a4
27,393
py
Python
exavault/api/email_lists_api.py
ExaVault/evapi-python
769bfa9fbb683f2b4653ca2564029ffb72445c8c
[ "MIT" ]
null
null
null
exavault/api/email_lists_api.py
ExaVault/evapi-python
769bfa9fbb683f2b4653ca2564029ffb72445c8c
[ "MIT" ]
3
2017-07-13T20:58:05.000Z
2019-08-02T19:08:37.000Z
exavault/api/email_lists_api.py
ExaVault/evapi-python
769bfa9fbb683f2b4653ca2564029ffb72445c8c
[ "MIT" ]
4
2016-11-16T00:14:23.000Z
2020-09-24T14:50:46.000Z
# coding: utf-8 """ ExaVault API See our API reference documentation at https://www.exavault.com/developer/api-docs/ # noqa: E501 OpenAPI spec version: 2.0 Contact: support@exavault.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from exavault.api_client import ApiClient class EmailListsApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def add_email_list(self, ev_api_key, ev_access_token, **kwargs): # noqa: E501 """Create new email list # noqa: E501 Create a new email list. Among other things, email lists can be used to send files or share folders with a group of email addresses at once. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.add_email_list(ev_api_key, ev_access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param AddEmailListRequestBody body: :return: EmailListResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.add_email_list_with_http_info(ev_api_key, ev_access_token, **kwargs) # noqa: E501 else: (data) = self.add_email_list_with_http_info(ev_api_key, ev_access_token, **kwargs) # noqa: E501 return data def add_email_list_with_http_info(self, ev_api_key, ev_access_token, **kwargs): # noqa: E501 """Create new email list # noqa: E501 Create a new email list. Among other things, email lists can be used to send files or share folders with a group of email addresses at once. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.add_email_list_with_http_info(ev_api_key, ev_access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param AddEmailListRequestBody body: :return: EmailListResponse If the method is called asynchronously, returns the request thread. """ all_params = ['ev_api_key', 'ev_access_token', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method add_email_list" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'ev_api_key' is set if ('ev_api_key' not in params or params['ev_api_key'] is None): raise ValueError("Missing the required parameter `ev_api_key` when calling `add_email_list`") # noqa: E501 # verify the required parameter 'ev_access_token' is set if ('ev_access_token' not in params or params['ev_access_token'] is None): raise ValueError("Missing the required parameter `ev_access_token` when calling `add_email_list`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} if 'ev_api_key' in params: header_params['ev-api-key'] = params['ev_api_key'] # noqa: E501 if 'ev_access_token' in params: header_params['ev-access-token'] = params['ev_access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/email-lists', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='EmailListResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def delete_email_list_by_id(self, ev_api_key, ev_access_token, id, **kwargs): # noqa: E501 """Delete an email group with given id # noqa: E501 Permanently delete an email group. This action is not reversible. We recommend making a user confirm this action before sending the API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_email_list_by_id(ev_api_key, ev_access_token, id, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param int id: ID of the email list to delete (required) :return: EmptyResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, **kwargs) # noqa: E501 else: (data) = self.delete_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, **kwargs) # noqa: E501 return data def delete_email_list_by_id_with_http_info(self, ev_api_key, ev_access_token, id, **kwargs): # noqa: E501 """Delete an email group with given id # noqa: E501 Permanently delete an email group. This action is not reversible. We recommend making a user confirm this action before sending the API call. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param int id: ID of the email list to delete (required) :return: EmptyResponse If the method is called asynchronously, returns the request thread. """ all_params = ['ev_api_key', 'ev_access_token', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_email_list_by_id" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'ev_api_key' is set if ('ev_api_key' not in params or params['ev_api_key'] is None): raise ValueError("Missing the required parameter `ev_api_key` when calling `delete_email_list_by_id`") # noqa: E501 # verify the required parameter 'ev_access_token' is set if ('ev_access_token' not in params or params['ev_access_token'] is None): raise ValueError("Missing the required parameter `ev_access_token` when calling `delete_email_list_by_id`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `delete_email_list_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} if 'ev_api_key' in params: header_params['ev-api-key'] = params['ev_api_key'] # noqa: E501 if 'ev_access_token' in params: header_params['ev-access-token'] = params['ev_access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/email-lists/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='EmptyResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_email_list_by_id(self, ev_api_key, ev_access_token, id, **kwargs): # noqa: E501 """Get individual email group # noqa: E501 Retrieve all the details of a specific email list including it's name, when it was created and all the email addresses that belong to the group. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_email_list_by_id(ev_api_key, ev_access_token, id, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param int id: ID of the email list to return. (required) :param str include: Related record types to include in the response. Valid option is `ownerUser` :return: EmailListResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, **kwargs) # noqa: E501 else: (data) = self.get_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, **kwargs) # noqa: E501 return data def get_email_list_by_id_with_http_info(self, ev_api_key, ev_access_token, id, **kwargs): # noqa: E501 """Get individual email group # noqa: E501 Retrieve all the details of a specific email list including it's name, when it was created and all the email addresses that belong to the group. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param int id: ID of the email list to return. (required) :param str include: Related record types to include in the response. Valid option is `ownerUser` :return: EmailListResponse If the method is called asynchronously, returns the request thread. """ all_params = ['ev_api_key', 'ev_access_token', 'id', 'include'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_email_list_by_id" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'ev_api_key' is set if ('ev_api_key' not in params or params['ev_api_key'] is None): raise ValueError("Missing the required parameter `ev_api_key` when calling `get_email_list_by_id`") # noqa: E501 # verify the required parameter 'ev_access_token' is set if ('ev_access_token' not in params or params['ev_access_token'] is None): raise ValueError("Missing the required parameter `ev_access_token` when calling `get_email_list_by_id`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `get_email_list_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] if 'include' in params: query_params.append(('include', params['include'])) # noqa: E501 header_params = {} if 'ev_api_key' in params: header_params['ev-api-key'] = params['ev_api_key'] # noqa: E501 if 'ev_access_token' in params: header_params['ev-access-token'] = params['ev_access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/email-lists/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='EmailListResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_email_lists(self, ev_api_key, ev_access_token, **kwargs): # noqa: E501 """Get all email groups # noqa: E501 List all email groups for authenticated user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_email_lists(ev_api_key, ev_access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param str include: Related record types to include in the response. Valid option is `ownerUser` :return: EmailListCollectionResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_email_lists_with_http_info(ev_api_key, ev_access_token, **kwargs) # noqa: E501 else: (data) = self.get_email_lists_with_http_info(ev_api_key, ev_access_token, **kwargs) # noqa: E501 return data def get_email_lists_with_http_info(self, ev_api_key, ev_access_token, **kwargs): # noqa: E501 """Get all email groups # noqa: E501 List all email groups for authenticated user # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_email_lists_with_http_info(ev_api_key, ev_access_token, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param str include: Related record types to include in the response. Valid option is `ownerUser` :return: EmailListCollectionResponse If the method is called asynchronously, returns the request thread. """ all_params = ['ev_api_key', 'ev_access_token', 'include'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_email_lists" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'ev_api_key' is set if ('ev_api_key' not in params or params['ev_api_key'] is None): raise ValueError("Missing the required parameter `ev_api_key` when calling `get_email_lists`") # noqa: E501 # verify the required parameter 'ev_access_token' is set if ('ev_access_token' not in params or params['ev_access_token'] is None): raise ValueError("Missing the required parameter `ev_access_token` when calling `get_email_lists`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'include' in params: query_params.append(('include', params['include'])) # noqa: E501 header_params = {} if 'ev_api_key' in params: header_params['ev-api-key'] = params['ev_api_key'] # noqa: E501 if 'ev_access_token' in params: header_params['ev-access-token'] = params['ev_access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/email-lists', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='EmailListCollectionResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_email_list_by_id(self, ev_api_key, ev_access_token, id, **kwargs): # noqa: E501 """Update an email group # noqa: E501 Add or remove emails from an email list that can be used to send and share files with groups. **Notes** *This call will **replace** your current email list in its entirety.* If you want to keep any existing emails on the list, be sure to submit the call with any current emails you want to keep on the list. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_email_list_by_id(ev_api_key, ev_access_token, id, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param int id: ID of the email list to update. (required) :param UpdateEmailListRequestBody body: :return: EmailListResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, **kwargs) # noqa: E501 else: (data) = self.update_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, **kwargs) # noqa: E501 return data def update_email_list_by_id_with_http_info(self, ev_api_key, ev_access_token, id, **kwargs): # noqa: E501 """Update an email group # noqa: E501 Add or remove emails from an email list that can be used to send and share files with groups. **Notes** *This call will **replace** your current email list in its entirety.* If you want to keep any existing emails on the list, be sure to submit the call with any current emails you want to keep on the list. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_email_list_by_id_with_http_info(ev_api_key, ev_access_token, id, async_req=True) >>> result = thread.get() :param async_req bool :param str ev_api_key: API Key required to make the API call. (required) :param str ev_access_token: Access token required to make the API call. (required) :param int id: ID of the email list to update. (required) :param UpdateEmailListRequestBody body: :return: EmailListResponse If the method is called asynchronously, returns the request thread. """ all_params = ['ev_api_key', 'ev_access_token', 'id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_email_list_by_id" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'ev_api_key' is set if ('ev_api_key' not in params or params['ev_api_key'] is None): raise ValueError("Missing the required parameter `ev_api_key` when calling `update_email_list_by_id`") # noqa: E501 # verify the required parameter 'ev_access_token' is set if ('ev_access_token' not in params or params['ev_access_token'] is None): raise ValueError("Missing the required parameter `ev_access_token` when calling `update_email_list_by_id`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `update_email_list_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'id' in params: path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} if 'ev_api_key' in params: header_params['ev-api-key'] = params['ev_api_key'] # noqa: E501 if 'ev_access_token' in params: header_params['ev-access-token'] = params['ev_access_token'] # noqa: E501 form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/email-lists/{id}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='EmailListResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
45.884422
334
0.633775
3,567
27,393
4.609756
0.063919
0.045247
0.038922
0.021286
0.965396
0.964666
0.962902
0.956212
0.950556
0.949644
0
0.014571
0.280984
27,393
596
335
45.961409
0.820268
0.383967
0
0.800623
0
0
0.220092
0.039685
0
0
0
0
0
1
0.034268
false
0
0.012461
0
0.096573
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3f548179592f87df066062b30ad94c3fb38272ae
151
py
Python
sc_tracker/templatetags/__init__.py
SpeedConEU/speedcon_donation_tracker
9b1c9b1e95d6b93762ddc4871d9e3850f55597d3
[ "BSD-2-Clause" ]
null
null
null
sc_tracker/templatetags/__init__.py
SpeedConEU/speedcon_donation_tracker
9b1c9b1e95d6b93762ddc4871d9e3850f55597d3
[ "BSD-2-Clause" ]
null
null
null
sc_tracker/templatetags/__init__.py
SpeedConEU/speedcon_donation_tracker
9b1c9b1e95d6b93762ddc4871d9e3850f55597d3
[ "BSD-2-Clause" ]
null
null
null
import locale # specify a primitive currency-locale map locale.setlocale(locale.LC_ALL, "") locale.setlocale(locale.LC_MONETARY, ("de_DE", "utf-8"))
21.571429
56
0.754967
22
151
5.045455
0.636364
0.27027
0.378378
0.414414
0
0
0
0
0
0
0
0.007353
0.099338
151
6
57
25.166667
0.808824
0.258278
0
0
0
0
0.090909
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
7
450064961330988af3af00949311c060298ebbc0
14,442
py
Python
resistive_controlled_scheme/cadence/results/system_behavior_results/scripts_to_plot/plot_modules.py
fgr1986/rram_multilevel_driver
7715ca64df2a18bbba1021c07684f470b4f225d2
[ "MIT" ]
12
2018-04-17T02:52:07.000Z
2021-07-28T23:42:41.000Z
resistive_controlled_scheme/cadence/results/system_behavior_results/scripts_to_plot/plot_modules.py
fgr1986/rram_multilevel_driver
7715ca64df2a18bbba1021c07684f470b4f225d2
[ "MIT" ]
null
null
null
resistive_controlled_scheme/cadence/results/system_behavior_results/scripts_to_plot/plot_modules.py
fgr1986/rram_multilevel_driver
7715ca64df2a18bbba1021c07684f470b4f225d2
[ "MIT" ]
3
2019-04-12T10:09:15.000Z
2020-11-13T01:06:45.000Z
import matplotlib.pyplot as plt # import matplotlib.transforms as trn from scipy import ndimage import matplotlib.gridspec as gridspec import numpy as np import math # columns ################################################# # time (s) clk (V) start_op (V) counter_0 fsm_0 (V) fsm_1 (V) EN_RESET (V) EN_SET (V) END_RESET (V) V_WR (V) ADD V_RAW (V) V_RESET (V) V_SET (V) V_LOAD (V) V_SEL (V) LEV rram r read rram cf temp AC_0 (V) AC_1 (V) AC_2 (V) AD_0 (V) AD_1 (V) AD_2 (V) AS_0 (V) AS_1 (V) AS_2 (V) AM_0 (V) AM_1 (V) AM_2 (V) AM_3 (V) AM_4 (V) AM_5 (V) AM_6 (V) AM_7 (V) AM_8 (V) AM_9 (V) AM_10 (V) AM_11 (V) AM_12 (V) AM_13 (V) AM_14 (V) AM_15 (V) AM_16 (V) AM_17 (V) AM_18 (V) AM_19 (V) AM_20 (V) AM_21 (V) AM_22 (V) AM_23 (V) AM_24 (V) AM_25 (V) AM_26 (V) AM_27 (V) AM_28 (V) AM_29 (V) AM_30 (V) AM_31 (V) ################################################# file_in = 'system_signals.csv' # my_data = np.loadtxt(file_in, delimiter=',', skiprows=1) my_data = np.loadtxt(file_in, delimiter=',', skiprows=1) print(my_data.shape) # 50001, 58 titles = np.genfromtxt(file_in, dtype=float, delimiter=',', names=True).dtype.names for t_idx, t in enumerate(titles): print(t_idx, ' ', t) # print(my_data.shape) # titles = my_data.dtype.names # print(titles) font = {'family': 'serif', # 'color': 'darkred', 'weight': 'normal', # 'rotation:': 90, 'size': 9, } # scale data rram_r = 17 my_data[:, 0] = my_data[:, 0] * 1e9 my_data[:, rram_r] = my_data[:, rram_r] * 1e-3 ########################################### # two stage write control ########################################### # time (s) clk (V) start_op (V) counter_0 fsm_0 (V) fsm_1 (V) EN_RESET (V) EN_SET (V) inputs_to_plot = [1, 2] internal_to_plot = [3, 4, 5] outputs_to_plot = [6, 7] total_signals = inputs_to_plot + internal_to_plot + outputs_to_plot print(total_signals) plotted_columns = 1 plotted_rows = math.ceil(len(total_signals) / plotted_columns) fig, axarr = plt.subplots(plotted_rows, plotted_columns, sharex=True, # figsize=(4, 8), # dpi=300, ) p_count = 0 for s in total_signals: c = int(np.floor((p_count) / plotted_rows)) r = (p_count) % plotted_rows print('s:', s, 'r: ', r, 'c: ', c, ' ', titles[s]) color_p = 'C0' if s in inputs_to_plot: color_p = 'darkgreen' elif s in internal_to_plot: color_p = 'gray' elif s in outputs_to_plot: color_p = 'darkorange' # if s==rram_r: # ax = plt.subplot(gs[r:r+2, c]) # p_count += 1 # else: # ax = plt.subplot(gs[r, c]) # ax.locator_params(axis='y', nbins=2) if c > 1: ax = axarr[r, c] else: ax = axarr[r] ax.plot(my_data[:, 0], my_data[:, s], color=color_p) # if subplot way # ax = axarr[r, c] ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) title = titles[s].replace('_V', " [V]") title = title.replace('rram_', "rram\n") title = title.replace('r_read', "r_read [KOhm]") title = title.replace('cf_temp', "CF temp [K]") ax.set_ylabel(title, fontdict=font, rotation='horizontal', labelpad=40) ax.grid(True) # if s >= resistive_mux_idx: # ax.set_ylim([r_mux_min, r_mux_max]) if (p_count) % plotted_rows == plotted_rows - 1: print('!!!!!!!!!!!!!time!!!!!!!!!!!!!!!!!!!!!!!!!') ax.set_xlabel('time [ns]', fontdict=font, rotation='horizontal') p_count += 1 # plt.figure(figsize=(10,20)) fig = plt.gcf() fig.set_size_inches(5, 10) fig.tight_layout() fig.subplots_adjust(hspace=0.2) fig.subplots_adjust(wspace=0.6) # fig.tight_layout() # fig.canvas.draw() # fig.canvas.flush_events() # mng = plt.get_current_fig_manager() # # mng.frame.Maximize(True) # mng.full_screen_toggle() # Rotated_Plot = ndimage.rotate(fig, 90) # plt.show(Rotated_Plot) plt.savefig("two_stage_write_control.svg") plt.savefig("two_stage_write_control.png") # plt.show() plt.close() ########################################### # RRAM ########################################### # time (s) V_WR (V) V_LOAD (V) rram r read rram cf temp inputs_to_plot = [9, 14] internal_to_plot = [17, 18] outputs_to_plot = [] total_signals = inputs_to_plot + internal_to_plot + outputs_to_plot print(total_signals) plotted_columns = 1 plotted_rows = math.ceil(len(total_signals) / plotted_columns) fig, axarr = plt.subplots(plotted_rows, plotted_columns, sharex=True, # figsize=(4, 8), # dpi=300, ) p_count = 0 for s in total_signals: c = int(np.floor((p_count) / plotted_rows)) r = (p_count) % plotted_rows print('s:', s, 'r: ', r, 'c: ', c, ' ', titles[s]) color_p = 'C0' if s in inputs_to_plot: color_p = 'darkgreen' elif s in internal_to_plot: color_p = 'gray' elif s in outputs_to_plot: color_p = 'darkorange' # if s==rram_r: # ax = plt.subplot(gs[r:r+2, c]) # p_count += 1 # else: # ax = plt.subplot(gs[r, c]) # ax.locator_params(axis='y', nbins=2) if c > 1: ax = axarr[r, c] else: ax = axarr[r] ax.plot(my_data[:, 0], my_data[:, s], color=color_p) # if subplot way # ax = axarr[r, c] ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) title = titles[s].replace('_V', " [V]") title = title.replace('rram_', "rram\n") title = title.replace('r_read', "r_read [KOhm]") title = title.replace('cf_temp', "CF temp [K]") ax.set_ylabel(title, fontdict=font, rotation='horizontal', labelpad=40) ax.grid(True) # if s >= resistive_mux_idx: # ax.set_ylim([r_mux_min, r_mux_max]) if (p_count) % plotted_rows == plotted_rows - 1: print('!!!!!!!!!!!!!time!!!!!!!!!!!!!!!!!!!!!!!!!') ax.set_xlabel('time [ns]', fontdict=font, rotation='horizontal') p_count += 1 # plt.figure(figsize=(10,20)) fig = plt.gcf() fig.set_size_inches(5, 10) fig.tight_layout() fig.subplots_adjust(hspace=0.2) fig.subplots_adjust(wspace=0.6) # fig.tight_layout() # fig.canvas.draw() # fig.canvas.flush_events() # mng = plt.get_current_fig_manager() # # mng.frame.Maximize(True) # mng.full_screen_toggle() # Rotated_Plot = ndimage.rotate(fig, 90) # plt.show(Rotated_Plot) plt.savefig("rram_signals.svg") plt.savefig("rram_signals.png") # plt.show() plt.close() ########################################### # Crossbar Address Control ########################################### # time (s) V_WR (V) ADD V_LOAD (V) V_SEL (V) AC_0 (V) AC_1 (V) AC_2 (V) AD_0 (V) AD_1 (V) AD_2 (V) AS_0 (V) AS_1 (V) AS_2 (V) inputs_to_plot = [9, 14, 10] internal_to_plot = [15] outputs_to_plot = list(range(19, 28)) total_signals = inputs_to_plot + internal_to_plot + outputs_to_plot print(total_signals) plotted_columns = 1 plotted_rows = math.ceil(len(total_signals) / plotted_columns) fig, axarr = plt.subplots(plotted_rows, plotted_columns, sharex=True, # figsize=(4, 8), # dpi=300, ) p_count = 0 for s in total_signals: c = int(np.floor((p_count) / plotted_rows)) r = (p_count) % plotted_rows print('s:', s, 'r: ', r, 'c: ', c, ' ', titles[s]) color_p = 'C0' if s in inputs_to_plot: color_p = 'darkgreen' elif s in internal_to_plot: color_p = 'gray' elif s in outputs_to_plot: color_p = 'darkorange' # if s==rram_r: # ax = plt.subplot(gs[r:r+2, c]) # p_count += 1 # else: # ax = plt.subplot(gs[r, c]) # ax.locator_params(axis='y', nbins=2) if c > 1: ax = axarr[r, c] else: ax = axarr[r] ax.plot(my_data[:, 0], my_data[:, s], color=color_p) # if subplot way # ax = axarr[r, c] ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) title = titles[s].replace('_V', " [V]") title = title.replace('rram_', "rram\n") title = title.replace('r_read', "r_read [KOhm]") title = title.replace('cf_temp', "CF temp [K]") ax.set_ylabel(title, fontdict=font, rotation='horizontal', labelpad=40) ax.grid(True) # if s >= resistive_mux_idx: # ax.set_ylim([r_mux_min, r_mux_max]) if (p_count) % plotted_rows == plotted_rows - 1: print('!!!!!!!!!!!!!time!!!!!!!!!!!!!!!!!!!!!!!!!') ax.set_xlabel('time [ns]', fontdict=font, rotation='horizontal') p_count += 1 # plt.figure(figsize=(10,20)) fig = plt.gcf() fig.set_size_inches(5, 10) fig.tight_layout() fig.subplots_adjust(hspace=0.2) fig.subplots_adjust(wspace=0.6) # fig.tight_layout() # fig.canvas.draw() # fig.canvas.flush_events() # mng = plt.get_current_fig_manager() # # mng.frame.Maximize(True) # mng.full_screen_toggle() # Rotated_Plot = ndimage.rotate(fig, 90) # plt.show(Rotated_Plot) plt.savefig("crossbar_addr.svg") plt.savefig("crossbar_addr.png") # plt.show() plt.close() ########################################### # Voltage Current Control ########################################### # time (s) EN_RESET (V) EN_SET (V) END_RESET (V) V_RAW (V) V_RESET (V) V_SET (V) V_WR (V) inputs_to_plot = [6, 7, 8, 11] internal_to_plot = [12, 13] outputs_to_plot = [9] total_signals = inputs_to_plot + internal_to_plot + outputs_to_plot print(total_signals) plotted_columns = 1 plotted_rows = math.ceil(len(total_signals) / plotted_columns) fig, axarr = plt.subplots(plotted_rows, plotted_columns, sharex=True, # figsize=(4, 8), # dpi=300, ) p_count = 0 for s in total_signals: c = int(np.floor((p_count) / plotted_rows)) r = (p_count) % plotted_rows print('s:', s, 'r: ', r, 'c: ', c, ' ', titles[s]) color_p = 'C0' if s in inputs_to_plot: color_p = 'darkgreen' elif s in internal_to_plot: color_p = 'gray' elif s in outputs_to_plot: color_p = 'darkorange' # if s==rram_r: # ax = plt.subplot(gs[r:r+2, c]) # p_count += 1 # else: # ax = plt.subplot(gs[r, c]) # ax.locator_params(axis='y', nbins=2) if c > 1: ax = axarr[r, c] else: ax = axarr[r] ax.plot(my_data[:, 0], my_data[:, s], color=color_p) # if subplot way # ax = axarr[r, c] ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) title = titles[s].replace('_V', " [V]") title = title.replace('rram_', "rram\n") title = title.replace('r_read', "r_read [KOhm]") title = title.replace('cf_temp', "CF temp [K]") ax.set_ylabel(title, fontdict=font, rotation='horizontal', labelpad=40) ax.grid(True) # if s >= resistive_mux_idx: # ax.set_ylim([r_mux_min, r_mux_max]) if (p_count) % plotted_rows == plotted_rows - 1: print('!!!!!!!!!!!!!time!!!!!!!!!!!!!!!!!!!!!!!!!') ax.set_xlabel('time [ns]', fontdict=font, rotation='horizontal') p_count += 1 # plt.figure(figsize=(10,20)) fig = plt.gcf() fig.set_size_inches(5, 10) fig.tight_layout() fig.subplots_adjust(hspace=0.2) fig.subplots_adjust(wspace=0.6) # fig.tight_layout() # fig.canvas.draw() # fig.canvas.flush_events() # mng = plt.get_current_fig_manager() # # mng.frame.Maximize(True) # mng.full_screen_toggle() # Rotated_Plot = ndimage.rotate(fig, 90) # plt.show(Rotated_Plot) plt.savefig("voltage_current_control.svg") plt.savefig("voltage_current_control.png") # plt.show() plt.close() ########################################### # R_loads / A.Mux ########################################### # time (s) EN_RESET (V) EN_SET (V) V_LOAD (V) LEV AM_0 (V) AM_1 (V) AM_2 (V) AM_3 (V) AM_4 (V) AM_5 (V) AM_6 (V) AM_7 (V) AM_8 (V) AM_9 (V) AM_10 (V) AM_11 (V) AM_12 (V) AM_13 (V) AM_14 (V) AM_15 (V) AM_16 (V) AM_17 (V) AM_18 (V) AM_19 (V) AM_20 (V) AM_21 (V) AM_22 (V) AM_23 (V) AM_24 (V) AM_25 (V) AM_26 (V) AM_27 (V) AM_28 (V) AM_29 (V) AM_30 (V) AM_31 (V) inputs_to_plot = [6, 7, 14, 16] internal_to_plot = [] outputs_to_plot = list(range(28, 60)) total_signals = inputs_to_plot + internal_to_plot + outputs_to_plot print(total_signals) plotted_columns = 2 plotted_rows = math.ceil(len(total_signals) / plotted_columns) fig, axarr = plt.subplots(plotted_rows, plotted_columns, sharex=True, # figsize=(4, 8), # dpi=300, ) p_count = 0 for s in total_signals: c = int(np.floor((p_count) / plotted_rows)) r = (p_count) % plotted_rows print('s:', s, 'r: ', r, 'c: ', c, ' ', titles[s]) color_p = 'C0' if s in inputs_to_plot: color_p = 'darkgreen' elif s in internal_to_plot: color_p = 'gray' elif s in outputs_to_plot: color_p = 'darkorange' # if s==rram_r: # ax = plt.subplot(gs[r:r+2, c]) # p_count += 1 # else: # ax = plt.subplot(gs[r, c]) # ax.locator_params(axis='y', nbins=2) if plotted_columns > 1: ax = axarr[r, c] else: ax = axarr[r] ax.plot(my_data[:, 0], my_data[:, s], color=color_p) # if subplot way # ax = axarr[r, c] ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) title = titles[s].replace('_V', " [V]") title = title.replace('rram_', "rram\n") title = title.replace('r_read', "r_read [KOhm]") title = title.replace('cf_temp', "CF temp [K]") ax.set_ylabel(title, fontdict=font, rotation='horizontal', labelpad=40) ax.grid(True) # if s >= resistive_mux_idx: # ax.set_ylim([r_mux_min, r_mux_max]) if (p_count) % plotted_rows == plotted_rows - 1: print('!!!!!!!!!!!!!time!!!!!!!!!!!!!!!!!!!!!!!!!') ax.set_xlabel('time [ns]', fontdict=font, rotation='horizontal') p_count += 1 # plt.figure(figsize=(10,20)) fig = plt.gcf() fig.set_size_inches(8, 10) fig.tight_layout() fig.subplots_adjust(hspace=0.2) fig.subplots_adjust(wspace=0.6) # fig.tight_layout() # fig.canvas.draw() # fig.canvas.flush_events() # mng = plt.get_current_fig_manager() # # mng.frame.Maximize(True) # mng.full_screen_toggle() # Rotated_Plot = ndimage.rotate(fig, 90) # plt.show(Rotated_Plot) plt.savefig("rloads.svg") plt.savefig("rloads.png") # plt.show() plt.close()
30.72766
585
0.578244
2,224
14,442
3.516187
0.095773
0.024169
0.023018
0.032609
0.899233
0.87289
0.846292
0.846292
0.843223
0.833248
0
0.030817
0.22033
14,442
469
586
30.793177
0.663677
0.289711
0
0.795276
0
0
0.112269
0.033149
0
0
0
0
0
1
0
false
0
0.019685
0
0.019685
0.066929
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
451c39f592766554c119f208e2d00bc8c89d7e3c
1,428
py
Python
src/arch/x86/isa/insts/simd512/floating_point/arithmetic/vaddpd.py
jyhuang91/gem5-avx
f988da46080f8db49beb39e20af437219f3aa4cb
[ "BSD-3-Clause" ]
2
2021-01-15T17:32:18.000Z
2021-12-21T02:53:58.000Z
src/arch/x86/isa/insts/simd512/floating_point/arithmetic/vaddpd.py
jyhuang91/gem5-avx
f988da46080f8db49beb39e20af437219f3aa4cb
[ "BSD-3-Clause" ]
3
2021-03-26T20:33:59.000Z
2022-01-24T22:54:03.000Z
src/arch/x86/isa/insts/simd512/floating_point/arithmetic/vaddpd.py
jyhuang91/gem5-avx
f988da46080f8db49beb39e20af437219f3aa4cb
[ "BSD-3-Clause" ]
3
2021-03-27T16:36:19.000Z
2022-03-28T18:32:57.000Z
microcode = ''' def macroop VADDPD_XMM_XMM { vaddf dest=xmm0, src1=xmm0v, src2=xmm0m, size=8, VL=16 vclear dest=xmm2, destVL=16 }; def macroop VADDPD_XMM_M { ldfp128 ufp1, seg, sib, "DISPLACEMENT + 0", dataSize=16 vaddf dest=xmm0, src1=xmm0v, src2=ufp1, size=8, VL=16 vclear dest=xmm2, destVL=16 }; def macroop VADDPD_XMM_P { rdip t7 ldfp128 ufp1, seg, riprel, "DISPLACEMENT + 0", dataSize=16 vaddf dest=xmm0, src1=xmm0v, src2=ufp1, size=8, VL=16 vclear dest=xmm2, destVL=16 }; def macroop VADDPD_YMM_YMM { vaddf dest=xmm0, src1=xmm0v, src2=xmm0m, size=8, VL=32 vclear dest=xmm4, destVL=32 }; def macroop VADDPD_YMM_M { ldfp256 ufp1, seg, sib, "DISPLACEMENT + 0", dataSize=32 vaddf dest=xmm0, src1=xmm0v, src2=ufp1, size=8, VL=32 vclear dest=xmm4, destVL=32 }; def macroop VADDPD_YMM_P { rdip t7 ldfp256 ufp1, seg, riprel, "DISPLACEMENT + 0", dataSize=32 vaddf dest=xmm0, src1=xmm0v, src2=ufp1, size=8, VL=32 vclear dest=xmm4, destVL=32 }; def macroop VADDPD_ZMM_ZMM { vaddf dest=xmm0, src1=xmm0v, src2=xmm0m, size=8, VL=64 }; def macroop VADDPD_ZMM_M { ldfp512 ufp1, seg, sib, "DISPLACEMENT + 0", dataSize=64 vaddf dest=xmm0, src1=xmm0v, src2=ufp1, size=8, VL=64 }; def macroop VADDPD_ZMM_P { rdip t7 ldfp512 ufp1, seg, riprel, "DISPLACEMENT + 0", dataSize=64 vaddf dest=xmm0, src1=xmm0v, src2=ufp1, size=8, VL=64 }; '''
25.963636
62
0.676471
229
1,428
4.139738
0.165939
0.094937
0.151899
0.161392
0.885021
0.885021
0.812236
0.812236
0.770042
0.770042
0
0.117698
0.196779
1,428
54
63
26.444444
0.708806
0
0
0.545455
0
0
0.986685
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
18bb87814b58a9e8291edb438ae5201656db2c39
968
py
Python
usr/decorators.py
exile-co/Bee
ad318f8c126ed461659bd8693112644aef3e56ed
[ "MIT" ]
null
null
null
usr/decorators.py
exile-co/Bee
ad318f8c126ed461659bd8693112644aef3e56ed
[ "MIT" ]
null
null
null
usr/decorators.py
exile-co/Bee
ad318f8c126ed461659bd8693112644aef3e56ed
[ "MIT" ]
1
2015-11-09T17:01:59.000Z
2015-11-09T17:01:59.000Z
# -*- encoding: utf8 -*- from django.shortcuts import redirect from services import UsrService def cliente(view): def func(request, *args, **kwargs): usr = UsrService.get_instance() if usr.es_cliente(request): return view(request, *args, **kwargs) else: return redirect("/") #end if #end def return func #end def def desarrollador(view): def func(request, *args, **kwargs): usr = UsrService.get_instance() if usr.es_desarrollador(request): return view(request, *args, **kwargs) else: return redirect("/") #end if #end def return func #end def def usuario(view): def func(request, *args, **kwargs): usr = UsrService.get_instance() if usr.es_usuario(request): return view(request, *args, **kwargs) else: return redirect("/") #end if #end def return func #end def
24.2
49
0.57438
110
968
5
0.236364
0.12
0.185455
0.098182
0.763636
0.763636
0.763636
0.763636
0.763636
0.763636
0
0.001493
0.307851
968
40
50
24.2
0.819403
0.084711
0
0.692308
0
0
0.003425
0
0
0
0
0
0
1
0.230769
false
0
0.076923
0
0.653846
0
0
0
0
null
0
1
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
8
18ebb7c22766a8050f0c7265f05465da3a235b9b
6,836
py
Python
python-backend/tests/status/models/test_mine_status_code_model.py
MaxWardle/mds
15d8405e6e95af98da9588f353c5d6692d1aa3d6
[ "Apache-2.0" ]
null
null
null
python-backend/tests/status/models/test_mine_status_code_model.py
MaxWardle/mds
15d8405e6e95af98da9588f353c5d6692d1aa3d6
[ "Apache-2.0" ]
null
null
null
python-backend/tests/status/models/test_mine_status_code_model.py
MaxWardle/mds
15d8405e6e95af98da9588f353c5d6692d1aa3d6
[ "Apache-2.0" ]
1
2019-01-12T23:44:13.000Z
2019-01-12T23:44:13.000Z
import pytest from app.api.constants import MINE_OPERATION_STATUS, MINE_OPERATION_STATUS_REASON, MINE_OPERATION_STATUS_SUB_REASON from app.api.mines.status.models.mine_operation_status_code import MineOperationStatusCode from app.api.mines.status.models.mine_operation_status_reason_code import MineOperationStatusReasonCode from app.api.mines.status.models.mine_operation_status_sub_reason_code import MineOperationStatusSubReasonCode # MineOperationStatusCode Model def test_mine_operation_status_code_find_by_mine_operation_status_code(test_client, auth_headers): mine_operation_status_code = MineOperationStatusCode.find_by_mine_operation_status_code(MINE_OPERATION_STATUS['closed']['value']) assert mine_operation_status_code.mine_operation_status_code == MINE_OPERATION_STATUS['closed']['value'] def test_mine_operation_status_code_validate_mine_operation_status_code_not_provided(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusCode( mine_operation_status_code='', description='test_description', display_order=1 ) assert 'Mine operation status code is not provided.' in str(e.value) def test_mine_operation_status_code_validate_mine_operation_status_code_max_char(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusCode( mine_operation_status_code='1234', description='test_description', display_order=1 ) assert 'Mine operation status code must not exceed 3 characters.' in str(e.value) def test_mine_operation_status_code_validate_description_not_provided(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusCode( mine_operation_status_code='123', description='', display_order=1 ) assert 'Mine operation status code description is not provided.' in str(e.value) def test_mine_operation_status_code_validate_description_max_char(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusCode( mine_operation_status_code='123', description=''.join(['{}'.format(x) for x in range(100)]), display_order=1 ) assert 'Mine operation status code description must not exceed 100 characters.' in str(e.value) # MineOperationStatusReasonCode def test_mine_operation_status_reason_code_find_by_mine_operation_status_reason_code(test_client, auth_headers): mine_operation_status_reason_code = MineOperationStatusReasonCode.find_by_mine_operation_status_reason_code(MINE_OPERATION_STATUS_REASON['reclamation']['value']) assert mine_operation_status_reason_code.mine_operation_status_reason_code == MINE_OPERATION_STATUS_REASON['reclamation']['value'] def test_mine_operation_status_code_validate_mine_operation_status_reason_code_not_provided(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusReasonCode( mine_operation_status_reason_code='', description='test_description', display_order=1 ) assert 'Mine operation status reason code is not provided.' in str(e.value) def test_mine_operation_status_code_validate_mine_operation_status_reason_code_max_char(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusReasonCode( mine_operation_status_reason_code='1234', description='test_description', display_order=1 ) assert 'Mine operation status reason code must not exceed 3 characters.' in str(e.value) def test_mine_operation_status_reason_code_validate_description_not_provided(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusReasonCode( mine_operation_status_reason_code='123', description='', display_order=1 ) assert 'Mine operation status reason code description is not provided.' in str(e.value) def test_mine_operation_status_reason_code_validate_description_max_char(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusReasonCode( mine_operation_status_reason_code='123', description=''.join(['{}'.format(x) for x in range(100)]), display_order=1 ) assert 'Mine operation status reason code description must not exceed 100 characters.' in str(e.value) # MineOperationStatusSubReasonCode def test_mine_operation_status_reason_code_find_by_mine_operation_status_sub_reason_code(test_client, auth_headers): mine_operation_status_sub_reason_code = MineOperationStatusSubReasonCode.find_by_mine_operation_status_sub_reason_code(MINE_OPERATION_STATUS_SUB_REASON['long_term_maintenance']['value']) assert mine_operation_status_sub_reason_code.mine_operation_status_sub_reason_code == MINE_OPERATION_STATUS_SUB_REASON['long_term_maintenance']['value'] def test_mine_operation_status_code_validate_mine_operation_status_sub_reason_code_not_provided(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusSubReasonCode( mine_operation_status_sub_reason_code='', description='test_description', display_order=1 ) assert 'Mine operation status sub reason code is not provided.' in str(e.value) def test_mine_operation_status_code_validate_mine_operation_status_sub_reason_code_max_char(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusSubReasonCode( mine_operation_status_sub_reason_code='1234', description='test_description', display_order=1 ) assert 'Mine operation status sub reason code must not exceed 3 characters.' in str(e.value) def test_mine_operation_status_sub_reason_code_validate_description_not_provided(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusSubReasonCode( mine_operation_status_sub_reason_code='123', description='', display_order=1 ) assert 'Mine operation status sub reason code description is not provided.' in str(e.value) def test_mine_operation_status_sub_reason_code_validate_description_max_char(test_client, auth_headers): with pytest.raises(AssertionError) as e: MineOperationStatusSubReasonCode( mine_operation_status_sub_reason_code='123', description=''.join(['{}'.format(x) for x in range(100)]), display_order=1 ) assert 'Mine operation status sub reason code description must not exceed 100 characters.' in str(e.value)
47.144828
190
0.768432
836
6,836
5.860048
0.072967
0.191059
0.279241
0.117371
0.925699
0.914676
0.895693
0.888549
0.87773
0.802613
0
0.011057
0.166472
6,836
144
191
47.472222
0.848719
0.013458
0
0.490909
0
0
0.145697
0.006231
0
0
0
0
0.245455
1
0.136364
false
0
0.045455
0
0.181818
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
e1478c76820f996c5dcc20bc9500baa2da423e18
1,145
py
Python
sims-2/em-shock-1d/s2/plot-frames.py
ammarhakim/ammar-simjournal
85b64ddc9556f01a4fab37977864a7d878eac637
[ "MIT", "Unlicense" ]
1
2019-12-19T16:21:13.000Z
2019-12-19T16:21:13.000Z
sims-2/em-shock-1d/s2/plot-frames.py
ammarhakim/ammar-simjournal
85b64ddc9556f01a4fab37977864a7d878eac637
[ "MIT", "Unlicense" ]
null
null
null
sims-2/em-shock-1d/s2/plot-frames.py
ammarhakim/ammar-simjournal
85b64ddc9556f01a4fab37977864a7d878eac637
[ "MIT", "Unlicense" ]
2
2020-01-08T06:23:33.000Z
2020-01-08T07:06:50.000Z
from pylab import * import gkedata import gkedgbasis for i in range(0,51): print("Working on %d ..." % i) d = gkedata.GkeData("s2-em-shock_distfElc_%d.h5" % i) dg = gkedgbasis.GkeDgSerendipNorm3DPolyOrder2Basis(d) X, Y, Z, fv = dg.project(0) nx, nvx, nvy = X.shape[0], X.shape[1], X.shape[2] figure(1) subplot(2,1,1) pcolormesh(transpose(fv[:,:,nvy/2])) axis('tight') colorbar() subplot(2,1,2) pcolormesh(transpose(fv[:,nvx/2,:])) axis('tight') colorbar() savefig('s2-em-shock_distfElc_X_VX_%05d.png' % i) close() d.close() for i in range(0,51): print("Working on %d ..." % i) d = gkedata.GkeData("s2-em-shock_distfIon_%d.h5" % i) dg = gkedgbasis.GkeDgSerendipNorm3DPolyOrder2Basis(d) X, Y, Z, fv = dg.project(0) nx, nvx, nvy = X.shape[0], X.shape[1], X.shape[2] figure(1) subplot(2,1,1) pcolormesh(transpose(fv[:,:,nvy/2])) axis('tight') colorbar() subplot(2,1,2) pcolormesh(transpose(fv[:,nvx/2,:])) axis('tight') colorbar() savefig('s2-em-shock_distfIon_X_VX_%05d.png' % i) close() d.close()
27.261905
57
0.595633
173
1,145
3.872832
0.265896
0.053731
0.053731
0.107463
0.886567
0.886567
0.886567
0.886567
0.823881
0.823881
0
0.051282
0.216594
1,145
41
58
27.926829
0.695652
0
0
0.820513
0
0
0.151965
0.104803
0
0
0
0
0
1
0
false
0
0.076923
0
0.076923
0.051282
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
e1be7a23b4e1a0109646664c964d842b3771b9d2
21,066
py
Python
camomilla/migrations/0001_initial.py
lotrekagency/camomilla
549892f95a97df5f8bacd3a54b074e16020bda65
[ "MIT" ]
4
2021-05-11T20:17:58.000Z
2022-02-03T11:51:19.000Z
camomilla/migrations/0001_initial.py
lotrekagency/camomilla
549892f95a97df5f8bacd3a54b074e16020bda65
[ "MIT" ]
3
2022-01-04T10:31:42.000Z
2022-01-21T12:51:16.000Z
camomilla/migrations/0001_initial.py
lotrekagency/camomilla
549892f95a97df5f8bacd3a54b074e16020bda65
[ "MIT" ]
2
2022-02-03T11:51:23.000Z
2022-03-23T16:52:29.000Z
# Generated by Django 2.2.6 on 2019-10-10 17:00 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.db.models.manager class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="Category", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ], options={ "verbose_name_plural": "categories", "abstract": False, }, managers=[ ("objects", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.CreateModel( name="Media", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("file", models.FileField(upload_to="")), ( "thumbnail", models.ImageField( blank=True, max_length=500, null=True, upload_to="thumbnails" ), ), ("created", models.DateTimeField(auto_now=True)), ("name", models.CharField(blank=True, max_length=200, null=True)), ("size", models.IntegerField(blank=True, default=0, null=True)), ("is_image", models.BooleanField(default=False)), ], options={ "ordering": ["-pk"], }, managers=[ ("objects", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.CreateModel( name="MediaFolder", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("slug", models.SlugField()), ("creation_date", models.DateTimeField(auto_now_add=True)), ("last_modified", models.DateTimeField(auto_now=True)), ( "icon", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="camomilla.Media", verbose_name="Image cover", ), ), ( "updir", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to="camomilla.MediaFolder", ), ), ], options={ "abstract": False, }, managers=[ ("objects", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.CreateModel( name="Page", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("identifier", models.CharField(max_length=200, unique=True)), ( "og_image", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="camomilla_page_related", to="camomilla.Media", ), ), ], options={ "verbose_name": "Page", "verbose_name_plural": "Pages", "abstract": False, }, managers=[ ("objects", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.CreateModel( name="Tag", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ], options={ "abstract": False, }, managers=[ ("objects", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.AddField( model_name="media", name="folder", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name="media_folder", to="camomilla.MediaFolder", ), ), migrations.CreateModel( name="Content", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("identifier", models.CharField(max_length=200)), ( "page", models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="contents", to="camomilla.Page", ), ), ], options={ "abstract": False, "unique_together": {("page", "identifier")}, }, managers=[ ("objects", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.CreateModel( name="Article", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("trash", models.BooleanField(default=False)), ("identifier", models.CharField(max_length=200, unique=True)), ( "status", models.CharField( choices=[ ("PUB", "Published"), ("DRF", "Draft"), ("TRS", "Trash"), ("PLA", "Planned"), ], default="DRF", max_length=3, ), ), ("date", models.DateTimeField(auto_now=True)), ("pubblication_date", models.DateTimeField(blank=True, null=True)), ( "author", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, ), ), ( "categories", models.ManyToManyField(blank=True, to="camomilla.Category"), ), ( "highlight_image", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="camomilla.Media", ), ), ( "og_image", models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="camomilla_article_related", to="camomilla.Media", ), ), ("tags", models.ManyToManyField(blank=True, to="camomilla.Tag")), ], options={ "abstract": False, }, managers=[ ("trashmanager", django.db.models.manager.Manager()), ("_plain_manager", django.db.models.manager.Manager()), ], ), migrations.CreateModel( name="TagTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("title", models.CharField(max_length=200)), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.Tag", ), ), ], options={ "db_table": "camomilla_tag_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": { ("language_code", "master"), ("title", "language_code"), }, }, ), migrations.CreateModel( name="PageTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("title", models.CharField(max_length=200)), ("description", models.TextField(blank=True, default="", null=True)), ("permalink", models.CharField(blank=True, max_length=200)), ("og_description", models.TextField(blank=True, default="", null=True)), ( "og_title", models.CharField(blank=True, default="", max_length=200, null=True), ), ( "og_type", models.CharField(blank=True, default="", max_length=200, null=True), ), ( "og_url", models.CharField(blank=True, default="", max_length=200, null=True), ), ( "canonical", models.CharField(blank=True, default="", max_length=200, null=True), ), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.Page", ), ), ], options={ "db_table": "camomilla_page_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": {("language_code", "master")}, }, ), migrations.CreateModel( name="MediaTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("alt_text", models.CharField(blank=True, max_length=200, null=True)), ("title", models.CharField(blank=True, max_length=200, null=True)), ("description", models.TextField(blank=True, null=True)), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.Media", ), ), ], options={ "db_table": "camomilla_media_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": {("language_code", "master")}, }, ), migrations.CreateModel( name="MediaFolderTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "description", models.CharField(blank=True, max_length=200, null=True), ), ("title", models.CharField(blank=True, max_length=200, null=True)), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.MediaFolder", ), ), ], options={ "db_table": "camomilla_mediafolder_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": {("language_code", "master")}, }, ), migrations.CreateModel( name="ContentTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("title", models.CharField(max_length=200)), ( "subtitle", models.CharField(blank=True, default="", max_length=200, null=True), ), ("permalink", models.CharField(blank=True, max_length=200, null=True)), ("content", models.TextField()), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.Content", ), ), ], options={ "db_table": "camomilla_content_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": {("language_code", "master")}, }, ), migrations.CreateModel( name="CategoryTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("title", models.CharField(max_length=200)), ("description", models.TextField(blank=True, default="", null=True)), ("slug", models.SlugField()), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.Category", ), ), ], options={ "db_table": "camomilla_category_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": { ("language_code", "master"), ("title", "language_code"), }, }, ), migrations.CreateModel( name="ArticleTranslation", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("title", models.CharField(max_length=200)), ("description", models.TextField(blank=True, default="", null=True)), ("permalink", models.CharField(blank=True, max_length=200)), ("og_description", models.TextField(blank=True, default="", null=True)), ( "og_title", models.CharField(blank=True, default="", max_length=200, null=True), ), ( "og_type", models.CharField(blank=True, default="", max_length=200, null=True), ), ( "og_url", models.CharField(blank=True, default="", max_length=200, null=True), ), ( "canonical", models.CharField(blank=True, default="", max_length=200, null=True), ), ("content", models.TextField()), ("language_code", models.CharField(db_index=True, max_length=15)), ( "master", models.ForeignKey( editable=False, on_delete=django.db.models.deletion.CASCADE, related_name="translations", to="camomilla.Article", ), ), ], options={ "db_table": "camomilla_article_translation", "db_tablespace": "", "abstract": False, "managed": True, "default_permissions": (), "unique_together": { ("permalink", "language_code"), ("language_code", "master"), }, }, ), ]
36.446367
88
0.385882
1,360
21,066
5.808824
0.111765
0.039873
0.054937
0.051646
0.785949
0.765823
0.755443
0.755443
0.748228
0.741266
0
0.010469
0.505744
21,066
577
89
36.509532
0.748271
0.002136
0
0.740351
1
0
0.117132
0.015748
0
0
0
0
0
1
0
false
0
0.007018
0
0.014035
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
bed55aea44c73d41fe3c58d87c12ba33d087f7cf
2,510
py
Python
tests/test_06_math/test_613_point_in_poygon.py
jpsantos-mf/ezdxf
2b542a551b2cfc3c0920a5dbf302ff58cea90fbd
[ "MIT" ]
1
2021-06-05T09:15:15.000Z
2021-06-05T09:15:15.000Z
tests/test_06_math/test_613_point_in_poygon.py
jpsantos-mf/ezdxf
2b542a551b2cfc3c0920a5dbf302ff58cea90fbd
[ "MIT" ]
null
null
null
tests/test_06_math/test_613_point_in_poygon.py
jpsantos-mf/ezdxf
2b542a551b2cfc3c0920a5dbf302ff58cea90fbd
[ "MIT" ]
null
null
null
# Copyright (c) 2020, Manfred Moitzi # License: MIT License import pytest from ezdxf.math import is_point_in_polygon_2d, Vec2 def test_inside_horiz_box(): square = Vec2.list([(0, 0), (1, 0), (1, 1), (0, 1)]) assert is_point_in_polygon_2d(Vec2(.5, .5), square) == 1 def test_outside_horiz_box(): square = Vec2.list([(0, 0), (1, 0), (1, 1), (0, 1)]) assert is_point_in_polygon_2d(Vec2(-.5, .5), square) == -1 assert is_point_in_polygon_2d(Vec2(1.5, .5), square) == -1 assert is_point_in_polygon_2d(Vec2(0.5, -.5), square) == -1 assert is_point_in_polygon_2d(Vec2(0.5, 1.5), square) == -1 def test_colinear_outside_horiz_box(): square = Vec2.list([(0, 0), (1, 0), (1, 1), (0, 1)]) assert is_point_in_polygon_2d(Vec2(1.5, 0), square) == -1 assert is_point_in_polygon_2d(Vec2(-.5, 0), square) == -1 assert is_point_in_polygon_2d(Vec2(0, 1.5), square) == -1 assert is_point_in_polygon_2d(Vec2(0, -.5), square) == -1 def test_corners_horiz_box(): square = Vec2.list([(0, 0), (1, 0), (1, 1), (0, 1)]) assert is_point_in_polygon_2d(Vec2(0, 0), square) == 0 assert is_point_in_polygon_2d(Vec2(0, 1), square) == 0 assert is_point_in_polygon_2d(Vec2(1, 1), square) == 0 assert is_point_in_polygon_2d(Vec2(0, 1), square) == 0 def test_inside_slanted_box(): square = Vec2.list([(0, 0), (1, 1), (0, 2), (-1, 1)]) assert is_point_in_polygon_2d(Vec2(0, 1), square) == 1 def test_outside_slanted_box(): square = Vec2.list([(0, 0), (1, 1), (0, 2), (-1, 1)]) assert is_point_in_polygon_2d(Vec2(-1, 0), square) == -1 assert is_point_in_polygon_2d(Vec2(1, 0), square) == -1 assert is_point_in_polygon_2d(Vec2(1, 2), square) == -1 assert is_point_in_polygon_2d(Vec2(-1, 2), square) == -1 def test_corners_slanted_box(): square = Vec2.list([(0, 0), (1, 1), (0, 2), (-1, 1)]) assert is_point_in_polygon_2d(Vec2(0, 0), square) == 0 assert is_point_in_polygon_2d(Vec2(1, 1), square) == 0 assert is_point_in_polygon_2d(Vec2(0, 2), square) == 0 assert is_point_in_polygon_2d(Vec2(-1, 1), square) == 0 def test_borders_slanted_box_stable(): square = Vec2.list([(0, 0), (1, 1), (0, 2), (-1, 1)]) assert is_point_in_polygon_2d(Vec2(0.5, 0.5), square) == 0 assert is_point_in_polygon_2d(Vec2(0.5, 1.5), square) == 0 assert is_point_in_polygon_2d(Vec2(-.5, 1.5), square) == 0 assert is_point_in_polygon_2d(Vec2(-.5, 0.5), square) == 0 if __name__ == '__main__': pytest.main([__file__])
37.462687
63
0.642629
454
2,510
3.231278
0.088106
0.128834
0.165644
0.294479
0.897751
0.837764
0.822768
0.822768
0.822768
0.822086
0
0.105871
0.172112
2,510
66
64
38.030303
0.600096
0.021912
0
0.304348
0
0
0.003263
0
0
0
0
0
0.565217
1
0.173913
false
0
0.043478
0
0.217391
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
55dbbb0c78fad854560bac497605bbc08ce79dcc
9,956
py
Python
interface_project_for_dev/interface/APIUnittestTestCase.py
yzypals/AutoTestingPlatform
cfb2c53337406347fad37bd65568b22cdc76fdca
[ "Apache-2.0" ]
null
null
null
interface_project_for_dev/interface/APIUnittestTestCase.py
yzypals/AutoTestingPlatform
cfb2c53337406347fad37bd65568b22cdc76fdca
[ "Apache-2.0" ]
2
2020-06-06T00:51:32.000Z
2021-06-10T22:40:50.000Z
interface_project_for_dev/interface/APIUnittestTestCase.py
yzypals/AutoTestingPlatform
cfb2c53337406347fad37bd65568b22cdc76fdca
[ "Apache-2.0" ]
1
2020-05-31T03:49:24.000Z
2020-05-31T03:49:24.000Z
#!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = 'shouke' import urllib.request import json import chardet import re import copy #from html.parser import HTMLParser from collections import OrderedDict import platform python_version = platform.python_version() if python_version < '3.5': from html.parser import HTMLParser else: from html import unescape from common.log import logger from unittesttestcase import MyUnittestTestCase __all__ = ['APIUnittestTestCase'] class APIUnittestTestCase(MyUnittestTestCase): def test_api_for_urlencode(self): # 针对请求体为url编码的:b'id=1318&password=e10adc3949ba59abbe56e057f20f883e' try: method = self.request_method.lower() try: input_params_copy = copy.deepcopy(self.input_params) # 兼容旧版程序,旧数据, 吧json形式的数据,转为url编码 形如:把 {"id":1318,"password":"e10adc3949ba59abbe56e057f20f883e"} 转为 b'id=1318&password=e10adc3949ba59abbe56e057f20f883e' if self.input_params: self.input_params = json.loads(self.input_params, object_pairs_hook=OrderedDict) self.input_params = urllib.parse.urlencode(self.input_params) # 将参数转为url编码字符串# 注意,此处params为必须为字典类型的数据 except Exception as e: result = input_params_copy.split('安全模式')[:] if len(result) > 1: self.input_params, safe = result else: self.input_params = result[0] safe = '' self.input_params = self.input_params.strip() safe = safe.replace(' ', '').strip() if safe == '': self.input_params = urllib.parse.quote(self.input_params, safe='&=') # 将参数转为url编码字符串 elif safe != '' and safe != '无': logger.info('配置的安全模式为:%s' % safe) self.input_params = urllib.parse.quote(self.input_params, safe=safe) elif safe == '无': self.input_params = urllib.parse.quote(self.input_params) except Exception as e: logger.error('%s' % e) msg = 'fail#%s' % e self.assertEqual(1, 0, msg=msg) if method == 'post': logger.info('正在发起POST请求...') self.input_params = self.input_params.encode('utf-8') response = self.http.post(self.url_or_sql, self.input_params) elif method == 'get': logger.info('正在发起GET请求...') response = self.http.get(self.url_or_sql, self.input_params) # if not response[0]: # msg = 'fail#%s' % response[1] # self.assertEqual(1, 0, msg=msg) body = response[0] if response[0]: encoding = chardet.detect(response[0])['encoding'] logger.info('检测到的编码为:%s, 正在对服务器返回body进行解码' % encoding) if encoding: if encoding.lower() in ('gb2312', 'windows-1252', 'iso-8859-1'): body = response[0].decode('gbk') # decode函数对获取的字节数据进行解码 elif encoding.lower() in ('utf-8', 'utf-8-sig', 'iso-8859-2'): body = response[0].decode('utf-8') elif encoding.lower() == 'ascii': body = response[0].decode('unicode_escape') else: logger.info('解码失败,未知编码:%s,不对body做任何解码' % encoding) body = response[0] if python_version < '3.5': parser = HTMLParser() body = parser.unescape(body) # 处理html实体 else: body = unescape(body) header = response[1] code = response[2] logger.info('服务器返回结果"响应体(body)": %s' % body) logger.info('服务器返回结果"请求头(headers)": %s' % header) logger.info('服务器返回结果"状态码(code)": %s' % code) else: body, header,code = response[1], response[1], response[1] if self.response_to_check == 'body': logger.info('正在提取目标返回结果值') self.save_result(body) logger.info('正在执行断言') self.assert_result(body) elif self.response_to_check == 'header': logger.info('正在提取目标返回结果值') self.save_result(header) logger.info('正在执行断言') self.assert_result(header) elif self.response_to_check == 'code': logger.info('正在提取目标返回结果值') self.save_result(code) logger.info('正在执行断言') self.assert_result(code) def test_api_for_json(self): # 针对请求体为json格式(类型:字符串)的 method = self.request_method.lower() if method == 'post': logger.info('正在发起POST请求...') # self.input_params = json.dumps(self.input_params) # 将参数转为json格式字符串 # 替换键或者值的单引号为双引号 match_list = re.findall('["|\']\s*:\s*["|\']', self.input_params) for match in match_list: if match.find("'") != -1: self.input_params = self.input_params.replace(match, match.replace("'", '"')) match_list = re.findall('["|\']\s*}\s*,\s*["|\']', self.input_params) for match in match_list: if match.find("'") != -1: self.input_params = self.input_params.replace(match, match.replace("'", '"')) self.input_params = self.input_params.encode('utf-8') response = self.http.post(self.url_or_sql, self.input_params) elif method == 'get': logger.info('正在发起GET请求...') self.input_params = urllib.parse.urlencode(self.input_params) response = self.http.get(self.url_or_sql, self.input_params) body = response[0] if response[0]: encoding = chardet.detect(response[0])['encoding'] logger.info('正在对服务器返回body进行解码') if encoding: if encoding.lower() in ('gb2312', 'windows-1252', 'iso-8859-1'): body = response[0].decode('gbk') # decode函数对获取的字节数据进行解码 elif encoding.lower() in ('utf-8', 'utf-8-sig', 'iso-8859-2'): body = response[0].decode('utf-8') elif encoding.lower() == 'ascii': body = response[0].decode('unicode_escape') else: logger.info('解码失败,未知编码:%s,不对body做任何解码' % encoding) body = response[0] if python_version < '3.5': parser = HTMLParser() body = parser.unescape(body) # 处理html实体 else: body = unescape(body) header = response[1] code = response[2] logger.info('服务器返回结果"响应体(body)": %s' % body) logger.info('服务器返回结果"请求头(headers)": %s' % header) logger.info('服务器返回结果"状态码(code)": %s' % code) else: body, header,code = response[1], response[1], response[1] if self.response_to_check == 'body': logger.info('正在提取目标返回结果值') self.save_result(body) logger.info('正在执行断言') self.assert_result(body) elif self.response_to_check == 'header': logger.info('正在提取目标返回结果值') self.save_result(header) logger.info('正在执行断言') self.assert_result(header) elif self.response_to_check == 'code': logger.info('正在提取目标返回结果值') self.save_result(code) logger.info('正在执行断言') self.assert_result(code) def test_api_for_xml(self): # 针对请求体为webservice xml格式的 method = self.request_method.lower() if method == 'post': logger.info('正在发起POST请求...') self.input_params = self.input_params.encode('utf-8') response = self.http.post(self.url_or_sql, self.input_params) elif method == 'get': logger.info('正在发起GET请求...') self.input_params = urllib.parse.urlencode(self.input_params) response = self.http.get(self.url_or_sql, self.input_params) body = response[0] if response[0]: encoding = chardet.detect(response[0])['encoding'] logger.info('正在对服务器返回body进行解码') if encoding: if encoding.lower() in ('gb2312', 'windows-1252', 'iso-8859-1'): body = response[0].decode('gbk') # decode函数对获取的字节数据进行解码 elif encoding.lower() in ('utf-8', 'utf-8-sig', 'iso-8859-2'): body = response[0].decode('utf-8') elif encoding.lower() == 'ascii': body = response[0].decode('unicode_escape') else: logger.info('解码失败,未知编码:%s,不对body做任何解码' % encoding) body = response[0] if python_version < '3.5': parser = HTMLParser() body = parser.unescape(body) # 处理html实体 else: body = unescape(body) header = response[1] code = response[2] logger.info('服务器返回结果"响应体(body)": %s' % body) logger.info('服务器返回结果"请求头(headers)": %s' % header) logger.info('服务器返回结果"状态码(code)": %s' % code) else: body, header,code = response[1], response[1], response[1] if self.response_to_check == 'body': logger.info('正在提取目标返回结果值') self.save_result(body) logger.info('正在执行断言') self.assert_result(body) elif self.response_to_check == 'header': logger.info('正在提取目标返回结果值') self.save_result(header) logger.info('正在执行断言') self.assert_result(header) elif self.response_to_check == 'code': logger.info('正在提取目标返回结果值') self.save_result(code) logger.info('正在执行断言') self.assert_result(code)
39.351779
169
0.540076
1,053
9,956
4.986705
0.148148
0.087983
0.114264
0.032565
0.809751
0.771853
0.74462
0.74462
0.74462
0.726338
0
0.028078
0.331057
9,956
252
170
39.507937
0.76021
0.065388
0
0.79803
0
0
0.106466
0.014871
0
0
0
0
0.049261
0
null
null
0
0.054187
null
null
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
55e23fc54380c1bf3f7bf6cc15d930fc0d4fc317
198
py
Python
stable_baselines/gail/__init__.py
emadboctorx/stable-baselines
9bce185538e8bf69836371286e23919fd85eec64
[ "MIT" ]
null
null
null
stable_baselines/gail/__init__.py
emadboctorx/stable-baselines
9bce185538e8bf69836371286e23919fd85eec64
[ "MIT" ]
null
null
null
stable_baselines/gail/__init__.py
emadboctorx/stable-baselines
9bce185538e8bf69836371286e23919fd85eec64
[ "MIT" ]
null
null
null
from stable_baselines.gail.dataset.dataset import DataLoader, ExpertDataset from stable_baselines.gail.dataset.record_expert import generate_expert_traj from stable_baselines.gail.model import GAIL
49.5
76
0.888889
27
198
6.296296
0.481481
0.176471
0.335294
0.405882
0.352941
0
0
0
0
0
0
0
0.065657
198
3
77
66
0.918919
0
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
7
3602992589a655fd84df20272232193d6fda058f
199,404
py
Python
bqtools/tests/test_bqtools.py
MikeMoore63/bqtools
683597c0a69b048bff00d01f18229777f4c60318
[ "MIT" ]
2
2020-01-21T13:40:34.000Z
2022-03-08T09:54:55.000Z
bqtools/tests/test_bqtools.py
MikeMoore63/bqtools
683597c0a69b048bff00d01f18229777f4c60318
[ "MIT" ]
13
2019-07-09T09:38:06.000Z
2020-04-22T04:30:26.000Z
bqtools/tests/test_bqtools.py
MikeMoore63/bqtools
683597c0a69b048bff00d01f18229777f4c60318
[ "MIT" ]
3
2020-01-21T13:40:37.000Z
2021-05-21T05:52:52.000Z
# -*- coding: utf-8 -*- """ This modules purpose is to test bqtools-json """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import copy import datetime import difflib import json import logging import pprint import unittest import pytz from deepdiff import DeepDiff from google.cloud import bigquery, storage, exceptions import bqtools class MockDataset: def __init__(self,project,dataset): self._dataset = dataset self._project = project @property def dataset_id(self): return self._dataset @property def project(self): return self._project class TestScannerMethods(unittest.TestCase): def load_data(self, file_name): with open(file_name) as json_file: return json.load(json_file) def setUp(self): logging.basicConfig() self.pp = pprint.PrettyPrinter(indent=4) # test 1 validate can create a schema from a dictionary self.schemaTest1 = self.load_data("bqtools/tests/schemaTest1.json") self.schemaTest2 = self.load_data("bqtools/tests/schemaTest2.json") # next schemas are for testing bare array handling # this is a starting schema self.schema2startnobare = self.load_data("bqtools/tests/schema2startnobare.json") # this adds 2 bare arrays self.schemaTest2bare = self.load_data("bqtools/tests/schemaTest2bare.json") # resultant schema and objects shoulld loook like this self.schemaTest2nonbare = self.load_data("bqtools/tests/schemaTest2nonbare.json") self.schemaTest4 = self.load_data("bqtools/tests/schemaTest4.json") self.schemaTest3 = self.load_data("bqtools/tests/schemaTest3.json") self.monsterSchema = self.load_data("bqtools/tests/monsterSchema.json") def test_toDict(self): schema2Dict = ( bigquery.SchemaField('string', 'STRING'), bigquery.SchemaField('integer', 'INTEGER'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('boolean', 'BOOLEAN'), bigquery.SchemaField('record', 'RECORD', fields=( bigquery.SchemaField('string2', 'STRING'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('integer2', 'INTEGER'), bigquery.SchemaField('boolean2', 'BOOLEAN') )), bigquery.SchemaField('array', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('string3', 'STRING'), bigquery.SchemaField('integer3', 'INTEGER') )) ) expectedResult = [ { "name": 'string', "type": 'STRING', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'integer', "type": 'INTEGER', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'float', "type": 'FLOAT', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'boolean', "type": 'BOOLEAN', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'record', "type": 'RECORD', "description": None, "mode": 'NULLABLE', "fields": [ {"name": 'string2', "type": 'STRING', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'float', "type": 'FLOAT', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'integer2', "type": 'INTEGER', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'boolean2', "type": 'BOOLEAN', "description": None, "mode": 'NULLABLE', "fields": []} ]}, { "name": 'array', "type": 'RECORD', "description": None, "mode": 'REPEATED', "fields": [ {"name": 'string3', "type": 'STRING', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'integer3', "type": 'INTEGER', "description": None, "mode": 'NULLABLE', "fields": []} ]} ] sa = [] # print("showing each field") for bqi in schema2Dict: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) diff = DeepDiff(expectedResult, sa, ignore_order=True) self.assertEqual(diff, {}, "Unexpected result in toDict expected nothing insteadest got {}".format( self.pp.pprint(diff))) def test_createschema(self): bqSchema = bqtools.create_schema(self.schemaTest1) expectedSchema = ( bigquery.SchemaField('string', 'STRING'), bigquery.SchemaField('integer', 'INTEGER'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('boolean', 'BOOLEAN'), bigquery.SchemaField('record', 'RECORD', fields=( bigquery.SchemaField('string2', 'STRING'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('integer2', 'INTEGER'), bigquery.SchemaField('boolean2', 'BOOLEAN') )), bigquery.SchemaField('array', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('string3', 'STRING'), bigquery.SchemaField('integer3', 'INTEGER') )) ) # print("testing result") # self.pp.pprint(bqSchema) sa = [] # print("showing each field") for bqi in bqSchema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) # print("Schema as dict") # self.pp.pprint(sa) isa = sa # print("Expected result") # self.pp.pprint(expectedSchema) sa = [] # print("showing each expected field") for bqi in expectedSchema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) # print("expected Schema as dict") diff = DeepDiff(isa, sa, ignore_order=True) # self.pp.pprint(diff) a = "Schema test1 schema does not match target {}".format(len(diff)) self.assertEqual(diff, {}, a) def test_createschema2(self): # print("Creating a new schema") bqSchema2 = bqtools.create_schema(self.schemaTest2) sa2 = [] # print("showing each field schema2") for bqi in bqSchema2: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) # print("Schema2 as dict") # self.pp.pprint(sa2) expectedSchema2 = ( bigquery.SchemaField('string', 'STRING'), bigquery.SchemaField('integer', 'INTEGER'), bigquery.SchemaField('record', 'RECORD', fields=( bigquery.SchemaField('string2', 'STRING'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('boolean2', 'BOOLEAN'), bigquery.SchemaField('appended1', 'STRING') )), bigquery.SchemaField('array', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('string3', 'STRING'), bigquery.SchemaField('integer3', 'INTEGER'), bigquery.SchemaField('foo', 'FLOAT') )), bigquery.SchemaField('anotherarray', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('test1', 'INTEGER'), bigquery.SchemaField('test2', 'BOOLEAN') )) ) sa = [] for bqi in expectedSchema2: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) # self.pp.pprint(diff) a = "Schema test1 schema does not match target {}".format(diff) self.assertEqual(diff, {}, a) logger = logging.getLogger("testBQTools") evolved = bqtools.match_and_addtoschema({"string": "hello"}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 1") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 2") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {}}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 3") evolved = bqtools.match_and_addtoschema( {"string": "hello", "integer": 52, "record": {"string2": "hello2"}}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 4") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 6") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": []}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 7") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello"}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 8") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 9") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 10") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 11") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False}, {"test1": 52, "test2": True}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 12") # evolve tests bbelow prepare baseline copyoforigschema = list(expectedSchema2) savedSchema = copy.deepcopy(copyoforigschema) sa = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) # Evolutio test 1 # add some stuff 2 layers down in an array evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False}, {"test1": 52, "test2": True, "fred": "I am an evolved string", "iamanotherevolve": 32}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 13") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) diff = dict(diff) print( "============================================ evolve test 1 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 1 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolve', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected {}".format(self.pp.pformat(diff))) # Evolution test 2 # this just adds a fiedl at top level copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False}, {"test1": 52, "test2": True}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 2 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 2 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}}, diff, "Schema evolution not as expected {}".format(self.pp.pformat(diff))) # Evolution test 3 # this is an object with root schema evolution # Plus child objects with 2 different changes in them # plus another with both copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3, "fred": "I am same previous " "evolution"}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 3 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 3 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected {}".format(self.pp.pformat(diff))) # Evolution test 4 # this is an object with root schema evolution # Plus child objects with 2 different changes in them copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [ {"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 4 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 4 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected") # Evolution test 5 # add an array with strings an dno key this should fail copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [ {"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3, "bill": ["hello", "fred", "break this"]}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 5 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 5 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}, {'description': None, 'fields': [ {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'value', 'type': 'STRING'}], 'mode': 'REPEATED', 'name': 'bill', 'type': 'RECORD'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected") # Evolution test 6 # add an array with strings an dno key this should fail copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [ {"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3, "bill": {}}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 6 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 6 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}, {'description': None, 'fields': [ {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'xxxDummySchemaAsNoneDefinedxxx', 'type': 'STRING'}], 'mode': 'NULLABLE', 'name': 'bill', 'type': 'RECORD'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected") # def test_patchbare(self): # startschema = bqtools.create_schema(self.schema2startnobare) # resultschema = bqtools.create_schema(self.schemaTest2nonbare) # # origobject = copy.deepcopy(self.schemaTest2bare) # # evolved = bqtools.match_and_addtoschema(self.schemaTest2bare, startschema) # self.assertEqual(evolved, True, # "Bare llist and multi dict evolution has not happened as expected") # diff = DeepDiff(resultschema, startschema, ignore_order=True) # # print( # "============================================ mixed arrays added diff start " # "====================================") # print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) # print( # "============================================ mixed arrays added diff end " # "====================================") def test_patch(self): bqSchema2 = bqtools.create_schema(self.schemaTest2) bqSchema = bqtools.create_schema(self.schemaTest1) sa = [] for bqi in bqSchema: i = bqtools.to_dict(bqi) sa.append(i) osa = copy.deepcopy(sa) change, pschema = bqtools.recurse_and_add_to_schema(bqSchema2, sa) diff = DeepDiff(pschema, osa, ignore_order=True) # patching never removes fields so expect additions # so after list of root[] should be one longer expectedDiff = {'iterable_item_added': {'root[2]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer2', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'float', 'type': 'FLOAT'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string2', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'boolean2', 'type': 'BOOLEAN'}], 'mode': 'NULLABLE', 'name': 'record', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer3', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string3', 'type': 'STRING'}], 'mode': 'REPEATED', 'name': 'array', 'type': 'RECORD'}}, 'iterable_item_removed': {'root[2]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer2', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'float', 'type': 'FLOAT'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string2', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'boolean2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'appended1', 'type': 'STRING'}], 'mode': 'NULLABLE', 'name': 'record', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer3', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string3', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'foo', 'type': 'FLOAT'}], 'mode': 'REPEATED', 'name': 'array', 'type': 'RECORD'}, 'root[6]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}} self.assertEqual(diff, expectedDiff, "Patch diff is not what is expected {}".format(self.pp.pformat(diff))) self.assertEqual(change, True, "Patch diff change result {} is not what is expected {}".format(change, self.pp.pformat( diff))) bqSchema3 = bqtools.create_schema(self.schemaTest3) bqSchema4 = bqtools.create_schema(self.schemaTest4) sa2 = [] for bqi in bqSchema3: i = bqtools.to_dict(bqi) sa2.append(i) osa = copy.deepcopy(sa2) change, pschema = bqtools.recurse_and_add_to_schema(bqSchema4, sa2) diff = DeepDiff(pschema, osa, ignore_order=True) print("Patched schema diff {} change{}".format(self.pp.pformat(diff), change)) # print("old {}".format(self.pp.pformat(osa))) # print("new {}".format(self.pp.pformat(pschema))) def test_patch2(self): bqSchema2 = bqtools.create_schema(self.schemaTest2) bqSchema = bqtools.create_schema(self.schemaTest2) sa = [] for bqi in bqSchema: i = bqtools.to_dict(bqi) sa.append(i) osa = copy.deepcopy(sa) change, pschema = bqtools.recurse_and_add_to_schema(bqSchema2, sa) diff = DeepDiff(pschema, osa, ignore_order=True) # patching never removes fields so expect additions # so after list of root[] should be one longer expectedDiff = {} self.assertEqual(diff, expectedDiff, "Patch diff is not what is expected {}".format(self.pp.pformat(diff))) self.assertEqual(change, False, "Patch diff change result {} is not what is expected {}".format(change, self.pp.pformat( diff))) # print("Patched schema diff {}".format(self.pp.pformat(diff))) # print("old {}".format(self.pp.pformat(osa))) # print("new {}".format(self.pp.pformat(pschema))) # resultant schema and objects shoulld loook like this self.schemaTest2nonbare = self.load_data("bqtools/tests/schemaTest2nonbare.json") self.schemaTest4 = self.load_data("bqtools/tests/schemaTest4.json") self.schemaTest3 = self.load_data("bqtools/tests/schemaTest3.json") self.monsterSchema = self.load_data("bqtools/tests/monsterSchema.json") def test_toDict(self): schema2Dict = ( bigquery.SchemaField('string', 'STRING'), bigquery.SchemaField('integer', 'INTEGER'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('boolean', 'BOOLEAN'), bigquery.SchemaField('record', 'RECORD', fields=( bigquery.SchemaField('string2', 'STRING'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('integer2', 'INTEGER'), bigquery.SchemaField('boolean2', 'BOOLEAN') )), bigquery.SchemaField('array', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('string3', 'STRING'), bigquery.SchemaField('integer3', 'INTEGER') )) ) expectedResult = [ { "name": 'string', "type": 'STRING', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'integer', "type": 'INTEGER', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'float', "type": 'FLOAT', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'boolean', "type": 'BOOLEAN', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'record', "type": 'RECORD', "description": None, "mode": 'NULLABLE', "fields": [ {"name": 'string2', "type": 'STRING', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'float', "type": 'FLOAT', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'integer2', "type": 'INTEGER', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'boolean2', "type": 'BOOLEAN', "description": None, "mode": 'NULLABLE', "fields": []} ]}, { "name": 'array', "type": 'RECORD', "description": None, "mode": 'REPEATED', "fields": [ {"name": 'string3', "type": 'STRING', "description": None, "mode": 'NULLABLE', "fields": []}, { "name": 'integer3', "type": 'INTEGER', "description": None, "mode": 'NULLABLE', "fields": []} ]} ] sa = [] # print("showing each field") for bqi in schema2Dict: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) diff = DeepDiff(expectedResult, sa, ignore_order=True) self.assertEqual(diff, {}, "Unexpected result in toDict expected nothing insteadest got {}".format( self.pp.pprint(diff))) def test_createschema(self): bqSchema = bqtools.create_schema(self.schemaTest1) expectedSchema = ( bigquery.SchemaField('string', 'STRING'), bigquery.SchemaField('integer', 'INTEGER'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('boolean', 'BOOLEAN'), bigquery.SchemaField('record', 'RECORD', fields=( bigquery.SchemaField('string2', 'STRING'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('integer2', 'INTEGER'), bigquery.SchemaField('boolean2', 'BOOLEAN') )), bigquery.SchemaField('array', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('string3', 'STRING'), bigquery.SchemaField('integer3', 'INTEGER') )) ) # print("testing result") # self.pp.pprint(bqSchema) sa = [] # print("showing each field") for bqi in bqSchema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) # print("Schema as dict") # self.pp.pprint(sa) isa = sa # print("Expected result") # self.pp.pprint(expectedSchema) sa = [] # print("showing each expected field") for bqi in expectedSchema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) # print("expected Schema as dict") diff = DeepDiff(isa, sa, ignore_order=True) # self.pp.pprint(diff) a = "Schema test1 schema does not match target {}".format(len(diff)) self.assertEqual(diff, {}, a) def test_createschema2(self): # print("Creating a new schema") bqSchema2 = bqtools.create_schema(self.schemaTest2) sa2 = [] # print("showing each field schema2") for bqi in bqSchema2: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) # print("Schema2 as dict") # self.pp.pprint(sa2) expectedSchema2 = ( bigquery.SchemaField('string', 'STRING'), bigquery.SchemaField('integer', 'INTEGER'), bigquery.SchemaField('record', 'RECORD', fields=( bigquery.SchemaField('string2', 'STRING'), bigquery.SchemaField('float', 'FLOAT'), bigquery.SchemaField('boolean2', 'BOOLEAN'), bigquery.SchemaField('appended1', 'STRING') )), bigquery.SchemaField('array', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('string3', 'STRING'), bigquery.SchemaField('integer3', 'INTEGER'), bigquery.SchemaField('foo', 'FLOAT') )), bigquery.SchemaField('anotherarray', 'RECORD', mode='REPEATED', fields=( bigquery.SchemaField('test1', 'INTEGER'), bigquery.SchemaField('test2', 'BOOLEAN') )) ) sa = [] for bqi in expectedSchema2: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) # self.pp.pprint(diff) a = "Schema test1 schema does not match target {}".format(diff) self.assertEqual(diff, {}, a) logger = logging.getLogger("testBQTools") evolved = bqtools.match_and_addtoschema({"string": "hello"}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 1") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 2") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {}}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 3") evolved = bqtools.match_and_addtoschema( {"string": "hello", "integer": 52, "record": {"string2": "hello2"}}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 4") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 6") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": []}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 7") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello"}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 8") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 9") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 10") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 11") evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False}, {"test1": 52, "test2": True}]}, expectedSchema2, logger=logger) self.assertEqual(evolved, False, "Expected no evolve but got evolve true evolve test 12") # evolve tests bbelow prepare baseline copyoforigschema = list(expectedSchema2) savedSchema = copy.deepcopy(copyoforigschema) sa = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa.append(i) # Evolutio test 1 # add some stuff 2 layers down in an array evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False}, {"test1": 52, "test2": True, "fred": "I am an evolved string", "iamanotherevolve": 32}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 13") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) diff = dict(diff) print( "============================================ evolve test 1 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 1 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolve', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected {}".format(self.pp.pformat(diff))) # Evolution test 2 # this just adds a fiedl at top level copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False}, {"test1": 52, "test2": True}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 2 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 2 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}}, diff, "Schema evolution not as expected {}".format(self.pp.pformat(diff))) # Evolution test 3 # this is an object with root schema evolution # Plus child objects with 2 different changes in them # plus another with both copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [{"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3, "fred": "I am same previous " "evolution"}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 3 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 3 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected {}".format(self.pp.pformat(diff))) # Evolution test 4 # this is an object with root schema evolution # Plus child objects with 2 different changes in them copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [ {"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 4 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 4 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected") # Evolution test 5 # add an array with strings an dno key this should fail copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [ {"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3, "bill": ["hello", "fred", "break this"]}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 5 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 5 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}, {'description': None, 'fields': [ {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'value', 'type': 'STRING'}], 'mode': 'REPEATED', 'name': 'bill', 'type': 'RECORD'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected") # Evolution test 6 # add an array with strings an dno key this should fail copyoforigschema = copy.deepcopy(savedSchema) evolved = bqtools.match_and_addtoschema({"string": "hello", "integer": 52, "hellomike": 3.1415926, "record": {"string2": "hello2", "float": 1.3, "boolean2": False, "appended1": "another string"}, "array": [{"string3": "hello", "integer3": 42, "foo": 3.141}, {"integer3": 42, "foo": 3.141}], "anotherarray": [ {"test1": 52, "test2": False, "fred": "I am an evolution"}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3}, {"test1": 52, "test2": True, "iamanotherevolution": 1.3, "bill": {}}]}, copyoforigschema, logger=logger) self.assertEqual(evolved, True, "Expected evolve but got no evolve False for evolve test 14") sa2 = [] for bqi in copyoforigschema: i = bqtools.to_dict(bqi) # self.pp.pprint(i) sa2.append(i) diff = DeepDiff(sa, sa2, ignore_order=True) print( "============================================ evolve test 6 diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ evolve test 6 diff end " "====================================") self.assertEqual({'iterable_item_added': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'fred', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'iamanotherevolution', 'type': 'FLOAT'}, {'description': None, 'fields': [ {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'xxxDummySchemaAsNoneDefinedxxx', 'type': 'STRING'}], 'mode': 'NULLABLE', 'name': 'bill', 'type': 'RECORD'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'hellomike', 'type': 'FLOAT'}}, 'iterable_item_removed': {'root[4]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}}, diff, "Schema evolution not as expected") def test_patchbare(self): startschema = bqtools.create_schema(self.schema2startnobare) resultschema = bqtools.create_schema(self.schemaTest2nonbare) origobject = copy.deepcopy(self.schemaTest2bare) evolved = bqtools.match_and_addtoschema(self.schemaTest2bare, startschema) self.assertEqual(evolved, True, "Bare llist and multi dict evolution has not happened as expected") diff = DeepDiff(resultschema, startschema, ignore_order=True) print( "============================================ mixed arrays added diff start " "====================================") print("Patched schema diff {} change{}".format(self.pp.pformat(diff), evolved)) print( "============================================ mixed arrays added diff end " "====================================") bare_schema = bqtools.create_schema(origobject) views = bqtools.gen_diff_views('foo', 'ar', 'bob', bare_schema, description="A test schema") expected_views = [ {"query":"""#standardSQL SELECT _PARTITIONTIME AS scantime, xxrownumbering.partRowNumber, ifnull(tabob.string,"None") as `string`, ifnull(A1,"None") as stringarray, ifnull(tabob.record.appended1,"None") as `recordappended1`, ifnull(tabob.record.float,0.0) as `recordfloat`, ifnull(tabob.record.string2,"None") as `recordstring2`, ifnull(tabob.record.boolean2,False) as `recordboolean2`, ifnull(A2,0) as intarray, ifnull(tabob.integer,0) as `integer`, ifnull(A3.integer3,0) as `arrayinteger3`, ifnull(A3.foo,0.0) as `arrayfoo`, ifnull(A3.string3,"None") as `arraystring3`, ifnull(A4.a,"None") as `mixArraya`, ifnull(A4.b,"None") as `mixArrayb`, ifnull(A4.d,"None") as `mixArrayd`, ifnull(A4.c,0) as `mixArrayc` from `foo.ar.bob` as tabob LEFT JOIN UNNEST(tabob.stringarray) as A1 LEFT JOIN UNNEST(tabob.intarray) as A2 LEFT JOIN UNNEST(tabob.array) as A3 LEFT JOIN UNNEST(tabob.mixArray) as A4 JOIN ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`)) AS xxrownumbering ON _PARTITIONTIME = xxrownumbering.scantime """}, {"query":"""#standardSQL SELECT * FROM ( SELECT ifnull(earlier.scantime, later.scantime) AS scantime, CASE WHEN earlier.scantime IS NULL AND later.scantime IS NOT NULL THEN 1 WHEN earlier.scantime IS NOT NULL AND later.scantime IS NULL THEN -1 ELSE 0 END AS action, ARRAY(( SELECT field FROM ( SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "string" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "stringarray" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordappended1" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordfloat" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordstring2" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordboolean2" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "intarray" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "integer" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "arrayinteger3" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "arrayfoo" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "arraystring3" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "mixArraya" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "mixArrayb" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "mixArrayd" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "mixArrayc" ELSE CAST(null as string) END as field ) WHERE field IS NOT NULL) ) AS updatedFields, ifnull(later.string, earlier.string) AS `string`, ifnull(later.stringarray, earlier.stringarray) AS `stringarray`, ifnull(later.recordappended1, earlier.recordappended1) AS `recordappended1`, ifnull(later.recordfloat, earlier.recordfloat) AS `recordfloat`, ifnull(later.recordstring2, earlier.recordstring2) AS `recordstring2`, ifnull(later.recordboolean2, earlier.recordboolean2) AS `recordboolean2`, ifnull(later.intarray, earlier.intarray) AS `intarray`, ifnull(later.integer, earlier.integer) AS `integer`, ifnull(later.arrayinteger3, earlier.arrayinteger3) AS `arrayinteger3`, ifnull(later.arrayfoo, earlier.arrayfoo) AS `arrayfoo`, ifnull(later.arraystring3, earlier.arraystring3) AS `arraystring3`, ifnull(later.mixArraya, earlier.mixArraya) AS `mixArraya`, ifnull(later.mixArrayb, earlier.mixArrayb) AS `mixArrayb`, ifnull(later.mixArrayd, earlier.mixArrayd) AS `mixArrayd`, ifnull(later.mixArrayc, earlier.mixArrayc) AS `mixArrayc` FROM (#standardSQL SELECT _PARTITIONTIME AS scantime, xxrownumbering.partRowNumber, ifnull(tabob.string,"None") as `string`, ifnull(A1,"None") as stringarray, ifnull(tabob.record.appended1,"None") as `recordappended1`, ifnull(tabob.record.float,0.0) as `recordfloat`, ifnull(tabob.record.string2,"None") as `recordstring2`, ifnull(tabob.record.boolean2,False) as `recordboolean2`, ifnull(A2,0) as intarray, ifnull(tabob.integer,0) as `integer`, ifnull(A3.integer3,0) as `arrayinteger3`, ifnull(A3.foo,0.0) as `arrayfoo`, ifnull(A3.string3,"None") as `arraystring3`, ifnull(A4.a,"None") as `mixArraya`, ifnull(A4.b,"None") as `mixArrayb`, ifnull(A4.d,"None") as `mixArrayd`, ifnull(A4.c,0) as `mixArrayc` from `foo.ar.bob` as tabob LEFT JOIN UNNEST(tabob.stringarray) as A1 LEFT JOIN UNNEST(tabob.intarray) as A2 LEFT JOIN UNNEST(tabob.array) as A3 LEFT JOIN UNNEST(tabob.mixArray) as A4 JOIN ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`)) AS xxrownumbering ON _PARTITIONTIME = xxrownumbering.scantime ) as later FULL OUTER JOIN (#standardSQL SELECT _PARTITIONTIME AS scantime, xxrownumbering.partRowNumber, ifnull(tabob.string,"None") as `string`, ifnull(A1,"None") as stringarray, ifnull(tabob.record.appended1,"None") as `recordappended1`, ifnull(tabob.record.float,0.0) as `recordfloat`, ifnull(tabob.record.string2,"None") as `recordstring2`, ifnull(tabob.record.boolean2,False) as `recordboolean2`, ifnull(A2,0) as intarray, ifnull(tabob.integer,0) as `integer`, ifnull(A3.integer3,0) as `arrayinteger3`, ifnull(A3.foo,0.0) as `arrayfoo`, ifnull(A3.string3,"None") as `arraystring3`, ifnull(A4.a,"None") as `mixArraya`, ifnull(A4.b,"None") as `mixArrayb`, ifnull(A4.d,"None") as `mixArrayd`, ifnull(A4.c,0) as `mixArrayc` from `foo.ar.bob` as tabob LEFT JOIN UNNEST(tabob.stringarray) as A1 LEFT JOIN UNNEST(tabob.intarray) as A2 LEFT JOIN UNNEST(tabob.array) as A3 LEFT JOIN UNNEST(tabob.mixArray) as A4 JOIN ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`)) AS xxrownumbering ON _PARTITIONTIME = xxrownumbering.scantime -- avoid last row as full outer join this will attempt to find a row later -- that won't exist showing as a false delete WHERE partRowNumber < (SELECT MAX(partRowNumber) FROM ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`) )) ) as earlier ON earlier.partRowNumber = later.partRowNumber -1 AND earlier.string = later.string AND earlier.stringarray = later.stringarray AND earlier.recordappended1 = later.recordappended1 AND earlier.recordfloat = later.recordfloat AND earlier.recordstring2 = later.recordstring2 AND earlier.recordboolean2 = later.recordboolean2 AND earlier.intarray = later.intarray AND earlier.integer = later.integer AND earlier.arrayinteger3 = later.arrayinteger3 AND earlier.arrayfoo = later.arrayfoo AND earlier.arraystring3 = later.arraystring3 AND earlier.mixArraya = later.mixArraya AND earlier.mixArrayb = later.mixArrayb AND earlier.mixArrayd = later.mixArrayd AND earlier.mixArrayc = later.mixArrayc ) WHERE (action != 0 or array_length(updatedFields) > 0) """}, {"query":"""#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.string IS NULL THEN 'Added' WHEN l.string IS NULL THEN 'Deleted' WHEN o.string = l.string AND o.stringarray = l.stringarray AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 AND o.intarray = l.intarray AND o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.mixArraya = l.mixArraya AND o.mixArrayb = l.mixArrayb AND o.mixArrayd = l.mixArrayd AND o.mixArrayc = l.mixArrayc THEN 'Same' ELSE 'Updated' END AS action, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.stringarray as origstringarray, l.stringarray as laterstringarray, case when o.stringarray = l.stringarray then 0 else 1 end as diffstringarray, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2, o.intarray as origintarray, l.intarray as laterintarray, case when o.intarray = l.intarray then 0 else 1 end as diffintarray, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.mixArraya as origmixArraya, l.mixArraya as latermixArraya, case when o.mixArraya = l.mixArraya then 0 else 1 end as diffmixArraya, o.mixArrayb as origmixArrayb, l.mixArrayb as latermixArrayb, case when o.mixArrayb = l.mixArrayb then 0 else 1 end as diffmixArrayb, o.mixArrayd as origmixArrayd, l.mixArrayd as latermixArrayd, case when o.mixArrayd = l.mixArrayd then 0 else 1 end as diffmixArrayd, o.mixArrayc as origmixArrayc, l.mixArrayc as latermixArrayc, case when o.mixArrayc = l.mixArrayc then 0 else 1 end as diffmixArrayc FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 1 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.string = o.string AND l.stringarray=o.stringarray AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2 AND l.intarray=o.intarray AND l.integer=o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.mixArraya=o.mixArraya AND l.mixArrayb=o.mixArrayb AND l.mixArrayd=o.mixArrayd AND l.mixArrayc=o.mixArrayc"""}, {"query":"""#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.string IS NULL THEN 'Added' WHEN l.string IS NULL THEN 'Deleted' WHEN o.string = l.string AND o.stringarray = l.stringarray AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 AND o.intarray = l.intarray AND o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.mixArraya = l.mixArraya AND o.mixArrayb = l.mixArrayb AND o.mixArrayd = l.mixArrayd AND o.mixArrayc = l.mixArrayc THEN 'Same' ELSE 'Updated' END AS action, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.stringarray as origstringarray, l.stringarray as laterstringarray, case when o.stringarray = l.stringarray then 0 else 1 end as diffstringarray, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2, o.intarray as origintarray, l.intarray as laterintarray, case when o.intarray = l.intarray then 0 else 1 end as diffintarray, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.mixArraya as origmixArraya, l.mixArraya as latermixArraya, case when o.mixArraya = l.mixArraya then 0 else 1 end as diffmixArraya, o.mixArrayb as origmixArrayb, l.mixArrayb as latermixArrayb, case when o.mixArrayb = l.mixArrayb then 0 else 1 end as diffmixArrayb, o.mixArrayd as origmixArrayd, l.mixArrayd as latermixArrayd, case when o.mixArrayd = l.mixArrayd then 0 else 1 end as diffmixArrayd, o.mixArrayc as origmixArrayc, l.mixArrayc as latermixArrayc, case when o.mixArrayc = l.mixArrayc then 0 else 1 end as diffmixArrayc FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 7 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.string = o.string AND l.stringarray=o.stringarray AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2 AND l.intarray=o.intarray AND l.integer=o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.mixArraya=o.mixArraya AND l.mixArrayb=o.mixArrayb AND l.mixArrayd=o.mixArrayd AND l.mixArrayc=o.mixArrayc"""}, {"query":"""#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.string IS NULL THEN 'Added' WHEN l.string IS NULL THEN 'Deleted' WHEN o.string = l.string AND o.stringarray = l.stringarray AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 AND o.intarray = l.intarray AND o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.mixArraya = l.mixArraya AND o.mixArrayb = l.mixArrayb AND o.mixArrayd = l.mixArrayd AND o.mixArrayc = l.mixArrayc THEN 'Same' ELSE 'Updated' END AS action, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.stringarray as origstringarray, l.stringarray as laterstringarray, case when o.stringarray = l.stringarray then 0 else 1 end as diffstringarray, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2, o.intarray as origintarray, l.intarray as laterintarray, case when o.intarray = l.intarray then 0 else 1 end as diffintarray, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.mixArraya as origmixArraya, l.mixArraya as latermixArraya, case when o.mixArraya = l.mixArraya then 0 else 1 end as diffmixArraya, o.mixArrayb as origmixArrayb, l.mixArrayb as latermixArrayb, case when o.mixArrayb = l.mixArrayb then 0 else 1 end as diffmixArrayb, o.mixArrayd as origmixArrayd, l.mixArrayd as latermixArrayd, case when o.mixArrayd = l.mixArrayd then 0 else 1 end as diffmixArrayd, o.mixArrayc as origmixArrayc, l.mixArrayc as latermixArrayc, case when o.mixArrayc = l.mixArrayc then 0 else 1 end as diffmixArrayc FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 30 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.string = o.string AND l.stringarray=o.stringarray AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2 AND l.intarray=o.intarray AND l.integer=o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.mixArraya=o.mixArraya AND l.mixArrayb=o.mixArrayb AND l.mixArrayd=o.mixArrayd AND l.mixArrayc=o.mixArrayc"""}, {"query":"""#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.string IS NULL THEN 'Added' WHEN l.string IS NULL THEN 'Deleted' WHEN o.string = l.string AND o.stringarray = l.stringarray AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 AND o.intarray = l.intarray AND o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.mixArraya = l.mixArraya AND o.mixArrayb = l.mixArrayb AND o.mixArrayd = l.mixArrayd AND o.mixArrayc = l.mixArrayc THEN 'Same' ELSE 'Updated' END AS action, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.stringarray as origstringarray, l.stringarray as laterstringarray, case when o.stringarray = l.stringarray then 0 else 1 end as diffstringarray, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2, o.intarray as origintarray, l.intarray as laterintarray, case when o.intarray = l.intarray then 0 else 1 end as diffintarray, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.mixArraya as origmixArraya, l.mixArraya as latermixArraya, case when o.mixArraya = l.mixArraya then 0 else 1 end as diffmixArraya, o.mixArrayb as origmixArrayb, l.mixArrayb as latermixArrayb, case when o.mixArrayb = l.mixArrayb then 0 else 1 end as diffmixArrayb, o.mixArrayd as origmixArrayd, l.mixArrayd as latermixArrayd, case when o.mixArrayd = l.mixArrayd then 0 else 1 end as diffmixArrayd, o.mixArrayc as origmixArrayc, l.mixArrayc as latermixArrayc, case when o.mixArrayc = l.mixArrayc then 0 else 1 end as diffmixArrayc FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 14 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.string = o.string AND l.stringarray=o.stringarray AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2 AND l.intarray=o.intarray AND l.integer=o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.mixArraya=o.mixArraya AND l.mixArrayb=o.mixArrayb AND l.mixArrayd=o.mixArrayd AND l.mixArrayc=o.mixArrayc"""} ] for i,vi in enumerate(views): self.assertEqual(vi["query"],expected_views[i]["query"],"Bare list diff {}".format(i)) def test_patch(self): bqSchema2 = bqtools.create_schema(self.schemaTest2) bqSchema = bqtools.create_schema(self.schemaTest1) sa = [] for bqi in bqSchema: i = bqtools.to_dict(bqi) sa.append(i) osa = copy.deepcopy(sa) change, pschema = bqtools.recurse_and_add_to_schema(bqSchema2, sa) diff = DeepDiff(pschema, osa, ignore_order=True) # patching never removes fields so expect additions # so after list of root[] should be one longer expectedDiff = {'iterable_item_added': {'root[2]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer2', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'float', 'type': 'FLOAT'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string2', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'boolean2', 'type': 'BOOLEAN'}], 'mode': 'NULLABLE', 'name': 'record', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer3', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string3', 'type': 'STRING'}], 'mode': 'REPEATED', 'name': 'array', 'type': 'RECORD'}}, 'iterable_item_removed': {'root[2]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer2', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'float', 'type': 'FLOAT'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string2', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'boolean2', 'type': 'BOOLEAN'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'appended1', 'type': 'STRING'}], 'mode': 'NULLABLE', 'name': 'record', 'type': 'RECORD'}, 'root[5]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'integer3', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'string3', 'type': 'STRING'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'foo', 'type': 'FLOAT'}], 'mode': 'REPEATED', 'name': 'array', 'type': 'RECORD'}, 'root[6]': {'description': None, 'fields': [{'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test1', 'type': 'INTEGER'}, {'description': None, 'fields': [], 'mode': 'NULLABLE', 'name': 'test2', 'type': 'BOOLEAN'}], 'mode': 'REPEATED', 'name': 'anotherarray', 'type': 'RECORD'}}} self.assertEqual(diff, expectedDiff, "Patch diff is not what is expected {}".format(self.pp.pformat(diff))) self.assertEqual(change, True, "Patch diff change result {} is not what is expected {}".format(change, self.pp.pformat( diff))) bqSchema3 = bqtools.create_schema(self.schemaTest3) bqSchema4 = bqtools.create_schema(self.schemaTest4) sa2 = [] for bqi in bqSchema3: i = bqtools.to_dict(bqi) sa2.append(i) osa = copy.deepcopy(sa2) change, pschema = bqtools.recurse_and_add_to_schema(bqSchema4, sa2) diff = DeepDiff(pschema, osa, ignore_order=True) print("Patched schema diff {} change{}".format(self.pp.pformat(diff), change)) # print("old {}".format(self.pp.pformat(osa))) # print("new {}".format(self.pp.pformat(pschema))) def test_compile(self): dataset = MockDataset("a","b") datasetav = MockDataset("a","c") datasetin = MockDataset("a","a") datasetav2 = MockDataset("b","c") """ graphviz http://www.webgraphviz.com/ to visualize what this does digraph G { "a.b.z" "a.b.x" "a.c.x" -> "a.b.x" "a.c.x2"-> "a.b.z" "a.c.x2"-> "a.b.x" "b.c.x3" -> "a.b.z" "b.c.x3" -> "a.c.x2" "a.c.x4" -> "a.b.z" "a.c.x4" -> "a.c.x" "a.c.x4" -> "b.c.x3" } """ compiler = bqtools.ViewCompiler() # tranche 0 a.b.z compiler.add_view_to_process(dataset,"z","""#standardSQL select 1 from `a.a.input1`""") # tranche 0 a.b.x compiler.add_view_to_process(dataset, "x", """#standardSQL select 1 from `a.a.input2` where 1=0""") # tranche 1 a.c.x compiler.add_view_to_process(datasetav, "x", """#standardSQL select 1 from `a.b.x` where 1=0""") # tranche 1 a.c.x2 compiler.add_view_to_process(datasetav, "x2", """#standardSQL select 1 from `a.b.z` join `a.b.x` where 1=0""") # tranche 2 b.c.x3 compiler.add_view_to_process(datasetav2, "x3", """#standardSQL select 1 from `a.b.z` join `a.c.x2` where 1=0""") # tranches 3 a.c.x4 compiler.add_view_to_process(datasetav, "x4", """#standardSQL select 1 from `a.b.z` join `a.c.x` join `b.c.x3` where 1=0""") tranches = [] for view_tranche in compiler.view_tranche: tranches.append(view_tranche) self.assertEqual(len(tranches),4,"Unexpcted number of uncompiled view tranches") self.assertEqual(len(tranches[0]),2,"Unexpected number of tranche 0 views") self.assertEqual("a.b.z" in tranches[0], True, "Unexpected view a.b.z missing from tranche 0") self.assertEqual("a.b.x" in tranches[0], True, "Unexpected view a.b.x missing from tranche 0") self.assertEqual(len(tranches[1]), 2, "Unexpected number of tranche 1 views") self.assertEqual("a.c.x" in tranches[1], True, "Unexpected view a.c.x missing from tranche 1") self.assertEqual("a.c.x2" in tranches[1], True, "Unexpected view a.c.x2 missing from tranche 1") self.assertEqual(len(tranches[2]), 1, "Unexpected number of tranche 2 views") self.assertEqual("b.c.x3" in tranches[2], True, "Unexpected view b.c.x3missing from tranche 2") self.assertEqual(len(tranches[3]), 1, "Unexpected number of tranche 2 views") self.assertEqual("a.c.x4" in tranches[3], True, "Unexpected view a.c.x4 missing from tranche 2") compiler.compile_views() for view_tranche in compiler.view_tranche: for view in compiler.view_in_tranche(view_tranche): pass def test_patch2(self): bqSchema2 = bqtools.create_schema(self.schemaTest2) bqSchema = bqtools.create_schema(self.schemaTest2) sa = [] for bqi in bqSchema: i = bqtools.to_dict(bqi) sa.append(i) osa = copy.deepcopy(sa) change, pschema = bqtools.recurse_and_add_to_schema(bqSchema2, sa) diff = DeepDiff(pschema, osa, ignore_order=True) # patching never removes fields so expect additions # so after list of root[] should be one longer expectedDiff = {} self.assertEqual(diff, expectedDiff, "Patch diff is not what is expected {}".format(self.pp.pformat(diff))) self.assertEqual(change, False, "Patch diff change result {} is not what is expected {}".format(change, self.pp.pformat( diff))) # print("Patched schema diff {}".format(self.pp.pformat(diff))) # print("old {}".format(self.pp.pformat(osa))) # print("new {}".format(self.pp.pformat(pschema))) def test_sync(self): logging.basicConfig(level=logging.INFO) # get target datasets ready uses app default credentials bqclient = bigquery.Client() stclient = storage.Client() # will use default project and public datsets for testing destination_project = bqclient.project # going to copy data from various datasets in bigquery-public-data project # each destination will be of the form bqsynctest_<region>_<orignaldatasetname> # in region - will be replaced with _ to make valid dataset nae # as all public data is in us we will need for cross region a us bucket # and a target region bucket # tests are in region i.e. us to us # us to eu # us to europe-west2 # bucket names will be created if they do not exist of # bqsynctest_<projectid>_<region> # eac bucket will have a 1 day lifecycle added # source will be picked with various source attribute types, partitioning and clustering strategy # success is tables are copied no errors in extract, load or copy # not tale numbers may vary # at end the test datasets will be deleted the buckets will remain # this as bucket names remain reserved for sometime after deletion test_buckets = [] usbucket = "bqsynctest_{}_us".format(destination_project) test_buckets.append({"name":usbucket,"region":"us"}) eubucket = "bqsynctest_{}_eu".format(destination_project) test_buckets.append({"name":eubucket,"region":"eu"}) eu2bucket = "bqsynctest_{}_europe-west-2".format(destination_project) test_buckets.append({"name":eu2bucket,"region":"europe-west2"}) logging.info("Checking buckets for bqsync tests exist in right regions and with lifecycle rules...") # loop through test bucket if they do not exist create in the right region and add # #lifecycle rule # if they do exist check they are in right region and have the expected lifecycle rule for bucket_dict in test_buckets: bucket = None try: bucket = stclient.get_bucket(bucket_dict["name"]) except exceptions.NotFound: bucket_ref = storage.Bucket(stclient,name=bucket_dict["name"]) bucket_ref.location = bucket_dict["region"] storage.Bucket.create(bucket_ref,stclient) bucket = stclient.get_bucket(bucket_dict["name"]) rules = bucket.lifecycle_rules nrules = [] found1daydeletrule = False for rule in rules: if isinstance(rule, dict): if "condition" in rule and "age" in rule["condition"] and rule["condition"][ "age"] == 1 and "isLive" in rule["condition"] and rule["condition"][ "isLive"]: found1daydeletrule = True nrules.append(rule) if not found1daydeletrule: nrules.append( {"action": {"type": "Delete"}, "condition": {"age": 1, "isLive": True}}) bucket.lifecycle_rules = nrules bucket.update(stclient) # starting datsets to test with form project bigquery-public-data # along with each entry is list of tables and length of maximum days for day partition test_source_configs = [] # small dataset good to start tests basic types test_source_configs.append({ "description":"small dataset good to start tests basic types", "dataset_name":"fcc_political_ads", "table_filter_regexp":['broadcast_tv_radio_station', 'content_info', 'file_history', 'file_record'], "max_last_days":365 }) # small dataset good to start tests basic types test_source_configs.append({ "description": "date partitioned 1 date type field", "dataset_name": "wikipedia", "table_filter_regexp": ['wikidata'], "max_last_days": None }) # a table with geography data type test_source_configs.append({ "description":"a table with geography data type", "dataset_name": "faa", "table_filter_regexp": ['us_airports'], "max_last_days": 365 }) # a dataset with a day partitioned table with clustering # not using a specific partition column name so just ingest time test_source_configs.append({ "description":"a dataset with a day partitioned table with clustering not using a specific partition column name so just ingest time", "dataset_name": "new_york_subway", "table_filter_regexp": ['geo_nyc_borough_boundaries'], "max_last_days": 365 }) # a dataset with view referencing it self to demo simple view copying test_source_configs.append({ "description":"a dataset with view referencing it self to demo simple view copying", "dataset_name": "noaa_goes16", "table_filter_regexp": ['.*'], "max_last_days": 365 }) # a dataset with functions only test_source_configs.append({ "description":"a dataset with functions only", "dataset_name": "persistent_udfs", "table_filter_regexp": ['.*'], "max_last_days": 365 }) # a dataset with nested table example and a model # models will fail test_source_configs.append({ "description":"a dataset with nested table example and a model", "dataset_name": "samples", "table_filter_regexp": ['github_nested','model'], "max_last_days": 365 }) # a dataset with day partioned no clustering using natural load time test_source_configs.append({ "description":"a dataset with day partioned no clustering using natural load time", "dataset_name": "sec_quarterly_financials", "table_filter_regexp": ['.*'], "max_last_days": 365 * 3 }) # a dataset with a day partitioned table with clustering # using a specific partition column name so not just ingest time # has repetade basic types # note this shows the issue of bq nit correctly supporting avro logical types # https://issuetracker.google.com/issues/35905894 will fail until resolved test_source_configs.append({ "description":"a dataset with a day partitioned table with clustering using a specific partition column name so not just ingest time", "dataset_name": "human_genome_variants", "table_filter_regexp": ['platinum_genomes_deepvariant_variants_20180823'], "max_last_days": None }) test_source_configs = [] test_destination_datasets_list = [] for src_destination in test_source_configs: tests = [] # set up local us test destdatset = "bqsynctest_{}_{}".format("US",src_destination["dataset_name"]).replace("-","_") tests.append({ "subtest":"us intra region", "destdataset": destdatset, "destregion":"US" }) test_destination_datasets_list.append(destdatset) # set up us to eu test destdatset = "bqsynctest_{}_{}".format("EU", src_destination["dataset_name"]).replace( "-", "_") tests.append({ "subtest": "us to eu cross region", "destdataset": destdatset, "destregion": "EU", "dstbucket":eubucket }) test_destination_datasets_list.append(destdatset) # set up us to europe-west2 test # set up us to eu test destdatset = "bqsynctest_{}_{}".format("europe-west2", src_destination["dataset_name"]).replace( "-", "_") tests.append({ "subtest": "us to eu cross region", "destdataset": destdatset, "destregion": "europe-west2", "dstbucket":eu2bucket }) test_destination_datasets_list.append(destdatset) src_destination["tests"] = tests logging.info( "Checking daatsets for bqsync tests exist in right regions and if exist empty them i.e. delete and recreate them...") for datasetname in test_destination_datasets_list: dataset_ref = bqclient.dataset(datasetname) if bqtools.dataset_exists(bqclient,dataset_ref): bqclient.delete_dataset(bqclient.get_dataset(dataset_ref),delete_contents=True) # for each source run sub tests logging.info("Staring tests...") # uncomment below if sync tests not required # test_source_configs =[] for test_config in test_source_configs: # run sub test basically an initial copy followed by # 2nd copy if no data latter should do nothing for dstconfig in test_config["tests"]: # create an empty dataset dataset_ref = bqclient.dataset(dstconfig["destdataset"]) dataset = bigquery.Dataset(dataset_ref) dataset.location = dstconfig["destregion"] dataset = bqclient.create_dataset(dataset) # create initial sync # as source is all in US if not us must need buckets synctest = None if dstconfig["destregion"] == "US": synctest = bqtools.MultiBQSyncCoordinator(["bigquery-public-data.{}".format(test_config["dataset_name"])], ["{}.{}".format(destination_project,dstconfig["destdataset"])], remove_deleted_tables=True, copy_data=True, copy_types=["TABLE","VIEW","ROUTINE","MODEL"], check_depth=0, table_view_filter=test_config["table_filter_regexp"], table_or_views_to_exclude=[], latest_date=None, days_before_latest_day=test_config["max_last_days"], day_partition_deep_check=False, analysis_project=destination_project) else: synctest = bqtools.MultiBQSyncCoordinator( ["bigquery-public-data.{}".format(test_config["dataset_name"])], ["{}.{}".format(destination_project, dstconfig["destdataset"])], srcbucket=usbucket, dstbucket=dstconfig["dstbucket"], remove_deleted_tables=True, copy_data=True, copy_types=["TABLE","VIEW","ROUTINE","MODEL"], check_depth=0, table_view_filter=test_config["table_filter_regexp"], table_or_views_to_exclude=[], latest_date=None, days_before_latest_day=test_config["max_last_days"], day_partition_deep_check=False, analysis_project=destination_project) synctest.sync() self.assertEqual(True, True, "Initial Sync {} {} from bigquery-public-data..{} with {}.{} completed".format( test_config["description"], dstconfig["subtest"], test_config["dataset_name"], destination_project, dstconfig["destdataset"] )) synctest.reset_stats() synctest.sync() self.assertEqual(synctest.tables_avoided, synctest.tables_synced, "Second Sync {} {} from bigquery-public-data..{} with {}.{} " "completed".format( test_config["description"], dstconfig["subtest"], test_config["dataset_name"], destination_project, dstconfig["destdataset"] )) eutest = bqtools.MultiBQSyncCoordinator( ["{}.{}".format(destination_project,test_config["tests"][1]["destdataset"])], ["{}.{}".format(destination_project,test_config["tests"][2]["destdataset"])], srcbucket=eubucket, dstbucket=eu2bucket, remove_deleted_tables=True, copy_data=True, copy_types=["TABLE", "VIEW", "ROUTINE", "MODEL"], check_depth=0, table_view_filter=[".*"], table_or_views_to_exclude=[], latest_date=None, days_before_latest_day=None, day_partition_deep_check=False, analysis_project=destination_project) eutest.sync() self.assertEqual(eutest.tables_avoided + eutest.view_avoided + eutest.routines_avoided, eutest.tables_synced + eutest.views_synced + eutest.routines_synced, "Inter europe Sync {} {} from {}.{} with {}.{}" "completed".format( test_config["description"], "EU to europe-west2", destination_project, test_config["tests"][1]["destdataset"], destination_project, test_config["tests"][2]["destdataset"] )) def test_gendiff(self): bqSchema2 = bqtools.create_schema(self.schemaTest2) views = bqtools.gen_diff_views('foo', 'ar', 'bob', bqSchema2, description="A test schema") vexpected = {'bobdb': { "query": """#standardSQL SELECT _PARTITIONTIME AS scantime, xxrownumbering.partRowNumber, ifnull(tabob.integer,0) as `integer`, ifnull(A1.integer3,0) as `arrayinteger3`, ifnull(A1.foo,0.0) as `arrayfoo`, ifnull(A1.string3,"None") as `arraystring3`, ifnull(A2.test1,0) as `anotherarraytest1`, ifnull(A2.test2,False) as `anotherarraytest2`, ifnull(tabob.string,"None") as `string`, ifnull(tabob.record.appended1,"None") as `recordappended1`, ifnull(tabob.record.float,0.0) as `recordfloat`, ifnull(tabob.record.string2,"None") as `recordstring2`, ifnull(tabob.record.boolean2,False) as `recordboolean2` from `foo.ar.bob` as tabob LEFT JOIN UNNEST(tabob.array) as A1 LEFT JOIN UNNEST(tabob.anotherarray) as A2 JOIN ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`)) AS xxrownumbering ON _PARTITIONTIME = xxrownumbering.scantime """, "description": "View used as basis for diffview:A test schema"}, 'bobdiff' : { "query":"""#standardSQL SELECT * FROM ( SELECT ifnull(earlier.scantime, later.scantime) AS scantime, CASE WHEN earlier.scantime IS NULL AND later.scantime IS NOT NULL THEN 1 WHEN earlier.scantime IS NOT NULL AND later.scantime IS NULL THEN -1 ELSE 0 END AS action, ARRAY(( SELECT field FROM ( SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "integer" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "arrayinteger3" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "arrayfoo" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "arraystring3" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "anotherarraytest1" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "anotherarraytest2" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "string" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordappended1" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordfloat" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordstring2" ELSE CAST(null as string) END as field UNION ALL SELECT CASE WHEN earlier.scantime IS NULL or later.scantime IS NULL then "recordboolean2" ELSE CAST(null as string) END as field ) WHERE field IS NOT NULL) ) AS updatedFields, ifnull(later.integer, earlier.integer) AS `integer`, ifnull(later.arrayinteger3, earlier.arrayinteger3) AS `arrayinteger3`, ifnull(later.arrayfoo, earlier.arrayfoo) AS `arrayfoo`, ifnull(later.arraystring3, earlier.arraystring3) AS `arraystring3`, ifnull(later.anotherarraytest1, earlier.anotherarraytest1) AS `anotherarraytest1`, ifnull(later.anotherarraytest2, earlier.anotherarraytest2) AS `anotherarraytest2`, ifnull(later.string, earlier.string) AS `string`, ifnull(later.recordappended1, earlier.recordappended1) AS `recordappended1`, ifnull(later.recordfloat, earlier.recordfloat) AS `recordfloat`, ifnull(later.recordstring2, earlier.recordstring2) AS `recordstring2`, ifnull(later.recordboolean2, earlier.recordboolean2) AS `recordboolean2` FROM (#standardSQL SELECT _PARTITIONTIME AS scantime, xxrownumbering.partRowNumber, ifnull(tabob.integer,0) as `integer`, ifnull(A1.integer3,0) as `arrayinteger3`, ifnull(A1.foo,0.0) as `arrayfoo`, ifnull(A1.string3,"None") as `arraystring3`, ifnull(A2.test1,0) as `anotherarraytest1`, ifnull(A2.test2,False) as `anotherarraytest2`, ifnull(tabob.string,"None") as `string`, ifnull(tabob.record.appended1,"None") as `recordappended1`, ifnull(tabob.record.float,0.0) as `recordfloat`, ifnull(tabob.record.string2,"None") as `recordstring2`, ifnull(tabob.record.boolean2,False) as `recordboolean2` from `foo.ar.bob` as tabob LEFT JOIN UNNEST(tabob.array) as A1 LEFT JOIN UNNEST(tabob.anotherarray) as A2 JOIN ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`)) AS xxrownumbering ON _PARTITIONTIME = xxrownumbering.scantime ) as later FULL OUTER JOIN (#standardSQL SELECT _PARTITIONTIME AS scantime, xxrownumbering.partRowNumber, ifnull(tabob.integer,0) as `integer`, ifnull(A1.integer3,0) as `arrayinteger3`, ifnull(A1.foo,0.0) as `arrayfoo`, ifnull(A1.string3,"None") as `arraystring3`, ifnull(A2.test1,0) as `anotherarraytest1`, ifnull(A2.test2,False) as `anotherarraytest2`, ifnull(tabob.string,"None") as `string`, ifnull(tabob.record.appended1,"None") as `recordappended1`, ifnull(tabob.record.float,0.0) as `recordfloat`, ifnull(tabob.record.string2,"None") as `recordstring2`, ifnull(tabob.record.boolean2,False) as `recordboolean2` from `foo.ar.bob` as tabob LEFT JOIN UNNEST(tabob.array) as A1 LEFT JOIN UNNEST(tabob.anotherarray) as A2 JOIN ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`)) AS xxrownumbering ON _PARTITIONTIME = xxrownumbering.scantime -- avoid last row as full outer join this will attempt to find a row later -- that won't exist showing as a false delete WHERE partRowNumber < (SELECT MAX(partRowNumber) FROM ( SELECT scantime, ROW_NUMBER() OVER(ORDER BY scantime) AS partRowNumber FROM ( SELECT DISTINCT _PARTITIONTIME AS scantime, FROM `foo.ar.bob`) )) ) as earlier ON earlier.partRowNumber = later.partRowNumber -1 AND earlier.integer = later.integer AND earlier.arrayinteger3 = later.arrayinteger3 AND earlier.arrayfoo = later.arrayfoo AND earlier.arraystring3 = later.arraystring3 AND earlier.anotherarraytest1 = later.anotherarraytest1 AND earlier.anotherarraytest2 = later.anotherarraytest2 AND earlier.string = later.string AND earlier.recordappended1 = later.recordappended1 AND earlier.recordfloat = later.recordfloat AND earlier.recordstring2 = later.recordstring2 AND earlier.recordboolean2 = later.recordboolean2 ) WHERE (action != 0 or array_length(updatedFields) > 0) """, "description":'View calculates what has changed at what time:A test schema' }, 'bobdiffday': { "query": """#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.integer IS NULL THEN 'Added' WHEN l.integer IS NULL THEN 'Deleted' WHEN o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.anotherarraytest1 = l.anotherarraytest1 AND o.anotherarraytest2 = l.anotherarraytest2 AND o.string = l.string AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 THEN 'Same' ELSE 'Updated' END AS action, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.anotherarraytest1 as origanotherarraytest1, l.anotherarraytest1 as lateranotherarraytest1, case when o.anotherarraytest1 = l.anotherarraytest1 then 0 else 1 end as diffanotherarraytest1, o.anotherarraytest2 as origanotherarraytest2, l.anotherarraytest2 as lateranotherarraytest2, case when o.anotherarraytest2 = l.anotherarraytest2 then 0 else 1 end as diffanotherarraytest2, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2 FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 1 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.integer = o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.anotherarraytest1=o.anotherarraytest1 AND l.anotherarraytest2=o.anotherarraytest2 AND l.string=o.string AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2""", "description": "Diff of day of underlying table bob description: A test schema"}, 'bobdiffweek': {'query': """#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.integer IS NULL THEN 'Added' WHEN l.integer IS NULL THEN 'Deleted' WHEN o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.anotherarraytest1 = l.anotherarraytest1 AND o.anotherarraytest2 = l.anotherarraytest2 AND o.string = l.string AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 THEN 'Same' ELSE 'Updated' END AS action, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.anotherarraytest1 as origanotherarraytest1, l.anotherarraytest1 as lateranotherarraytest1, case when o.anotherarraytest1 = l.anotherarraytest1 then 0 else 1 end as diffanotherarraytest1, o.anotherarraytest2 as origanotherarraytest2, l.anotherarraytest2 as lateranotherarraytest2, case when o.anotherarraytest2 = l.anotherarraytest2 then 0 else 1 end as diffanotherarraytest2, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2 FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 7 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.integer = o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.anotherarraytest1=o.anotherarraytest1 AND l.anotherarraytest2=o.anotherarraytest2 AND l.string=o.string AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2""", 'description': 'Diff of week of underlying table bob description: A ' 'test schema'}, 'bobdiffmonth': {'query': """#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.integer IS NULL THEN 'Added' WHEN l.integer IS NULL THEN 'Deleted' WHEN o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.anotherarraytest1 = l.anotherarraytest1 AND o.anotherarraytest2 = l.anotherarraytest2 AND o.string = l.string AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 THEN 'Same' ELSE 'Updated' END AS action, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.anotherarraytest1 as origanotherarraytest1, l.anotherarraytest1 as lateranotherarraytest1, case when o.anotherarraytest1 = l.anotherarraytest1 then 0 else 1 end as diffanotherarraytest1, o.anotherarraytest2 as origanotherarraytest2, l.anotherarraytest2 as lateranotherarraytest2, case when o.anotherarraytest2 = l.anotherarraytest2 then 0 else 1 end as diffanotherarraytest2, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2 FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 30 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.integer = o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.anotherarraytest1=o.anotherarraytest1 AND l.anotherarraytest2=o.anotherarraytest2 AND l.string=o.string AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2""", 'description': 'Diff of month of underlying table bob description: A ' 'test schema'}, 'bobdifffortnight': {'query': """#standardSQL SELECT o.scantime as origscantime, l.scantime as laterscantime, CASE WHEN o.integer IS NULL THEN 'Added' WHEN l.integer IS NULL THEN 'Deleted' WHEN o.integer = l.integer AND o.arrayinteger3 = l.arrayinteger3 AND o.arrayfoo = l.arrayfoo AND o.arraystring3 = l.arraystring3 AND o.anotherarraytest1 = l.anotherarraytest1 AND o.anotherarraytest2 = l.anotherarraytest2 AND o.string = l.string AND o.recordappended1 = l.recordappended1 AND o.recordfloat = l.recordfloat AND o.recordstring2 = l.recordstring2 AND o.recordboolean2 = l.recordboolean2 THEN 'Same' ELSE 'Updated' END AS action, o.integer as originteger, l.integer as laterinteger, case when o.integer = l.integer then 0 else 1 end as diffinteger, o.arrayinteger3 as origarrayinteger3, l.arrayinteger3 as laterarrayinteger3, case when o.arrayinteger3 = l.arrayinteger3 then 0 else 1 end as diffarrayinteger3, o.arrayfoo as origarrayfoo, l.arrayfoo as laterarrayfoo, case when o.arrayfoo = l.arrayfoo then 0 else 1 end as diffarrayfoo, o.arraystring3 as origarraystring3, l.arraystring3 as laterarraystring3, case when o.arraystring3 = l.arraystring3 then 0 else 1 end as diffarraystring3, o.anotherarraytest1 as origanotherarraytest1, l.anotherarraytest1 as lateranotherarraytest1, case when o.anotherarraytest1 = l.anotherarraytest1 then 0 else 1 end as diffanotherarraytest1, o.anotherarraytest2 as origanotherarraytest2, l.anotherarraytest2 as lateranotherarraytest2, case when o.anotherarraytest2 = l.anotherarraytest2 then 0 else 1 end as diffanotherarraytest2, o.string as origstring, l.string as laterstring, case when o.string = l.string then 0 else 1 end as diffstring, o.recordappended1 as origrecordappended1, l.recordappended1 as laterrecordappended1, case when o.recordappended1 = l.recordappended1 then 0 else 1 end as diffrecordappended1, o.recordfloat as origrecordfloat, l.recordfloat as laterrecordfloat, case when o.recordfloat = l.recordfloat then 0 else 1 end as diffrecordfloat, o.recordstring2 as origrecordstring2, l.recordstring2 as laterrecordstring2, case when o.recordstring2 = l.recordstring2 then 0 else 1 end as diffrecordstring2, o.recordboolean2 as origrecordboolean2, l.recordboolean2 as laterrecordboolean2, case when o.recordboolean2 = l.recordboolean2 then 0 else 1 end as diffrecordboolean2 FROM (SELECT * FROM `foo.ar.bobdb` WHERE scantime = ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` WHERE _PARTITIONTIME < ( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob`) AND _PARTITIONTIME < TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 14 DAY) ) ) o FULL OUTER JOIN ( SELECT * FROM `foo.ar.bobdb` WHERE scantime =( SELECT MAX(_PARTITIONTIME) FROM `foo.ar.bob` )) l ON l.integer = o.integer AND l.arrayinteger3=o.arrayinteger3 AND l.arrayfoo=o.arrayfoo AND l.arraystring3=o.arraystring3 AND l.anotherarraytest1=o.anotherarraytest1 AND l.anotherarraytest2=o.anotherarraytest2 AND l.string=o.string AND l.recordappended1=o.recordappended1 AND l.recordfloat=o.recordfloat AND l.recordstring2=o.recordstring2 AND l.recordboolean2=o.recordboolean2""", 'description': 'Diff of fortnight of underlying table bob ' 'description: A test schema'}} for vi in views: expected = vexpected[vi['name']]['query'].splitlines(1) actual = vi['query'].splitlines(1) diff = difflib.unified_diff(expected, actual) diffstr = ''.join(diff) print(diffstr) self.assertEqual(len(vi['query']), len(vexpected[vi['name']]['query']), "Query len for view {} is not equal to what is expected\n:{}:\n:{" "}: diff{}".format( vi['name'], vi['query'], vexpected[ vi['name']][ 'query'],diffstr)) self.assertEqual(vi['query'], vexpected[vi['name']]['query'], "Query for view {} is not equal to what is expected\n:{}:\n:{" "}:".format( vi['name'], vi['query'], vexpected[vi['name']]['query'])) self.assertEqual(vi['description'], vexpected[vi['name']]['description'], "Description for view {} is not equal to what is expected\n:{}:\n:{" "}:".format( vi['name'], vi['description'], vexpected[vi['name']]['description'])) def test_calc_field_depth(self): toTest = [{"name": 'string', "type": 'STRING', "description": None, "mode": 'NULLABLE'}, {"name": 'integer', "type": 'INTEGER', "description": None, "mode": 'NULLABLE'}, {"name": 'float', "type": 'FLOAT', "description": None, "mode": 'NULLABLE'}, {"name": 'boolean', "type": 'BOOLEAN', "description": None, "mode": 'NULLABLE'}, {"name": 'record', "type": 'RECORD', "description": None, "mode": 'NULLABLE', "fields": [{"name": 'string2', "type": 'STRING', "description": None, "mode": 'NULLABLE'}, {"name": 'float', "type": 'FLOAT', "description": None, "mode": 'NULLABLE'}, {"name": 'integer2', "type": 'INTEGER', "description": None, "mode": 'NULLABLE'}, {"name": 'boolean2', "type": 'BOOLEAN', "description": None, "mode": 'NULLABLE'}, {"name": 'record', "type": 'RECORD', "description": None, "mode": 'NULLABLE', "fields": [{"name": 'string2', "type": 'STRING', "description": None, "mode": 'NULLABLE'}, {"name": 'record', "type": 'RECORD', "description": None, "mode": 'NULLABLE', "fields": [{"name": 'string2', "type": 'STRING', "description": None, "mode": 'NULLABLE' }] } ] }] }, {"name": 'array', "type": 'RECORD', "description": None, "mode": 'REPEATED', "fields": [ {"name": 'string3', "type": 'STRING', "description": None, "mode": 'NULLABLE'}, {"name": 'integer3', "type": 'INTEGER', "description": None, "mode": 'NULLABLE'} ]} ] depth = bqtools.calc_field_depth(toTest) self.assertEqual(depth, 3, "measured field depth should be 3") bqtools.trunc_field_depth(toTest, 2) depth = bqtools.calc_field_depth(toTest) self.assertEqual(depth, 2, "measured field depth should be 2 is {}".format(depth)) depth = bqtools.calc_field_depth(self.monsterSchema['schema']['fields']) self.assertEqual(depth, 13, "measured field depth should be 13 is {}".format(depth)) newMonster = copy.deepcopy(self.monsterSchema) yamonster = bqtools.trunc_field_depth(newMonster['schema']['fields'], 10) depth = bqtools.calc_field_depth(newMonster['schema']['fields']) self.assertEqual(depth, 10, "measured field depth should be 10 is {}".format(depth)) depth = bqtools.calc_field_depth(yamonster) self.assertEqual(depth, 10, "measured field depth should be 10 is {}".format(depth)) def test_run_query(self): client = bigquery.client.Client() query = """ SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare` WHERE corpus = @corpus AND word_count >= @min_word_count ORDER BY word_count DESC; """ for row in bqtools.run_query(client, query, logging, desctext="romeo and juliet", params={"corpus": "romeoandjuliet", "min_word_count": 250}, location="US"): dict(row) query = "SELECT @struct_value AS s;" for row in bqtools.run_query(client, query, logging, desctext="struct", params={"struct_value": {"x": 1, "y": "foo"}}, location="US"): dict(row) query = "SELECT TIMESTAMP_ADD(@ts_value, INTERVAL 1 HOUR);" for row in bqtools.run_query(client, query, logging, desctext="datetime", params={"ts_value": datetime.datetime(2016, 12, 7, 8, 0, tzinfo=pytz.UTC)}, location="US"): dict(row) query = """ SELECT name, sum(number) as count FROM `bigquery-public-data.usa_names.usa_1910_2013` WHERE gender = @gender AND state IN UNNEST(@states) GROUP BY name ORDER BY count DESC LIMIT 10; """ for row in bqtools.run_query(client, query, logging, desctext="array", params={"gender": "M", "states": ["WA", "WI", "WV", "WY"]}, location="US"): dict(row) query = """ SELECT * from unnest(@array_name)""" for row in bqtools.run_query(client, query, logging, desctext="array list", params={"array_name": ["WA", "WI", "WV", "WY"]}, location="US"): dict(row) query = """ SELECT * from unnest(@array_name)""" for row in bqtools.run_query(client, query, logging, desctext="array dict", params={"array_name": [{"state": "WA"}, {"state": "WI"}, {"state": "WV"}, {"state": "WY"}]}, location="US"): dict(row) query = """ SELECT * from unnest(?)""" for row in bqtools.run_query(client, query, logging, desctext="array dict positional", params=[[{"state": "WA"}, {"state": "WI"}, {"state": "WV"}, {"state": "WY"}]], location="US"): dict(row) def main(argv): unittest.main() if __name__ == '__main__': main(sys.argv)
52.48855
504
0.405794
14,787
199,404
5.422195
0.049165
0.033675
0.036668
0.033051
0.904824
0.897391
0.887376
0.87882
0.867507
0.859113
0
0.023323
0.494694
199,404
3,798
505
52.50237
0.77241
0.035165
0
0.884467
0
0.002673
0.383968
0.052812
0
0
0
0
0.024948
1
0.006534
false
0.000297
0.004455
0.000594
0.012474
0.013959
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
360c7345e2a583b61c44e0faa6ef6cf4c295e7a8
4,819
py
Python
examples/ex01_different_geometries.py
icemtel/carpet
5905e02ab0e44822829a672955dccad3e09eea07
[ "MIT" ]
null
null
null
examples/ex01_different_geometries.py
icemtel/carpet
5905e02ab0e44822829a672955dccad3e09eea07
[ "MIT" ]
null
null
null
examples/ex01_different_geometries.py
icemtel/carpet
5905e02ab0e44822829a672955dccad3e09eea07
[ "MIT" ]
null
null
null
""" The example with nx=3, ny=4 should run ~1.5secs """ import numpy as np import carpet.visualize as vis import matplotlib.pyplot as plt # =====Ring===== import carpet.lattice.ring1d as lattice # Geometry N = 6 # number of cilia a = 18 # [um] lattice spacing e1 = (1, 0) # direction of the chain ## Initialize # Geometry L1 = lattice.get_domain_size(N, a) coords, lattice_ids = lattice.get_nodes_and_ids(N, a, e1) # get cilia (nodes) coordinates NN, TT = lattice.get_neighbours_list(N, a, e1) # get list of neighbours and relative positions e1, e2 = lattice.get_basis(e1) get_k = lattice.define_get_k(N, a, e1) get_mtwist = lattice.define_get_mtwist(coords, N, a, e1) phi = get_mtwist(2, 0) # sp.zeros([len(coords)]) vis.plot_edges(coords, TT) vis.plot_nodes(coords, phi=phi) plt.ylim([-L1 / 10, L1 / 10]) plt.show() # =====Chain===== ## Almost the same, as ring - only end nodes have only 1 neighbour each. import carpet.lattice.ring1d as lattice # Geometry N = 6 # number of cilia a = 18 # [um] lattice spacing e1 = (1, 0) # direction of the chain ## Initialize # Geometry L1 = lattice.get_domain_size(N, a) coords, lattice_ids = lattice.get_nodes_and_ids(N, a, e1) # get cilia (nodes) coordinates NN, TT = lattice.get_neighbours_list_non_periodic(N, a, e1) # get list of neighbours and relative positions e1, e2 = lattice.get_basis(e1) get_k = lattice.define_get_k(N, a, e1) get_mtwist = lattice.define_get_mtwist(coords, N, a, e1) phi = get_mtwist(2, 0) # sp.zeros([len(coords)]) vis.plot_edges(coords, TT) vis.plot_nodes(coords, phi=phi) plt.ylim([-L1 / 10, L1 / 10]) plt.show() # =====Lattice Triangular 1===== import carpet.lattice.triangular as lattice # Geometry a = 18 # [um] nx = 3 # number of cilia in x-direction ny = 4 # in y-direction: must be even N = nx * ny distances = [1] ## Initialize # Geometry L1, L2 = lattice.get_domain_sizes(nx, ny, a) coords, lattice_ids = lattice.get_nodes_and_ids(nx, ny, a) # get cilia (nodes) coordinates NN, TT = lattice.get_neighbours_list(coords, nx, ny, a, distances) # get list of neighbours and relative positions e1, e2 = lattice.get_basis() get_k = lattice.define_get_k_fbz(nx, ny, a) get_mtwist = lattice.define_get_mtwist(coords, nx, ny, a) phi = get_mtwist(2, 0) # sp.zeros([len(coords)]) vis.plot_edges(coords, TT) vis.plot_nodes(coords, phi=phi) plt.show() # =====Lattice Triangular 1: special neighbours list===== import carpet.lattice.triangular as lattice # Geometry a = 18 # [um] nx = 3 # number of cilia in x-direction ny = 4 # in y-direction: must be even N = nx * ny connections = [a * np.array([np.cos(psi), np.sin(psi)]) # First neighbours for psi in np.linspace(0, 2 * np.pi, 6, endpoint=False)] \ + [np.sqrt(3) * a * np.array([np.cos(psi), np.sin(psi)]) for psi in [np.pi / 2, 3 * np.pi / 2]] # 2nd neighbour (only 1 direction) ## Initialize # Geometry L1, L2 = lattice.get_domain_sizes(nx, ny, a) coords, lattice_ids = lattice.get_nodes_and_ids(nx, ny, a) # get cilia (nodes) coordinates NN, TT = lattice.get_neighbours_list_general(coords, nx, ny, a, connections) # get list of neighbours and relative positions e1, e2 = lattice.get_basis() get_k = lattice.define_get_k_fbz(nx, ny, a) get_mtwist = lattice.define_get_mtwist(coords, nx, ny, a) phi = get_mtwist(2, 0) # sp.zeros([len(coords)]) vis.plot_edges(coords, TT) vis.plot_nodes(coords, phi=phi) plt.show() # ====Lattice Triangular 2===== import carpet.lattice.triangular2 as lattice # Geometry a = 18 # [um] nx = 4 # must be even ny = 3 # number of cilia in y-direction N = nx * ny ## Initialize # Geometry L1, L2 = lattice.get_domain_sizes(nx, ny, a) coords, lattice_ids = lattice.get_nodes_and_ids(nx, ny, a) # get cilia (nodes) coordinates NN, TT = lattice.get_neighbours_list(coords, nx, ny, a) # get list of neighbours and relative positions e1, e2 = lattice.get_basis() get_k = lattice.define_get_k_fbz(nx, ny, a) get_mtwist = lattice.define_get_mtwist(coords, nx, ny, a) phi = get_mtwist(2, 0) # sp.zeros([len(coords)]) vis.plot_edges(coords, TT) vis.plot_nodes(coords, phi=phi) plt.show() # =====Lattice Rectangular===== import carpet.lattice.rectangular as lattice # Geometry a = 18 # [um] nx = 3 # number of cilia in x-direction ny = 4 N = nx * ny ## Initialize # Geometry L1, L2 = lattice.get_domain_sizes(nx, ny, a) coords, lattice_ids = lattice.get_nodes_and_ids(nx, ny, a) # get cilia (nodes) coordinates NN, TT = lattice.get_neighbours_list(coords, nx, ny, a) # get list of neighbours and relative positions e1, e2 = lattice.get_basis() get_k = lattice.define_get_k_fbz(nx, ny, a) get_mtwist = lattice.define_get_mtwist(coords, nx, ny, a) phi = get_mtwist(2, 0) # sp.zeros([len(coords)]) vis.plot_edges(coords, TT) vis.plot_nodes(coords, phi=phi) plt.show()
30.891026
125
0.697448
813
4,819
3.99262
0.130381
0.073937
0.030807
0.024646
0.859519
0.848737
0.848737
0.841343
0.841343
0.826556
0
0.026035
0.163104
4,819
156
126
30.891026
0.778825
0.302345
0
0.836735
0
0
0
0
0
0
0
0
0
1
0
false
0
0.091837
0
0.091837
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3611b3539dad81c72b4dff90bfaa2de57cb346e3
47,801
py
Python
river/tests/core/test__instance_api.py
manzerw/django-river
58fa53ce9e1d790201afa8d044e85cb8ae00c55f
[ "BSD-3-Clause" ]
null
null
null
river/tests/core/test__instance_api.py
manzerw/django-river
58fa53ce9e1d790201afa8d044e85cb8ae00c55f
[ "BSD-3-Clause" ]
null
null
null
river/tests/core/test__instance_api.py
manzerw/django-river
58fa53ce9e1d790201afa8d044e85cb8ae00c55f
[ "BSD-3-Clause" ]
null
null
null
from django.contrib.contenttypes.models import ContentType from django.test import TestCase from hamcrest import ( assert_that, equal_to, has_item, has_property, raises, calling, has_length, is_not, all_of, none, ) from river.models import ( TransitionApproval, PENDING, CANCELLED, APPROVED, Transition, JUMPED, ) from river.models.factories import PermissionObjectFactory, UserObjectFactory from river.tests.matchers import has_approval from river.tests.models import ( BasicTestModel, ModelWithTwoStateFields, ModelWithStringPrimaryKey, ) from river.tests.models.factories import ModelWithTwoStateFieldsObjectFactory from river.utils.exceptions import RiverException # noinspection PyMethodMayBeStatic,DuplicatedCode from rivertest.flowbuilder import ( AuthorizationPolicyBuilder, FlowBuilder, RawState, ) class InstanceApiTest(TestCase): def __init__(self, *args, **kwargs): super(InstanceApiTest, self).__init__(*args, **kwargs) self.content_type = ContentType.objects.get_for_model(BasicTestModel) def test_shouldNotReturnOtherObjectsApprovalsForTheAuthorizedUser(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build() ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_objects(2) .build() ) workflow_object1 = flow.objects[0] workflow_object2 = flow.objects[1] available_approvals = workflow_object1.river.my_field.get_available_approvals( as_user=authorized_user ) assert_that(available_approvals, has_length(1)) assert_that( list(available_approvals), has_item(has_property("workflow_object", workflow_object1)), ) assert_that( list(available_approvals), has_item(is_not(has_property("workflow_object", workflow_object2))), ) def test_shouldNotAllowUnauthorizedUserToProceedToNextState(self): unauthorized_user = UserObjectFactory() authorized_permission = PermissionObjectFactory() state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build() ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that( calling(workflow_object.river.my_field.approve).with_args( as_user=unauthorized_user ), raises(RiverException, "There is no available approval for the user"), ) def test_shouldAllowAuthorizedUserToProceedToNextState(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build() ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(state2))) def test_shouldNotLetUserWhosePriorityComesLaterApproveProceed(self): manager_permission = PermissionObjectFactory() team_leader_permission = PermissionObjectFactory() manager = UserObjectFactory(user_permissions=[manager_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder() .with_priority(0) .with_permission(team_leader_permission) .build(), AuthorizationPolicyBuilder() .with_priority(1) .with_permission(manager_permission) .build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that( calling(workflow_object.river.my_field.approve).with_args(as_user=manager), raises(RiverException, "There is no available approval for the user"), ) def test_shouldNotTransitToNextStateWhenThereAreMultipleApprovalsToBeApproved(self): manager_permission = PermissionObjectFactory() team_leader_permission = PermissionObjectFactory() team_leader = UserObjectFactory(user_permissions=[team_leader_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder() .with_priority(0) .with_permission(team_leader_permission) .build(), AuthorizationPolicyBuilder() .with_priority(1) .with_permission(manager_permission) .build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve(team_leader) assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) def test_shouldTransitToNextStateWhenAllTheApprovalsAreApproved(self): manager_permission = PermissionObjectFactory() team_leader_permission = PermissionObjectFactory() manager = UserObjectFactory(user_permissions=[manager_permission]) team_leader = UserObjectFactory(user_permissions=[team_leader_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder() .with_priority(0) .with_permission(team_leader_permission) .build(), AuthorizationPolicyBuilder() .with_priority(1) .with_permission(manager_permission) .build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve(team_leader) assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve(manager) assert_that(workflow_object.my_field, equal_to(flow.get_state(state2))) def test_shouldDictatePassingNextStateWhenThereAreMultiple(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that( calling(workflow_object.river.my_field.approve).with_args( as_user=authorized_user ), raises( RiverException, "State must be given when there are multiple states for destination", ), ) def test_shouldTransitToTheGivenNextStateWhenThereAreMultipleNextStates(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(state3) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(state3))) def test_shouldNotAcceptANextStateWhichIsNotAmongPossibleNextStates(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") invalid_state = RawState("state4") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .with_additional_state(invalid_state) .build() ) workflow_object = flow.objects[0] assert_that( calling(workflow_object.river.my_field.approve).with_args( as_user=authorized_user, next_state=flow.get_state(invalid_state) ), raises( RiverException, ( f"Invalid state is given\({invalid_state.label}\). " f"Valid states is\(are\) ({','.join([state2.label, state3.label])}" f"|{','.join([state3.label, state2.label])})" ), ), ) def test_shouldAllowCyclicTransitions(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) cycle_state_1 = RawState("cycle_state_1") cycle_state_2 = RawState("cycle_state_2") cycle_state_3 = RawState("cycle_state_3") off_the_cycle_state = RawState("off_the_cycle_state") final_state = RawState("final_state") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(cycle_state_1, cycle_state_2, authorization_policies) .with_transition(cycle_state_2, cycle_state_3, authorization_policies) .with_transition(cycle_state_3, cycle_state_1, authorization_policies) .with_transition(cycle_state_3, off_the_cycle_state, authorization_policies) .with_transition(off_the_cycle_state, final_state, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_2))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_3))) transitions = Transition.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(transitions, has_length(5)) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(5)) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, APPROVED, iteration=0, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, APPROVED, iteration=1, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, PENDING, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, PENDING, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, PENDING, iteration=3, permissions=[authorized_permission], ), ) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(cycle_state_1) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) transitions = Transition.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(transitions, has_length(10)) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(10)) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, APPROVED, iteration=0, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, APPROVED, iteration=1, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, APPROVED, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, CANCELLED, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, CANCELLED, iteration=3, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, PENDING, iteration=3, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, PENDING, iteration=4, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, PENDING, iteration=5, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, PENDING, iteration=5, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, PENDING, iteration=6, permissions=[authorized_permission], ), ) def test_shouldHandleSecondCycleProperly(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) cycle_state_1 = RawState("cycle_state_1") cycle_state_2 = RawState("cycle_state_2") cycle_state_3 = RawState("cycle_state_3") off_the_cycle_state = RawState("off_the_cycle_state") final_state = RawState("final_state") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(cycle_state_1, cycle_state_2, authorization_policies) .with_transition(cycle_state_2, cycle_state_3, authorization_policies) .with_transition(cycle_state_3, cycle_state_1, authorization_policies) .with_transition(cycle_state_3, off_the_cycle_state, authorization_policies) .with_transition(off_the_cycle_state, final_state, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_2))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_3))) transitions = Transition.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(transitions, has_length(5)) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(5)) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, APPROVED, iteration=0, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, APPROVED, iteration=1, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, PENDING, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, PENDING, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, PENDING, iteration=3, permissions=[authorized_permission], ), ) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(cycle_state_1) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_2))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_3))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(cycle_state_1) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(15)) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, APPROVED, iteration=0, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, APPROVED, iteration=1, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, APPROVED, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, CANCELLED, iteration=2, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, CANCELLED, iteration=3, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, APPROVED, iteration=3, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, APPROVED, iteration=4, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, APPROVED, iteration=5, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, CANCELLED, iteration=5, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, CANCELLED, iteration=6, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_1, cycle_state_2, PENDING, iteration=6, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_2, cycle_state_3, PENDING, iteration=7, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, cycle_state_1, PENDING, iteration=8, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( cycle_state_3, off_the_cycle_state, PENDING, iteration=8, permissions=[authorized_permission], ), ) assert_that( approvals, has_approval( off_the_cycle_state, final_state, PENDING, iteration=9, permissions=[authorized_permission], ), ) def test__shouldHandleUndefinedSecondWorkflowCase(self): state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [] flow = ( FlowBuilder( "status1", ContentType.objects.get_for_model(ModelWithTwoStateFields) ) .with_object_factory(lambda: ModelWithTwoStateFieldsObjectFactory().model) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.status1, equal_to(flow.get_state(state1))) assert_that(workflow_object.status2, none()) def test__shouldReturnNextApprovals(self): state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") authorization_policies = [AuthorizationPolicyBuilder().build()] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) next_approvals = workflow_object.river.my_field.next_approvals assert_that(next_approvals, has_length(2)) assert_that( next_approvals, has_item(flow.transitions_approval_metas[0].transition_approvals.first()), ) assert_that( next_approvals, has_item(flow.transitions_approval_metas[1].transition_approvals.first()), ) def test_shouldCancelAllOtherStateTransition(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") state4 = RawState("state4") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .with_transition(state1, state4, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(state3) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(state3))) assert_that( flow.transitions_approval_metas[0].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", CANCELLED))), ), assert_that( flow.transitions_approval_metas[1].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", APPROVED))), ), assert_that( flow.transitions_approval_metas[2].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", CANCELLED))), ) def test_shouldCancelAllOtherStateTransitionDescendants(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") state4 = RawState("state4") state5 = RawState("state5") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .with_transition(state1, state4, authorization_policies) .with_transition(state4, state5, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(state3) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(state3))) assert_that( flow.transitions_approval_metas[0].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", CANCELLED))), ) assert_that( flow.transitions_approval_metas[1].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", APPROVED))), ) assert_that( flow.transitions_approval_metas[2].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", CANCELLED))), ) assert_that( flow.transitions_approval_metas[3].transition_approvals.all(), all_of(has_length(1), has_item(has_property("status", CANCELLED))), ) def test_shouldNotCancelDescendantsIfItIsPartOfPossibleFuture(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) first_state = RawState("first") diamond_left_state_1 = RawState("diamond-left-1") diamond_left_state_2 = RawState("diamond-left-2") diamond_right_state_1 = RawState("diamond-right-1") diamond_right_state_2 = RawState("diamond-right-2") diamond_join_state = RawState("diamond-join") final_state = RawState("final") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(first_state, diamond_left_state_1, authorization_policies) .with_transition(first_state, diamond_right_state_1, authorization_policies) .with_transition( diamond_left_state_1, diamond_left_state_2, authorization_policies ) .with_transition( diamond_right_state_1, diamond_right_state_2, authorization_policies ) .with_transition( diamond_left_state_2, diamond_join_state, authorization_policies ) .with_transition( diamond_right_state_2, diamond_join_state, authorization_policies ) .with_transition(diamond_join_state, final_state, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(first_state))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(diamond_left_state_1) ) assert_that( workflow_object.my_field, equal_to(flow.get_state(diamond_left_state_1)) ) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that( approvals, has_approval(first_state, diamond_left_state_1, APPROVED) ) assert_that( approvals, has_approval(diamond_left_state_1, diamond_left_state_2, PENDING) ) assert_that( approvals, has_approval(diamond_left_state_2, diamond_join_state, PENDING) ) assert_that( approvals, has_approval(first_state, diamond_right_state_1, CANCELLED) ) assert_that( approvals, has_approval(diamond_right_state_1, diamond_right_state_2, CANCELLED), ) assert_that( approvals, has_approval(diamond_right_state_2, diamond_join_state, CANCELLED), ) assert_that(approvals, has_approval(diamond_join_state, final_state, PENDING)) def test_shouldAssessIterationsCorrectly(self): authorized_permission1 = PermissionObjectFactory() authorized_permission2 = PermissionObjectFactory() state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") flow = ( FlowBuilder("my_field", self.content_type) .with_transition( state1, state2, [ AuthorizationPolicyBuilder() .with_permission(authorized_permission1) .build() ], ) .with_transition( state2, state3, [ AuthorizationPolicyBuilder() .with_permission(authorized_permission1) .build(), AuthorizationPolicyBuilder() .with_priority(1) .with_permission(authorized_permission2) .build(), ], ) .build() ) workflow_object = flow.objects[0] approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(3)) assert_that(approvals, has_approval(state1, state2, PENDING, iteration=0)) assert_that( approvals, has_approval( state2, state3, PENDING, iteration=1, permissions=[authorized_permission1], ), ) assert_that( approvals, has_approval( state2, state3, PENDING, iteration=1, permissions=[authorized_permission2], ), ) def test_shouldAssessIterationsCorrectlyWhenCycled(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) cycle_state_1 = RawState("cycle_state_1") cycle_state_2 = RawState("cycle_state_2") cycle_state_3 = RawState("cycle_state_3") off_the_cycle_state = RawState("off_the_cycle_state") final_state = RawState("final_state") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(cycle_state_1, cycle_state_2, authorization_policies) .with_transition(cycle_state_2, cycle_state_3, authorization_policies) .with_transition(cycle_state_3, cycle_state_1, authorization_policies) .with_transition(cycle_state_3, off_the_cycle_state, authorization_policies) .with_transition(off_the_cycle_state, final_state, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_2))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_3))) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(5)) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(cycle_state_1) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_length(10)) assert_that( approvals, has_approval(cycle_state_1, cycle_state_2, APPROVED, iteration=0) ) assert_that( approvals, has_approval(cycle_state_2, cycle_state_3, APPROVED, iteration=1) ) assert_that( approvals, has_approval(cycle_state_3, cycle_state_1, APPROVED, iteration=2) ) assert_that( approvals, has_approval(cycle_state_3, off_the_cycle_state, CANCELLED, iteration=2), ) assert_that( approvals, has_approval(off_the_cycle_state, final_state, CANCELLED, iteration=3), ) assert_that( approvals, has_approval(cycle_state_1, cycle_state_2, PENDING, iteration=3) ) assert_that( approvals, has_approval(cycle_state_2, cycle_state_3, PENDING, iteration=4) ) assert_that( approvals, has_approval(cycle_state_3, cycle_state_1, PENDING, iteration=5) ) assert_that( approvals, has_approval(cycle_state_3, off_the_cycle_state, PENDING, iteration=5), ) assert_that( approvals, has_approval(off_the_cycle_state, final_state, PENDING, iteration=6), ) def test_shouldJumpToASpecificState(self): authorized_permission = PermissionObjectFactory() state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state2, state3, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) approvals = TransitionApproval.objects.filter(workflow_object=workflow_object) assert_that(approvals, has_approval(state1, state2, PENDING)) assert_that(approvals, has_approval(state2, state3, PENDING)) workflow_object.river.my_field.jump_to(flow.get_state(state3)) assert_that(workflow_object.my_field, equal_to(flow.get_state(state3))) approvals = TransitionApproval.objects.filter(workflow_object=workflow_object) assert_that(approvals, has_approval(state1, state2, JUMPED)) assert_that(approvals, has_approval(state2, state3, JUMPED)) def test_shouldNotJumpBackToAPreviousState(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .build() ) workflow_object = flow.objects[0] workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(state2) ) assert_that( calling(workflow_object.river.my_field.jump_to).with_args( flow.get_state(state1) ), raises( RiverException, "This state is not available to be jumped in the future of this object", ), ) def test_shouldJumpToASpecificStateWhenThereAreMultipleNextState(self): authorized_permission = PermissionObjectFactory() state1 = RawState("state1") state2 = RawState("state2") state3 = RawState("state3") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) approvals = TransitionApproval.objects.filter(workflow_object=workflow_object) assert_that(approvals, has_approval(state1, state2, PENDING)) assert_that(approvals, has_approval(state1, state3, PENDING)) workflow_object.river.my_field.jump_to(flow.get_state(state3)) approvals = TransitionApproval.objects.filter(workflow_object=workflow_object) assert_that(approvals, has_approval(state1, state2, JUMPED)) assert_that(approvals, has_approval(state1, state3, JUMPED)) def test_shouldNotCrashWhenAModelObjectWithStringPrimaryKeyIsApproved(self): content_type = ContentType.objects.get_for_model(ModelWithStringPrimaryKey) authorized_permission = PermissionObjectFactory(content_type=content_type) authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state1") state2 = RawState("state2") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("status", content_type) .with_transition(state1, state2, authorization_policies) .with_object_factory(lambda: ModelWithStringPrimaryKey.objects.create()) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.status, equal_to(flow.get_state(state1))) workflow_object.river.status.approve(as_user=authorized_user) assert_that(workflow_object.status, equal_to(flow.get_state(state2))) def test_shouldAllowMultipleCyclicTransitions(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) initial_state = RawState("initial_state") cycle_state_1 = RawState("cycle_state_1") cycle_state_2 = RawState("cycle_state_2") off_the_cycle_state = RawState("off_the_cycle_state") cycle_state_3 = RawState("cycle_state_3") cycle_state_4 = RawState("cycle_state_4") final_state = RawState("final_state") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(initial_state, cycle_state_1, authorization_policies) .with_transition(cycle_state_1, cycle_state_2, authorization_policies) .with_transition(cycle_state_2, cycle_state_1, authorization_policies) .with_transition(cycle_state_1, off_the_cycle_state, authorization_policies) .with_transition(off_the_cycle_state, cycle_state_3, authorization_policies) .with_transition(cycle_state_3, cycle_state_4, authorization_policies) .with_transition(cycle_state_4, cycle_state_3, authorization_policies) .with_transition(cycle_state_3, final_state, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(initial_state))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(cycle_state_2) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_2))) workflow_object.river.my_field.approve(as_user=authorized_user) assert_that(workflow_object.my_field, equal_to(flow.get_state(cycle_state_1))) def test_shouldNotCancelDescendantsThatCanBeTransitedInTheFuture(self): authorized_permission = PermissionObjectFactory() authorized_user = UserObjectFactory(user_permissions=[authorized_permission]) state1 = RawState("state_1") state2 = RawState("state_2") state3 = RawState("state_3") final_state = RawState("final_state") authorization_policies = [ AuthorizationPolicyBuilder().with_permission(authorized_permission).build(), ] flow = ( FlowBuilder("my_field", self.content_type) .with_transition(state1, state2, authorization_policies) .with_transition(state1, state3, authorization_policies) .with_transition(state2, state3, authorization_policies) .with_transition(state3, final_state, authorization_policies) .build() ) workflow_object = flow.objects[0] assert_that(workflow_object.my_field, equal_to(flow.get_state(state1))) workflow_object.river.my_field.approve( as_user=authorized_user, next_state=flow.get_state(state2) ) assert_that(workflow_object.my_field, equal_to(flow.get_state(state2))) approvals = TransitionApproval.objects.filter( workflow=flow.workflow, workflow_object=workflow_object ) assert_that(approvals, has_approval(state3, final_state, PENDING))
35.460682
88
0.615657
4,367
47,801
6.363407
0.040073
0.064414
0.048544
0.056209
0.875778
0.865342
0.85084
0.833459
0.810465
0.798589
0
0.015857
0.304743
47,801
1,347
89
35.487008
0.820305
0.000983
0
0.730145
0
0
0.028166
0.001696
0
0
0
0
0.117848
1
0.021349
false
0.000854
0.00854
0
0.030743
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
361c332623b2861c33a1a3df18deb607fe9ad75e
18,009
py
Python
chunair/kicad-footprint-generator-master/scripts/TerminalBlock_Phoenix/make_TerminalBlock_Phoenix.py
speedypotato/chuni-lite
c8dda8428723f8c4f99075e7cbaa22a44cbc187d
[ "CC-BY-4.0" ]
2
2022-03-18T23:42:51.000Z
2022-03-19T15:31:34.000Z
chunair/kicad-footprint-generator-master/scripts/TerminalBlock_Phoenix/make_TerminalBlock_Phoenix.py
speedypotato/chuni-lite
c8dda8428723f8c4f99075e7cbaa22a44cbc187d
[ "CC-BY-4.0" ]
null
null
null
chunair/kicad-footprint-generator-master/scripts/TerminalBlock_Phoenix/make_TerminalBlock_Phoenix.py
speedypotato/chuni-lite
c8dda8428723f8c4f99075e7cbaa22a44cbc187d
[ "CC-BY-4.0" ]
null
null
null
#!/usr/bin/env python import sys import os import math # ensure that the kicad-footprint-generator directory is available #sys.path.append(os.environ.get('KIFOOTPRINTGENERATOR')) # enable package import from parent directory #sys.path.append("D:\hardware\KiCAD\kicad-footprint-generator") # enable package import from parent directory sys.path.append(os.path.join(sys.path[0],"..","..","kicad_mod")) # load kicad_mod path sys.path.append(os.path.join(sys.path[0],"..","..")) # load kicad_mod path sys.path.append(os.path.join(sys.path[0],"..","tools")) # load kicad_mod path from KicadModTree import * # NOQA from footprint_scripts_terminal_blocks import * if __name__ == '__main__': script_generated_note="script-generated using https://github.com/pointhi/kicad-footprint-generator/scripts/TerminalBlock_Phoenix"; classname="TerminalBlock_Phoenix" pins=range(2,8+1) rm=2.5 package_height=5 leftbottom_offset=[3-0.65, 0.9, 0.65] ddrill=1.2 pad=[2,2] bevel_height=[] opening=[2,1] opening_xoffset=1 opening_yoffset=3.0 secondDrillDiameter=ddrill secondDrillOffset=[0,-3.1] secondDrillPad=pad secondHoleDiameter=2 secondHoleOffset=[-1,-0.5] thirdHoleDiameter=0 thirdHoleOffset=[-1,-1] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,-3.56] nibbleSize=[] nibblePos=[] for p in pins: name="PTSM-0,5-{0}-{1:1.2}-V-THR".format(p,rm); webpage="http://www.produktinfo.conrad.com/datenblaetter/550000-574999/556444-da-01-de-LEITERPLATTENKL__PTSM_0_5__4_2_5_V_THR.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Vertical".format(name, rm, p) makeTerminalBlockVertical(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, opening_xoffset=opening_xoffset, opening_yoffset=opening_yoffset, opening=opening, ddrill=ddrill, pad=pad, bevel_height=bevel_height, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,8+1) rm=2.5 package_height=10 leftbottom_offset=[2.35, 2.8] ddrill=1.2 pad=[1.8,3] screw_diameter=0 bevel_height=[] slit_screw=False screw_pin_offset=[0,0] secondDrillDiameter=ddrill secondDrillOffset=[0,-5] secondDrillPad=pad secondHoleDiameter=[1,1] secondHoleOffset=[0,6.5] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,0] nibbleSize=[] nibblePos=[] for p in pins: name="PTSM-0,5-{0}-{1:1.2}-H-THR".format(p,rm); webpage="http://www.produktinfo.conrad.com/datenblaetter/550000-574999/556441-da-01-de-LEITERPLATTENKL__PTSM_0_5__8_2_5_H_THR.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,16+1) rm=5.08 package_height=9.8 leftbottom_offset=[rm/2, 4.6] ddrill=1.3 pad=[2.6,2.6] screw_diameter=3 bevel_height=[0.5,2,6.9] slit_screw=True screw_pin_offset=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,3.5] nibbleSize=[] nibblePos=[] for p in pins: name="MKDS-1,5-{0}-{1:2.3}".format(p,rm); webpage="http://www.farnell.com/datasheets/100425.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,16+1) rm=5 package_height=9.8 leftbottom_offset=[rm/2, 4.6] ddrill=1.3 pad=[2.6,2.6] screw_diameter=3 bevel_height=[0.5,2,6.9] slit_screw=True screw_pin_offset=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,3.5] nibbleSize=[] nibblePos=[] for p in pins: name="MKDS-1,5-{0}".format(p); webpage="http://www.farnell.com/datasheets/100425.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,16+1) rm=5.08 package_height=11.2 leftbottom_offset=[rm/2, 5.3] ddrill=1.3 pad=[2.6,2.6] screw_diameter=4 bevel_height=[0.5,3,9.2] slit_screw=True screw_pin_offset=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,3.4] nibbleSize=[] nibblePos=[] for p in pins: name="MKDS-3-{0}-{1:2.3}".format(p,rm); webpage="http://www.farnell.com/datasheets/2138224.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,16+1) rm=3.5 package_height=7.6 leftbottom_offset=[rm/2, package_height-3.1] ddrill=1.2 pad=[2.4,2.4] screw_diameter=3 bevel_height=[0.4,1.5] slit_screw=True screw_pin_offset=[0,0] secondDrillDiameter=0 secondDrillOffset=[0,2.54] secondDrillPad=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,1.7] nibbleSize=[] nibblePos=[] for p in pins: name="PT-1,5-{0}-{1:1.2}-H".format(p,rm); webpage=""; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,16+1) rm=5.0 package_height=9 leftbottom_offset=[rm/2, package_height-4] ddrill=1.3 pad=[2.6,2.6] screw_diameter=4 bevel_height=[0.4,1.5] slit_screw=True screw_pin_offset=[0,0] secondDrillDiameter=0 secondDrillOffset=[0,2.54] secondDrillPad=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,2.4] nibbleSize=[] nibblePos=[] for p in pins: name="PT-1,5-{0}-{1:1.2}-H".format(p,rm); webpage="http://www.mouser.com/ds/2/324/ItemDetail_1935161-922578.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(2,3+1) rm=2.54 package_height=6.2 leftbottom_offset=[1.5, 3.1] ddrill=1.1 pad=[2.2,2.2] screw_diameter=2.2 bevel_height=[0.5,5.8] slit_screw=True screw_pin_offset=[0,0] secondDrillDiameter=1.1 secondDrillOffset=[0,2.54] secondDrillPad=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,2.0] nibbleSize=[] nibblePos=[] for p in pins: name="MPT-0,5-{0}-{1:2.3}".format(p,rm); webpage="http://www.mouser.com/ds/2/324/ItemDetail_1725656-920552.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note) pins=range(4,12+1) rm=2.54 package_height=6.2 leftbottom_offset=[1.5, 3.1] ddrill=1.1 pad=[2.2,2.2] screw_diameter=2.2 bevel_height=[0.5,5.8] slit_screw=True screw_pin_offset=[0,0] secondDrillDiameter=0 secondDrillOffset=[0,2.54] secondDrillPad=[0,0] secondHoleDiameter=0 secondHoleOffset=[0,0] thirdHoleDiameter=0 thirdHoleOffset=[0,-4] fourthHoleDiameter=0 fourthHoleOffset=[0,0] fabref_offset=[0,2.0] nibbleSize=[] nibblePos=[] for p in pins: name="MPT-0,5-{0}-{1:2.3}".format(p,rm); webpage="http://www.mouser.com/ds/2/324/ItemDetail_1725672-916605.pdf"; classname_description="Terminal Block Phoenix {0}".format(name); footprint_name="TerminalBlock_Phoenix_{0}_1x{2:02}_P{1:3.2f}mm_Horizontal".format(name, rm, p) makeTerminalBlockStd(footprint_name=footprint_name, pins=p, rm=rm, package_height=package_height, leftbottom_offset=leftbottom_offset, ddrill=ddrill, pad=pad, screw_diameter=screw_diameter, bevel_height=bevel_height, slit_screw=slit_screw, screw_pin_offset=screw_pin_offset, secondHoleDiameter=secondHoleDiameter, secondHoleOffset=secondHoleOffset, thirdHoleDiameter=thirdHoleDiameter, thirdHoleOffset=thirdHoleOffset, fourthHoleDiameter=fourthHoleDiameter, fourthHoleOffset=fourthHoleOffset, secondDrillDiameter=secondDrillDiameter,secondDrillOffset=secondDrillOffset,secondDrillPad=secondDrillPad, nibbleSize=nibbleSize, nibblePos=nibblePos, fabref_offset=fabref_offset, tags_additional=[], lib_name='${KICAD6_3DMODEL_DIR}/'+classname, classname=classname, classname_description=classname_description, webpage=webpage, script_generated_note=script_generated_note)
49.475275
392
0.67333
1,993
18,009
5.871049
0.078274
0.032219
0.028715
0.021366
0.914623
0.903854
0.894112
0.889497
0.886078
0.871464
0
0.045523
0.223
18,009
364
393
49.475275
0.790681
0.019934
0
0.796178
0
0.009554
0.103962
0.044329
0
0
0
0
0
1
0
false
0
0.015924
0
0.015924
0.063694
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3625cf9164736f35bf597dfc259f611a3dfc9c3b
34,164
py
Python
perm_hmm/models/hmms.py
usnistgov/perm_hmm
b57b3cca51d0d91bde438a62f26c0b0123c26aa5
[ "Apache-2.0" ]
null
null
null
perm_hmm/models/hmms.py
usnistgov/perm_hmm
b57b3cca51d0d91bde438a62f26c0b0123c26aa5
[ "Apache-2.0" ]
null
null
null
perm_hmm/models/hmms.py
usnistgov/perm_hmm
b57b3cca51d0d91bde438a62f26c0b0123c26aa5
[ "Apache-2.0" ]
null
null
null
""" An adaptation of the `pyro.distributions.DiscreteHMM`_ class. The additions are to the log_prob method (which is incorrect as written in the pyro package), and the ability to sample from the model, functionality which is not included in the `pyro`_ model. .. _pyro.distributions.DiscreteHMM: https://docs.pyro.ai/en/stable/distributions.html?#pyro.distributions.DiscreteHMM .. _pyro: https://docs.pyro.ai/en/stable/ """ from operator import mul from functools import reduce import torch import pyro import pyro.distributions as dist import pyro.distributions.hmm from pyro.distributions.hmm import _sequential_logmatmulexp from pyro.distributions.util import broadcast_shape from perm_hmm.util import wrap_index from perm_hmm.return_types import HMMOutput from perm_hmm.policies.policy import PermPolicy class DiscreteHMM(pyro.distributions.hmm.DiscreteHMM): """A discrete hidden Markov model that generates data. Adds a correct log_prob method, a vectorized sample method, and a method to compute the posterior log initial state distribution. """ def __init__(self, initial_logits, transition_logits, observation_dist, validate_args=None): """Initializes the HMM. Just passes to the superclass initialization method with a check for the presence of the ``_param`` attribute in the ``observation_dist``. :raises ValueError: If the :attr:`observation_dist` doesn't have a :attr:`.param` attribute. """ if not hasattr(observation_dist, '_param'): raise ValueError("The observation distribution should have a " "'._param' attribute. Try reencoding your " "distribution as a pyro.distributions.Categorical " "object.") super().__init__(initial_logits, transition_logits, observation_dist, validate_args=validate_args) self.has_enumerate_support = self.observation_dist.has_enumerate_support def enumerate_support(self, expand=True): return self.observation_dist.enumerate_support(expand) def posterior_log_initial_state_dist(self, value): """Computes the posterior log initial state distribution. This computation is similar to the forward algorithm. :param torch.Tensor value: The observed data. shape ``(batch_shape, time_dim)`` :returns: The posterior log initial state distribution. shape ``(batch_shape, state_dim)`` :raises ValueError: if the transition matrices are of the wrong size. """ if value.shape[-1] == 0: return self.initial_logits if value.shape[-1] == 1: observation_logits = self.observation_dist.log_prob(value) result = observation_logits + self.initial_logits result -= result.logsumexp(-1, keepdim=True) return result value = value.unsqueeze(-1 - self.observation_dist.event_dim) value = value.float() observation_logits = self.observation_dist.log_prob(value) head = observation_logits[..., 0, :] tail = observation_logits[..., 1:, :] tail = tail.unsqueeze(-2) if len(self.transition_logits.shape) == 2: result = self.transition_logits + tail result = _sequential_logmatmulexp(result) result = result.logsumexp(-1) result = self.initial_logits + head + result result = result - result.logsumexp(-1, keepdim=True) elif len(self.transition_logits.shape) >= 3: result = self.transition_logits[..., :-1, :, :] + tail result = _sequential_logmatmulexp(result) result = result.logsumexp(-1) result = self.initial_logits + head + result result = result - result.logsumexp(-1, keepdim=True) else: raise ValueError('Wrong size for transition matrices') return result def parameters(self): """A parameters method to fit into the torch framework. :return: A list containing the initial log probs, the log transition probs, and the params which describe the observation distribution. """ return \ [ self.initial_logits, self.transition_logits, self.observation_dist._param ] def _nonevent_output_shape(self, sample_shape=()): duration = self.duration if duration is None: if sample_shape == (): time_shape = (1,) else: time_shape = sample_shape[-1:] shape = sample_shape[:-1] + self.batch_shape + time_shape else: time_shape = (duration,) shape = sample_shape + self.batch_shape + time_shape return shape def _flatten_batch(self, shape): time_shape = shape[-1:] total_batches = reduce(mul, shape[:-1], 1) flat_shape = (total_batches,) + time_shape tmats = self.transition_logits.exp().expand( shape + self.transition_logits.shape[-2:] ).reshape(flat_shape + self.transition_logits.shape[-2:]) b = self.observation_dist.batch_shape b_shape = broadcast_shape(shape, b[:-1]) k = self.observation_dist._param.shape flat_params = \ self.observation_dist._param.expand( b_shape + b[-1:] + (-1,)*(len(k)-len(b)) ).reshape(flat_shape + b[-1:] + (-1,)*(len(k)-len(b))) return flat_shape, tmats, flat_params def sample(self, sample_shape=()): """Sample from the distribution. WARNING: This method does not return the correct answer for HMMs with heterogeneous outputs. :param tuple sample_shape: tuple of ints. If the model doesn't contain a time dimension, i.e. if :attr:`transition_logits` has only two dimensions, then the last element of :attr:`sample_shape` is taken to be the time dimension, and all others will be treated independently as a batch. So ``batch_shape = sample_shape[:-1] + self.batch_shape``, ``time_length = sample_shape[-1]`` If :attr:`sample_shape` is the empty tuple and the model doesn't contain a time dimension, we just sample from the initial distribution, otherwise all elements of :attr:`sample_shape` are interpreted as batch dimensions, and the time dimension of the model is always used. So ``batch_shape = sample_shape + self.batch_shape``, ``time_length = self.transition_logits.shape[-3]`` :returns: ``batch_shape`` number of samples, each of length ``time_dim`` :raises ValueError: if the model shape does not broadcast to the sample shape. """ shape = self._nonevent_output_shape(sample_shape) flat_shape, tmats, flat_params = self._flatten_batch(shape) total_batches, steps = flat_shape dtype = self.observation_dist.sample().dtype states = torch.empty(flat_shape, dtype=int) observations = \ torch.empty(flat_shape + self.observation_dist.event_shape, dtype=dtype) with pyro.plate("batches", total_batches) as batch: states[batch, 0] = pyro.sample("x_{}_0".format(batch), dist.Categorical(self.initial_logits.exp()), ) observations[batch, 0] = pyro.sample( "y_{}_0".format(batch), type(self.observation_dist)( flat_params[batch, 0, states[batch, 0]] ), ) for t in pyro.markov(range(1, steps)): states[batch, t] = pyro.sample( "x_{}_{}".format(batch, t), dist.Categorical(tmats[batch, t - 1, states[batch, t - 1]]), ) observations[batch, t] = pyro.sample( "y_{}_{}".format(batch, t), type(self.observation_dist)( flat_params[batch, t, states[batch, t]] ), ) states = states.reshape(shape) observations = observations.reshape(shape + self.observation_dist.event_shape) return HMMOutput(states, observations) def log_prob(self, value): """Computes the log likelihood of the given observations. :param value: observations to compute the log_prob of. shape ``(batch_shape, time_dim)`` :returns: The log likelihoods of the values. shape ``batch_shape`` This code is based on the code for :py:class:`pyro.distributions.hmm.DiscreteHMM`, the license for this is in the ``licenses/HMM_LICENSE.md``. """ value = value.unsqueeze(-1 - self.observation_dist.event_dim).float() observation_logits = self.observation_dist.log_prob(value) result = self.transition_logits + observation_logits.unsqueeze(-1) result = _sequential_logmatmulexp(result) result = self.initial_logits + result.logsumexp(-1) result = result.logsumexp(-1) return result class PermutedDiscreteHMM(DiscreteHMM): """An HMM that allows for the underlying states to be permuted during a run. """ def __init__(self, initial_logits, transition_logits, observation_dist, validate_args=None): """ :param initial_logits: log of the initial distribution shape ``(state_dim,)`` :param transition_logits: log of the transition probabilities shape ``(state_dim, state_dim)`` :param observation_dist: The output distribution of the HMM. Last dimension of its ``batch_shape`` should be of size ``state_dim`` See :py:class:`~pyro.distributions.DiscreteHMM` for details on shape restrictions. :raises ValueError: If the :attr:`observation_dist` does not have the :meth:`enumerate_support` method. """ if not observation_dist.has_enumerate_support: raise ValueError("The observation distribution must have the " ".enumerate_support method.") super().__init__(initial_logits, transition_logits, observation_dist, validate_args=validate_args) @classmethod def from_hmm(cls, hmm: DiscreteHMM): return cls(hmm.initial_logits, hmm.transition_logits, hmm.observation_dist) def sample(self, sample_shape=(), perm_policy: PermPolicy = None): r""" This method allows us to sample from the HMM with a given ``PermPolicy``. :param tuple sample_shape: tuple of ints. If the model doesn't contain a time dimension, i.e. if :attr:`transition_logits` has only two dimensions, then the last element of :attr:`sample_shape` is taken to be the time dimension, and all others will be treated independently as a batch. So ``batch_shape = sample_shape[:-1] + self.batch_shape``, ``time_length = sample_shape[-1]`` If :attr:`sample_shape` is the empty tuple and the model doesn't contain a time dimension, we just sample from the initial distribution, otherwise all elements of :attr:`sample_shape` are interpreted as batch dimensions, and the time dimension of the model is always used. So ``batch_shape = sample_shape + self.batch_shape``, ``time_length = self.transition_logits.shape[-3]`` :param perm_policy: A PermPolicy object, must implement .get_perm, which is a method which takes batched data of shape ``batch_shape`` and returns a batched permutation of shape ``batch_shape + (num_states,)``. :returns: A :py:class:`HMMOutput` object, containing `.states`: :py:class:`torch.Tensor`, dtype :py:class:`int`. The states realized during the run. shape ``batch_shape + (time_dim,)`` `.observations`: :py:class:`torch.Tensor`, dtype :py:class:`float`. The output observations. shape ``batch_shape + (time_dim,)`` """ if perm_policy is None: return super().sample(sample_shape) shape = self._nonevent_output_shape(sample_shape) flat_shape, tmats, flat_params = self._flatten_batch(shape) total_batches, steps = flat_shape dtype = self.observation_dist.sample().dtype states = torch.empty(flat_shape, dtype=int) observations = \ torch.empty( flat_shape + self.observation_dist.event_shape, dtype=dtype ) with pyro.plate("batches", total_batches) as batch: states[batch, 0] = pyro.sample( "x_{}_0".format(batch), dist.Categorical(self.initial_logits.exp().repeat(total_batches, 1)), ) observations[batch, 0] = pyro.sample( "y_{}_0".format(batch), type(self.observation_dist)( flat_params[batch, 0, states[batch, 0]] ), ) for t in pyro.markov(range(1, flat_shape[-1])): shaped_o = observations[batch, t-1].reshape(shape[:-1] + self.observation_dist.event_shape) perm = perm_policy.get_perm(shaped_o, event_dims=self.observation_dist.event_dim).reshape(total_batches, len(self.initial_logits)) states[batch, t] = pyro.sample( "x_{}_{}".format(batch, t), dist.Categorical( tmats[batch, t-1][ wrap_index(perm, perm.shape[:-1]) ][batch, states[batch, t-1]], ), ) observations[batch, t] = pyro.sample( "y_{}_{}".format(batch, t), type(self.observation_dist)( flat_params[batch, t, states[batch, t]] ), ) shaped_o = observations[batch, -1].reshape(shape[:-1] + self.observation_dist.event_shape) perm = perm_policy.get_perm(shaped_o, event_dims=self.observation_dist.event_dim).reshape(total_batches, len(self.initial_logits)) states = states.reshape(shape) observations = observations.reshape(shape + self.observation_dist.event_shape) return HMMOutput( states, observations, ) def expand_with_perm(self, perm): """Expands the model along the time dimension, according to a permutation. :param perm: The list of permutations to apply. Should be of shape ``batch_shape + (num_steps, num_states)``. :return: An HMM expanded along the time dimension. """ batch_shape = perm.shape[:-1] t_logits = self.transition_logits.expand( batch_shape + self.transition_logits.shape[-2:] ) t_logits = t_logits[wrap_index(perm, batch_shape=perm.shape[:-1])] return type(self)(self.initial_logits, t_logits, self.observation_dist) def posterior_log_initial_state_dist(self, data, perm=None): """The posterior log initial state distributions for the data, given the permutations applied. :param torch.Tensor data: Data to compute the posterior initial state distribution for :param torch.Tensor perm: Permutations that were applied. :return: """ if perm is None: return super().posterior_log_initial_state_dist(data) else: batch_shape = perm.shape[:-1] if data.shape[:len(data.shape)-self.observation_dist.event_dim] != batch_shape: raise ValueError("Perms and data do not have the same batch shape.") return self.expand_with_perm(perm).posterior_log_initial_state_dist(data) def log_prob(self, data, perm=None): """ Computes the log prob of a run, using the permutation sequence that was applied to generate the data. :param torch.Tensor perm: int. The encoded permutations applied to the HMM to generate the data. :param torch.Tensor data: float. A tensor containing the data to compute the log_prob for. :returns: float :py:class:`torch.Tensor`. The log probability of the data under the model where the permutations encoded by perm is applied. shape ``perm.shape[:-1]`` :raises ValueError: if :attr:`perm` and :attr:`data` are not compatible shapes. .. seealso:: Method :py:meth:`~perm_hmm.models.hmms.DiscreteHMM.log_prob` """ if perm is None: return super().log_prob(data) batch_shape = perm.shape[:-1] if data.shape[:len(data.shape)-self.observation_dist.event_dim] != batch_shape: raise ValueError("Perms and data do not have the same batch shape.") return self.expand_with_perm(perm).log_prob(data) def random_hmm(n): """A utility for generating random HMMs. Creates a uniformly random HMM with Bernoulli output. This means that each row of the transition matrix is sampled from the Dirichlet distribution of equal concentrations, as well as the initial state distribution, while the output distributions have their "bright" probability drawn uniformly from the unit interval. .. seealso:: :py:meth:`~perm_hmm.models.hmms.random_phmm` :param int n: Number of states for the HMM :return: A DiscreteHMM with Bernoulli outputs. """ dirichlet = dist.Dirichlet(torch.ones(n) / n) initial_logits = (torch.ones(n) / n).log() transition_logits = dirichlet.sample((n,)).log() observation_dist = dist.Bernoulli(torch.rand(n)) return DiscreteHMM(initial_logits, transition_logits, observation_dist) def random_phmm(n): """A utility for generating random PermutedDiscreteHMMs. Creates a uniformly random HMM with Bernoulli output. This means that each row of the transition matrix is sampled from the Dirichlet distribution of equal concentrations, as well as the initial state distribution, while the output distributions have their "bright" probability drawn uniformly from the unit interval. .. seealso:: :py:meth:`~perm_hmm.models.hmms.random_hmm` :param int n: Number of states for the HMM :return: A PermutedDiscreteHMM with Bernoulli outputs. """ hmm = random_hmm(n) return PermutedDiscreteHMM.from_hmm(hmm) class SkipFirstDiscreteHMM(pyro.distributions.hmm.DiscreteHMM): """The initial state does not output. """ def __init__(self, initial_logits, transition_logits, observation_dist, validate_args=None): """ Initializes the HMM. Just passes to the superclass initialization method with a check for the presence of an attribute. :raises ValueError: If the :attr:`observation_dist` doesn't have a :attr:`.param` attribute. """ if not hasattr(observation_dist, '_param'): raise ValueError("The observation distribution should have a " "'._param' attribute. Try reencoding your " "distribution as a pyro.distributions.Categorical " "object.") super().__init__(initial_logits, transition_logits, observation_dist, validate_args=validate_args) self.has_enumerate_support = self.observation_dist.has_enumerate_support def enumerate_support(self, expand=True): return self.observation_dist.enumerate_support(expand) def posterior_log_initial_state_dist(self, value): """Computes the posterior log initial state distribution. :param torch.Tensor value: The observed data. shape ``(batch_shape, time_dim)`` :returns: The posterior log initial state distribution. shape ``(batch_shape, state_dim)`` :raises ValueError: if the transition matrices are of the wrong size. """ if value.shape[-1] == 0: return self.initial_logits value = value.unsqueeze(-1 - self.observation_dist.event_dim) value = value.float() ol = self.observation_dist.log_prob(value) ol = ol.unsqueeze(-2) result = self.transition_logits + ol result = _sequential_logmatmulexp(result) result = result.logsumexp(-1) result = self.initial_logits + result result = result - result.logsumexp(-1, keepdim=True) return result def _nonevent_output_shape(self, sample_shape=()): duration = self.duration if duration is None: if sample_shape == (): time_shape = (1,) else: time_shape = sample_shape[-1:] shape = sample_shape[:-1] + self.batch_shape + time_shape else: time_shape = (duration,) shape = sample_shape + self.batch_shape + time_shape return shape def _flatten_batch(self, shape): time_shape = shape[-1:] total_batches = reduce(mul, shape[:-1], 1) flat_shape = (total_batches,) + time_shape tmats = self.transition_logits.exp().expand( shape + self.transition_logits.shape[-2:] ).reshape(flat_shape + self.transition_logits.shape[-2:]) b = self.observation_dist.batch_shape b_shape = broadcast_shape(shape, b[:-1]) k = self.observation_dist._param.shape flat_params = \ self.observation_dist._param.expand( b_shape + b[-1:] + (-1,)*(len(k)-len(b)) ).reshape(flat_shape + b[-1:] + (-1,)*(len(k)-len(b))) return flat_shape, tmats, flat_params def sample(self, sample_shape=()): """ Sample from the distribution. :param tuple sample_shape: tuple of ints. If the model doesn't contain a time dimension, i.e. if :attr:`transition_logits` has only two dimensions, then the last element of :attr:`sample_shape` is taken to be the time dimension, and all others will be treated independently as a batch. So ``batch_shape = sample_shape[:-1] + self.batch_shape``, ``time_length = sample_shape[-1]`` If :attr:`sample_shape` is the empty tuple and the model doesn't contain a time dimension, we just sample from the initial distribution, otherwise all elements of :attr:`sample_shape` are interpreted as batch dimensions, and the time dimension of the model is always used. So ``batch_shape = sample_shape + self.batch_shape``, ``time_length = self.transition_logits.shape[-3]`` :returns: ``batch_shape`` number of samples, each of length ``time_dim`` :raises ValueError: if the model shape does not broadcast to the sample shape. """ shape = self._nonevent_output_shape(sample_shape) flat_shape, tmats, flat_params = self._flatten_batch(shape) total_batches, steps = flat_shape dtype = self.observation_dist.sample().dtype states = torch.empty(flat_shape[:-1] + (steps + 1,), dtype=int) observations = \ torch.empty(flat_shape + self.observation_dist.event_shape, dtype=dtype) with pyro.plate("batches", total_batches) as batch: states[batch, 0] = pyro.sample("x_{}_0".format(batch), dist.Categorical(self.initial_logits.exp()), ) for t in pyro.markov(range(1, steps+1)): states[batch, t] = pyro.sample( "x_{}_{}".format(batch, t), dist.Categorical(tmats[batch, t - 1, states[batch, t - 1]]), ) observations[batch, t-1] = pyro.sample( "y_{}_{}".format(batch, t-1), type(self.observation_dist)( flat_params[batch, t-1, states[batch, t]] ), ) states = states.reshape(shape[:-1] + (steps+1,)) observations = observations.reshape(shape + self.observation_dist.event_shape) return HMMOutput(states, observations) class SkipFirstPermutedDiscreteHMM(SkipFirstDiscreteHMM): """Allows for the underlying states to be permuted during a run. .. seealso:: :py:class:`~perm_hmm.models.hmms.PermutedDiscreteHMM` """ def __init__(self, initial_logits, transition_logits, observation_dist, validate_args=None): """ :param initial_logits: log of the initial distribution shape ``(state_dim,)`` :param transition_logits: log of the transition probabilities shape ``(state_dim, state_dim)`` :param observation_dist: The output distribution of the HMM. Last dimension of its ``batch_shape`` should be of size ``state_dim`` See :py:class:`pyro.distributions.DiscreteHMM` for details on shape restrictions. :raises ValueError: If the :attr:`observation_dist` does not have the :meth:`enumerate_support` method. """ if not observation_dist.has_enumerate_support: raise ValueError("The observation distribution must have the " ".enumerate_support method.") super().__init__(initial_logits, transition_logits, observation_dist, validate_args=validate_args) @classmethod def from_hmm(cls, hmm: SkipFirstDiscreteHMM): return cls(hmm.initial_logits, hmm.transition_logits, hmm.observation_dist) def sample(self, sample_shape=(), perm_policy: PermPolicy = None): r"""Samples from the distribution. Samples are generated using the ``perm_policy`` to select permutations of the underlying states at each step. The initial state does not have an output in this distribution. :param tuple sample_shape: tuple of ints. If the model doesn't contain a time dimension, i.e. if :attr:`transition_logits` has only two dimensions, then the last element of :attr:`sample_shape` is taken to be the time dimension, and all others will be treated independently as a batch. So ``batch_shape = sample_shape[:-1] + self.batch_shape``, ``time_length = sample_shape[-1]`` If :attr:`sample_shape` is the empty tuple and the model doesn't contain a time dimension, we just sample from the initial distribution, otherwise all elements of :attr:`sample_shape` are interpreted as batch dimensions, and the time dimension of the model is always used. So ``batch_shape = sample_shape + self.batch_shape``, ``time_length = self.transition_logits.shape[-3]`` :param perm_policy: A PermPolicy object, must implement .get_perm, which is a method which takes batched data of shape ``batch_shape`` and returns a batched permutation of shape ``batch_shape + (num_states,)``. :returns: A :py:class:`HMMOutput` object, containing `.states`: :py:class:`torch.Tensor`, dtype :py:class:`int`. The states realized during the run. shape ``batch_shape + (time_dim,)`` `.observations`: :py:class:`torch.Tensor`, dtype :py:class:`float`. The output observations. shape ``batch_shape + (time_dim,)`` """ if perm_policy is None: return super().sample(sample_shape) shape = self._nonevent_output_shape(sample_shape) flat_shape, tmats, flat_params = self._flatten_batch(shape) total_batches, steps = flat_shape dtype = self.observation_dist.sample().dtype states = torch.empty(flat_shape[:-1] + (flat_shape[-1] + 1,), dtype=int) observations = \ torch.empty( flat_shape + self.observation_dist.event_shape, dtype=dtype ) with pyro.plate("batches", total_batches) as batch: states[batch, 0] = pyro.sample( "x_{}_0".format(batch), dist.Categorical(self.initial_logits.exp().repeat(total_batches, 1)), ) perm = torch.arange(len(self.initial_logits)).expand( total_batches, -1, ) for t in pyro.markov(range(1, flat_shape[-1]+1)): states[batch, t] = pyro.sample( "x_{}_{}".format(batch, t), dist.Categorical( tmats[batch, t-1][ wrap_index(perm, perm.shape[:-1]) ][batch, states[batch, t-1]], ), ) observations[batch, t-1] = pyro.sample( "y_{}_{}".format(batch, t-1), type(self.observation_dist)( flat_params[batch, t-1, states[batch, t]] ), ) shaped_o = observations[batch, t-1].reshape( shape[:-1] + self.observation_dist.event_shape ) # Shape the observation before passing to perm, so that the # perms have the right shape in the perm_history later. perm = perm_policy.get_perm( shaped_o, event_dims=self.observation_dist.event_dim ).reshape(total_batches, len(self.initial_logits)) states = states.reshape(shape[:-1] + (shape[-1]+1,)) observations = observations.reshape(shape + self.observation_dist.event_shape) return HMMOutput( states, observations, ) def expand_with_perm(self, perm): # HACK: We use the convention that the last permutation acts after the last # data, so it's irrelevant. Therefore, throw out the last permutation. # On the other hand, the initial permutation is always the identity, so # attach that. perm = perm[..., :-1, :] batch_shape = perm.shape[:-1] num_states = perm.shape[-1] iden = torch.arange(num_states).expand(perm.shape[:-2] + (1, num_states)) perm = torch.cat((iden, perm), dim=-2) batch_shape = batch_shape[:-1] + (batch_shape[-1] + 1,) t_logits = self.transition_logits.expand( batch_shape + self.transition_logits.shape[-2:] ) t_logits = t_logits[wrap_index(perm, batch_shape=perm.shape[:-1])] return type(self)(self.initial_logits, t_logits, self.observation_dist) def posterior_log_initial_state_dist(self, data, perm=None): """The posterior log initial state distributions for the data, given the permutations applied. :param torch.Tensor data: Data to compute the posterior initial state distribution for :param torch.Tensor perm: Permutations that were applied. :return: """ if perm is None: return super().posterior_log_initial_state_dist(data) else: batch_shape = perm.shape[:-1] if data.shape[:len(data.shape)-self.observation_dist.event_dim] != batch_shape: raise ValueError("Perms and data do not have the same batch shape.") return self.expand_with_perm(perm).posterior_log_initial_state_dist(data) def log_prob(self, data, perm=None): """Computes the log prob of a run, using the permutation sequence that was applied to generate the data. :param torch.Tensor perm: int. The encoded permutations applied to the HMM to generate the data. :param torch.Tensor data: float. A tensor containing the data to compute the log_prob for. :returns: float :py:class:`torch.Tensor`. The log probability of the data under the model where the permutations encoded by perm is applied. shape ``perm.shape[:-1]`` :raises ValueError: if :attr:`perm` and :attr:`data` are not compatible shapes. .. seealso:: Method :py:meth:`perm_hmm.models.hmms.DiscreteHMM.log_prob` """ if perm is None: return super().log_prob(data) batch_shape = perm.shape[:-1] if data.shape[:len(data.shape)-self.observation_dist.event_dim] != batch_shape: raise ValueError("Perms and data do not have the same batch shape.") return self.expand_with_perm(perm).log_prob(data) class ExpandedHMM(SkipFirstPermutedDiscreteHMM): r""" HMM with outcomes :math:`\mathcal{Y}`, and state space :math:`\mathcal{S} \times \mathcal{Y}`, where :math:`\mathcal{S}` is the physical state space. """ def lo_to_i(self, lo): r"""Get serial index from tuple index. :param tuple lo: 2-tuple, a pair of :math:`(l, o) \in \mathcal{S} \times \mathcal{Y}` :return: Serial index :math:`i` """ odim = self.observation_dist.enumerate_support().shape[0] return lo[0]*odim + lo[1] def i_to_lo(self, i): r"""Get tuple index from serial :param int i: :return: 2-tuple, a pair of :math:`(l, o) \in \mathcal{S} \times \mathcal{Y}` """ odim = self.observation_dist.enumerate_support().shape[0] return divmod(i, odim)
42.229913
146
0.609004
4,047
34,164
4.977514
0.085001
0.054359
0.04716
0.02502
0.836229
0.815826
0.805103
0.801132
0.79448
0.779091
0
0.006186
0.29493
34,164
808
147
42.282178
0.830081
0.370683
0
0.726582
0
0
0.039883
0.003084
0
0
0
0
0
1
0.075949
false
0
0.027848
0.010127
0.205063
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3653b41accd512bab75a22e465f5006b07fc737a
16,701
py
Python
chatbotapp/cnudata/cafeteria/cafeteria.py
Funbucket/CnuChatBot
e804e67385dd9973db734c1bb4939aca88b1c111
[ "MIT" ]
1
2021-02-23T15:56:10.000Z
2021-02-23T15:56:10.000Z
chatbotapp/cnudata/cafeteria/cafeteria.py
Funbucket/CnuChatBot
e804e67385dd9973db734c1bb4939aca88b1c111
[ "MIT" ]
null
null
null
chatbotapp/cnudata/cafeteria/cafeteria.py
Funbucket/CnuChatBot
e804e67385dd9973db734c1bb4939aca88b1c111
[ "MIT" ]
1
2021-09-08T03:26:02.000Z
2021-09-08T03:26:02.000Z
from chatbotapp.cnudata.cafeteria.studenthall1_info import * # from chatbotapp.cnudata.studenthall2_info import make_answer_food_menu from chatbotapp.cnudata.cafeteria.food_court_time import * from chatbotapp.cnudata.cafeteria.dorm_info import * from chatbotapp.cnudata.cafeteria.new_studenthall2_info import * def get_entire_cafeteria_answer(): response_text = "\n충남대학교 학식 정보\n" answer = insert_text(response_text) reply = make_reply("기숙사식당", "기숙사식당") answer = insert_replies(answer, reply) reply = make_reply("제1학생회관", "제1학생회관") answer = insert_replies(answer, reply) reply = make_reply("제2학생회관", "제2학생회관") answer = insert_replies(answer, reply) reply = make_reply("제3학생회관", "제3학생회관") answer = insert_replies(answer, reply) # reply = make_reply("🌼 제4학생회관", "제4학생회관") # answer = insert_replies(answer, reply) # reply = make_reply("🌼 생활과학대학", "생활과학대학") # answer = insert_replies(answer, reply) return answer def get_studenthall1_answer(): answer = category() return answer def get_ramen_answer(): answer = ramen() return answer def get_gansik_answer(): answer = gansik() return answer def get_america_answer(): answer = america() return answer def get_snack_answer(): answer = snack() return answer def get_korea_answer(): answer = korea() return answer def get_japan_answer(): answer = japan() return answer def get_china_answer(): answer = china() return answer # def get_studenthall2345_answer(name): # response_text = f"\n😋 충남대학교 {name} 메뉴 😋 \n" # response_text += make_answer_food_menu(name) # answer = insert_text(response_text) # reply = make_reply("다른 식당 메뉴보기", "학식") # answer = insert_replies(answer, reply) # # return answer def get_studenthall23_answer(name): answer = get_studenthall23_answer_info(name) return answer def get_entire_time(): answer = entire_time() return answer def get_ramen_time(): answer = ramen_time() return answer def get_gansik_time(): answer = gansik_time() return answer def get_america_time(): answer = america_time() return answer def get_snack_time(): answer = snack_time() return answer def get_korea_time(): answer = korea_time() return answer def get_japan_time(): answer = japan_time() return answer def get_china_time(): answer = china_time() return answer def get_entire_dorm(): answer = dorm_time() return answer # def monday_dorm(): # answer = monday() # return answer # # def tuesday_dorm(): # answer = tuesday() # return answer # # def wednesday_dorm(): # answer = wednesday() # return answer # # def thursday_dorm(): # answer = thursday() # return answer # # def friday_dorm(): # answer = friday() # return answer # # def saturday_dorm(): # answer = saturday() # return answer # # def sunday_dorm(): # answer = sunday() # return answer # # def today_dorm(): # pass def day_of_week_dorm(the_day_of_week_number): if Weekday.MONDAY.value == the_day_of_week_number: answer = day_of_week("MONDAY") if Weekday.TUESDAY.value == the_day_of_week_number: answer = day_of_week("TUESDAY") if Weekday.WEDNESDAY.value == the_day_of_week_number: answer = day_of_week("WEDNESDAY") if Weekday.THURSDAY.value == the_day_of_week_number: answer = day_of_week("THURSDAY") if Weekday.FRIDAY.value == the_day_of_week_number: answer = day_of_week("FRIDAY") if Weekday.SATURDAY.value == the_day_of_week_number: answer = day_of_week("SATURDAY") if Weekday.SUNDAY.value == the_day_of_week_number: answer = day_of_week("SUNDAY") return answer # def get_monday_breakfast_menu(): # text = monday_dorm_menu("breakfast") # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "월요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # def get_monday_lunch_menu(): # text = monday_dorm_menu("lunch") # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "월요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # def get_monday_dinner_menu(): # text = monday_dorm_menu("dinner") # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "월요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer def get_entire_menu(when, the_day_of_week_number): # if Weekday.MONDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "월요일기숙사식당") # if Weekday.TUESDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "화요일기숙사식당") # if Weekday.WEDNESDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "수요일기숙사식당") # if Weekday.THURSDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "목요일기숙사식당") # if Weekday.FRIDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "금요일기숙사식당") # if Weekday.SATURDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "토요일기숙사식당") # if Weekday.SUNDAY.value == the_day_of_week_number: # reply = make_reply("다른시간보기", "일요일기숙사식당") # text = dorm_menu(when, the_day_of_week_number) 원래 이거였는데 , 3가지 다 한꺼번에 나오도록 text = dorm_menu("breakfast",the_day_of_week_number) text += "\n" text += dorm_menu("lunch", the_day_of_week_number) text += "\n" text += dorm_menu("dinner", the_day_of_week_number) answer = insert_text(text) # answer = insert_replies(answer,reply) reply = make_reply("다른식당보기", "학식") answer = insert_replies(answer, reply) reply = make_reply("다른요일보기", "기숙사식당") answer = insert_replies(answer, reply) return answer # print(get_entire_menu("breakfast",1)) # # def get_monday_menu(when): # text = monday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른시간보기", "월요일기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # # # return answer # # def get_tuesday_menu(when): # text = tuesday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "화요일기숙사식당") # answer = insert_replies(answer, reply) # return answer # # def get_tuesday_breakfast_menu(): # # text = tuesday_dorm_menu("breakfast") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "화요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_tuesday_lunch_menu(): # # text = tuesday_dorm_menu("lunch") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "화요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_tuesday_dinner_menu(): # # text = tuesday_dorm_menu("dinner") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "화요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # def get_wednesday_menu(when): # text = wednesday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "수요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # # def get_wednesday_breakfast_menu(): # # text = wednesday_dorm_menu("breakfast") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "수요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_wednesday_lunch_menu(): # # text = wednesday_dorm_menu("lunch") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "수요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_wednesday_dinner_menu(): # # text = wednesday_dorm_menu("dinner") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "수요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # def get_thursday_menu(when): # text = thursday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "목요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # # def get_thursday_breakfast_menu(): # # text = thursday_dorm_menu("breakfast") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "목요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_thursday_lunch_menu(): # # text = thursday_dorm_menu("lunch") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "목요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_thursday_dinner_menu(): # # text = thursday_dorm_menu("dinner") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "목요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # def get_friday_menu(when): # text = friday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "금요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # def get_friday_breakfast_menu(): # # text = friday_dorm_menu("breakfast") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "금요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_friday_lunch_menu(): # # text = friday_dorm_menu("lunch") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "금요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_friday_dinner_menu(): # # text = friday_dorm_menu("dinner") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "금요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # def get_saturday_menu(when): # text = saturday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "토요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # # def get_saturday_breakfast_menu(): # # text = saturday_dorm_menu("breakfast") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "토요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_saturday_lunch_menu(): # # text = saturday_dorm_menu("lunch") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "토요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_saturday_dinner_menu(): # # text = saturday_dorm_menu("dinner") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "토요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # # # def get_sunday_breakfast_menu(): # # text = sunday_dorm_menu("breakfast") # # answer = insert_text(text) # # reply = make_reply("다른식당보기", "학식") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른요일보기", "기숙사식당") # # answer = insert_replies(answer, reply) # # reply = make_reply("다른시간보기", "일요일기숙사식당") # # answer = insert_replies(answer, reply) # # # # return answer # # def get_sunday_menu(when): # text = sunday_dorm_menu(when) # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "일요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # def get_sunday_lunch_menu(): # text = sunday_dorm_menu("lunch") # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "일요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer # # def get_sunday_dinner_menu(): # text = sunday_dorm_menu("dinner") # answer = insert_text(text) # reply = make_reply("다른식당보기", "학식") # answer = insert_replies(answer, reply) # reply = make_reply("다른요일보기", "기숙사식당") # answer = insert_replies(answer, reply) # reply = make_reply("다른시간보기", "일요일기숙사식당") # answer = insert_replies(answer, reply) # # return answer #
30.310345
79
0.642057
1,961
16,701
5.193779
0.047425
0.147275
0.137457
0.230731
0.853412
0.763181
0.760628
0.75729
0.740403
0.698085
0
0.001675
0.21358
16,701
550
80
30.365455
0.773489
0.745105
0
0.295918
0
0
0.041905
0
0
0
0
0
0
1
0.214286
false
0
0.040816
0
0.469388
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
8
365c2295bcf0117d05a6d18bd60b958d77bfeab7
7,003
py
Python
atoman/filtering/filters/tests/test_acna.py
chrisdjscott/Atoman
e87ac31bbdcf53bb8f3efdfb109787d604890394
[ "MIT" ]
9
2015-11-23T12:13:34.000Z
2021-11-18T05:23:35.000Z
atoman/filtering/filters/tests/test_acna.py
chrisdjscott/Atoman
e87ac31bbdcf53bb8f3efdfb109787d604890394
[ "MIT" ]
1
2017-07-17T20:27:50.000Z
2017-07-23T05:27:15.000Z
atoman/filtering/filters/tests/test_acna.py
chrisdjscott/Atoman
e87ac31bbdcf53bb8f3efdfb109787d604890394
[ "MIT" ]
4
2015-11-23T12:13:37.000Z
2017-05-03T08:24:19.000Z
""" Unit tests for ACNA filter """ from __future__ import absolute_import from __future__ import unicode_literals import unittest import numpy as np from ....lattice_gen import lattice_gen_fcc, lattice_gen_bcc from .. import acnaFilter from .. import base from ....gui import _preferences from six.moves import range ################################################################################ class TestACNABCC(unittest.TestCase): """ Test ACNA BCC """ def setUp(self): """ Called before each test """ # generate lattice args = lattice_gen_bcc.Args(sym="Fe", NCells=[10,10,10], a0=2.87, pbcx=True, pbcy=True, pbcz=True) gen = lattice_gen_bcc.BCCLatticeGenerator() status, self.lattice = gen.generateLattice(args) if status: raise unittest.SkipTest("Generate lattice failed (%d)" % status) # filter self.filter = acnaFilter.AcnaFilter("ACNA") def tearDown(self): """ Called after each test """ # remove refs self.lattice = None self.filter = None def test_ACNABCC(self): """ ACNA bcc """ # settings settings = acnaFilter.AcnaFilterSettings() settings.updateSetting("maxBondDistance", 4.0) # set PBC self.lattice.PBC[:] = 1 # filter input filterInput = base.FilterInput() filterInput.inputState = self.lattice filterInput.visibleAtoms = np.arange(self.lattice.NAtoms, dtype=np.int32) filterInput.NScalars = 0 filterInput.fullScalars = np.empty(0, np.float64) filterInput.NVectors = 0 filterInput.fullVectors = np.empty(0, np.float64) # set number of threads _preferences.setNumThreads(1) # call filter result = self.filter.apply(filterInput, settings) self.assertIsInstance(result, base.FilterResult) # make sure num visible is same self.assertEqual(len(filterInput.visibleAtoms), self.lattice.NAtoms) # check Q4 (all atoms same in perfect lattice...) (or should I check them all) scalars = result.getScalars()["ACNA"] for i in range(len(filterInput.visibleAtoms)): self.assertEqual(3, scalars[i]) def test_ACNABCC_4threads(self): """ ACNA bcc (4 threads) """ # settings settings = acnaFilter.AcnaFilterSettings() settings.updateSetting("maxBondDistance", 4.0) # set PBC self.lattice.PBC[:] = 1 # filter input filterInput = base.FilterInput() filterInput.inputState = self.lattice filterInput.visibleAtoms = np.arange(self.lattice.NAtoms, dtype=np.int32) filterInput.NScalars = 0 filterInput.fullScalars = np.empty(0, np.float64) filterInput.NVectors = 0 filterInput.fullVectors = np.empty(0, np.float64) # set number of threads _preferences.setNumThreads(4) # call filter result = self.filter.apply(filterInput, settings) self.assertIsInstance(result, base.FilterResult) # make sure num visible is same self.assertEqual(len(filterInput.visibleAtoms), self.lattice.NAtoms) # check Q4 (all atoms same in perfect lattice...) (or should I check them all) scalars = result.getScalars()["ACNA"] for i in range(len(filterInput.visibleAtoms)): self.assertEqual(3, scalars[i]) ################################################################################ class TestACNAFCC(unittest.TestCase): """ Test ACNA FCC """ def setUp(self): """ Called before each test """ # generate lattice args = lattice_gen_fcc.Args(sym="Au", NCells=[8,8,8], a0=4.078, pbcx=True, pbcy=True, pbcz=True) gen = lattice_gen_fcc.FCCLatticeGenerator() status, self.lattice = gen.generateLattice(args) if status: raise unittest.SkipTest("Generate lattice failed (%d)" % status) # filter self.filter = acnaFilter.AcnaFilter("ACNA") def tearDown(self): """ Called after each test """ # remove refs self.lattice = None self.filter = None def test_ACNAFCC(self): """ ACNA fcc """ # settings settings = acnaFilter.AcnaFilterSettings() settings.updateSetting("maxBondDistance", 3.8) # set PBC self.lattice.PBC[:] = 1 # filter input filterInput = base.FilterInput() filterInput.inputState = self.lattice filterInput.visibleAtoms = np.arange(self.lattice.NAtoms, dtype=np.int32) filterInput.NScalars = 0 filterInput.fullScalars = np.empty(0, np.float64) filterInput.NVectors = 0 filterInput.fullVectors = np.empty(0, np.float64) # set number of threads _preferences.setNumThreads(1) # call filter result = self.filter.apply(filterInput, settings) self.assertIsInstance(result, base.FilterResult) # make sure num visible is same self.assertEqual(len(filterInput.visibleAtoms), self.lattice.NAtoms) # check Q4 (all atoms same in perfect lattice...) (or should I check them all) scalars = result.getScalars()["ACNA"] for i in range(len(filterInput.visibleAtoms)): self.assertEqual(1, scalars[i]) def test_ACNAFCC_4threads(self): """ ACNA fcc (4 threads) """ # settings settings = acnaFilter.AcnaFilterSettings() settings.updateSetting("maxBondDistance", 3.8) # set PBC self.lattice.PBC[:] = 1 # filter input filterInput = base.FilterInput() filterInput.inputState = self.lattice filterInput.visibleAtoms = np.arange(self.lattice.NAtoms, dtype=np.int32) filterInput.NScalars = 0 filterInput.fullScalars = np.empty(0, np.float64) filterInput.NVectors = 0 filterInput.fullVectors = np.empty(0, np.float64) # set number of threads _preferences.setNumThreads(4) # call filter result = self.filter.apply(filterInput, settings) self.assertIsInstance(result, base.FilterResult) # make sure num visible is same self.assertEqual(len(filterInput.visibleAtoms), self.lattice.NAtoms) # check Q4 (all atoms same in perfect lattice...) (or should I check them all) scalars = result.getScalars()["ACNA"] for i in range(len(filterInput.visibleAtoms)): self.assertEqual(1, scalars[i])
31.263393
106
0.578181
704
7,003
5.703125
0.174716
0.054795
0.033873
0.019925
0.868742
0.868742
0.868742
0.868742
0.868742
0.846326
0
0.017648
0.304155
7,003
223
107
31.403587
0.80628
0.139226
0
0.815534
0
0
0.026021
0
0
0
0
0
0.116505
1
0.07767
false
0
0.087379
0
0.184466
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3679f6e8eb988fb007b28ada2741f230ac7f6fc7
125
py
Python
system_a/bridge.py
objarni/gothpy_fun
9678092e7da16bc307b263aa963863672901f050
[ "MIT" ]
null
null
null
system_a/bridge.py
objarni/gothpy_fun
9678092e7da16bc307b263aa963863672901f050
[ "MIT" ]
null
null
null
system_a/bridge.py
objarni/gothpy_fun
9678092e7da16bc307b263aa963863672901f050
[ "MIT" ]
null
null
null
def bridge_open(): # Fake implementation! return True def update_lamp_status(check_status=bridge_open): pass
12.5
49
0.72
16
125
5.3125
0.75
0.235294
0
0
0
0
0
0
0
0
0
0
0.208
125
9
50
13.888889
0.858586
0.16
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0.25
0
0.25
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
7
36adaf7ad10d25d1440dc38ad9b7f1d893287ad0
10,978
py
Python
ehb_client/tests/unit_tests/conftest.py
chop-dbhi/ehb-client
e9e76d2780f66059185b5be3f6ea100a79bbdc22
[ "BSD-2-Clause" ]
null
null
null
ehb_client/tests/unit_tests/conftest.py
chop-dbhi/ehb-client
e9e76d2780f66059185b5be3f6ea100a79bbdc22
[ "BSD-2-Clause" ]
12
2016-03-01T23:41:12.000Z
2020-02-04T19:39:00.000Z
ehb_client/tests/unit_tests/conftest.py
chop-dbhi/ehb-client
e9e76d2780f66059185b5be3f6ea100a79bbdc22
[ "BSD-2-Clause" ]
null
null
null
import pytest import json @pytest.fixture(scope='module') def external_record_get(): return b'{"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:I5CPQ07I5", "path": "Demo", "external_system": 1, "id": 1, "subject": 1}' @pytest.fixture(scope='module') def external_record_get_links(): return b'[{"external_record": {"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:I5CPQ07I5", "path": "Demo", "external_system": 1, "id": 1, "subject": 1}, "type": "familial", "description": "Parent of", "primary": true, "id": 1}]' @pytest.fixture(scope='module') def external_record_query(): return b'[{"external_record": [{"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:I5CPQ07I5", "path": "Demo", "external_system": 1, "id": 1, "subject": 1}, {"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:XM5VUKTNY", "path": "Demo", "external_system": 1, "id": 2, "subject": 1}], "path_": "not_provided", "external_system_": "not_provided", "subject_": "not_provided"}]' @pytest.fixture(scope='module') def external_record_query_error(): return b'[{"id":1,"success":false,"errors":[{"id":8}]}]' @pytest.fixture(scope='module') def external_record_create(): return b'[{"success": true, "created": "2016-9-12 12:52:27", "modified": "2016-9-12 12:52:27", "label_id": 1, "record_id": "xyz123", "id": "10"}]' @pytest.fixture(scope='module') def external_record_create_w_path(): return b'[{"success": true, "created": "2016-9-12 13:0:1", "modified": "2016-9-12 13:0:1", "label_id": 1, "record_id": "xyz123", "path": "testpath", "id": "11"}]' @pytest.fixture(scope='module') def external_record_link(): return b'{"external_record": "10", "success": true, "created": "2016-9-12 13:49:10", "related_record": 1, "relation_type": 1, "modified": "2016-9-12 13:49:10", "id": "2"}' @pytest.fixture(scope='module') def external_record_update_response(): return b'[{"created": "2015-9-29 13:51:16", "id": "1", "success": true, "modified": "2016-9-12 15:53:48"}]' @pytest.fixture(scope='module') def external_system_get(): return b'{"description": "CHOP\'s REDCap Instance", "created": "2015-09-29 12:03:50.196000", "url": "https://redcap.chop.edu/api/", "modified": "2015-09-29 12:03:50.196000", "id": "1", "name": "REDCap"}' @pytest.fixture(scope='module') def external_system_query_url(): return b'[{"url": "http://example.com/noop/", "externalSystem": {"description": "Placeholder for external IDs", "created": "2016-01-10 15:35:41.311000", "url": "http://example.com/noop/", "modified": "2016-01-10 15:35:41.311000", "id": "3", "name": "External Identifiers"}}]' @pytest.fixture(scope='module') def external_system_query_name(): return b'[{"externalSystem": {"description": "Placeholder for external IDs", "created": "2016-01-10 15:35:41.311000", "url": "http://example.com/noop/", "modified": "2016-01-10 15:35:41.311000", "id": "3", "name": "External Identifiers"}, "name": "External Identifiers"}]' @pytest.fixture(scope='module') def external_system_query_not_found_url(): return b'[{"url": "http://ec", "errors": [{"Query": 9}]}]' @pytest.fixture(scope='module') def external_system_query_not_found_name(): return b'[{"name": "foo", "errors": [{"Query": 9}]}]' @pytest.fixture(scope='module') def external_system_get_records(): return b'[{"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:I5CPQ07I5", "path": "Demo", "external_system": 1, "id": 1, "subject": 1}, {"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:XM5VUKTNY", "path": "Demo", "external_system": 1, "id": 2, "subject": 1}]' @pytest.fixture(scope='module') def external_system_get_subjects(): return b'[{"first_name": "John", "last_name": "Sample", "created": "2015-09-29 12:09:05.202000", "dob": "2000-01-01", "modified": "2015-09-29 12:09:05.202000", "organization_subject_id": "42424242", "organization": 1, "id": 1}]' @pytest.fixture(scope='module') def external_system_create(): return b'[{"name": "Test System", "created": "2016-9-21 20:31:13", "id": "4", "success": true, "modified": "2016-9-21 20:31:13"}]' @pytest.fixture(scope='module') def external_system_update(): return b'[{"created": "2015-9-29 12:3:50", "id": "1", "success": true, "modified": "2016-9-21 21:5:56"}]' @pytest.fixture(scope='module') def external_system_update_name(): return b'[{"created": "2015-9-29 12:3:50", "name": "Updated External System", "success": true, "modified": "2016-9-21 21:5:56"}]' @pytest.fixture(scope='module') def external_system_update_url(): return b'[{"created": "2015-9-29 12:3:50", "url": "http://bar.com/", "success": true, "modified": "2016-9-21 21:5:56"}]' @pytest.fixture(scope='module') def group_get_by_id(): return b'{"ehb_key": "MKDKB9W48SLSFM4A", "description": "A BRP Protocol Group", "created": "2015-09-29 12:01:41.692000", "modified": "2015-09-29 12:01:41.692000", "is_locking": "True", "id": "1", "name": "BRP:M0536B4E2DDLA7W6"}' @pytest.fixture(scope='module') def group_get_subjects(): return b'[{"first_name": "John", "last_name": "Sample", "created": "2015-09-29 12:09:05.202000", "dob": "2000-01-01", "modified": "2015-09-29 12:09:05.202000", "organization_subject_id": "42424242", "organization": 1, "id": 1}]' @pytest.fixture(scope='module') def group_add_sub_to_group_success(): return b'[{"id": 1, "success": true}]' @pytest.fixture(scope='module') def group_get_group_records(): return b'[{"created": "2015-09-29 13:51:16.189000", "modified": "2015-09-29 13:51:16.190000", "label": 1, "record_id": "S891XSB0XD1NKRPF:I5CPQ07I5", "path": "Demo", "external_system": 1, "id": 1, "subject": 1}]' @pytest.fixture(scope='module') def group_create(): return b'[{"ehb_key": "6ZD44324ATZRXT0U", "name": "TestGroup", "success": true, "created": "2016-9-23 13:20:10", "modified": "2016-9-23 13:20:10", "id": "3"}]' @pytest.fixture(scope='module') def group_update(): return b'[{"ehb_key": "6ZD44324ATZRXT0U", "created": "2016-9-23 13:20:10", "id": "3", "success": true, "modified": "2016-9-23 13:36:29"}]' @pytest.fixture(scope='module') def group_update_name(): return b'[{"ehb_key": "6ZD44324ATZRXT0U", "created": "2016-9-23 13:20:10", "name": "Test Group", "success": true, "modified": "2016-9-23 13:36:29"}]' @pytest.fixture(scope='module') def org_query_response(): return b'[{"organization": {"id": "1", "subject_id_label": "Record ID", "name": "Amazing Children\'s Hospital", "modified": "2015-09-29 12:01:11.191000", "created": "2015-09-29 12:01:11.191000"}, "name": "Amazing Children\'s Hospital"}]' @pytest.fixture(scope='module') def org_query_bad_response(): return b'[{"errors": [{"Query": 9}], "name": "foo"}]' @pytest.fixture(scope='module') def org_get(): return b'{"id": "1", "subject_id_label": "Record ID", "name": "Amazing Children\'s Hospital", "modified": "2015-09-29 12:01:11.191000", "created": "2015-09-29 12:01:11.191000"}' @pytest.fixture(scope='module') def org_create_response(): return b'[{"name": "Test Organization", "created": "2016-9-23 15:42:39", "id": "2", "success": true, "modified": "2016-9-23 15:42:39"}]' @pytest.fixture(scope='module') def org_update_response(): return b'[{"created": "2015-9-29 12:1:11", "id": "1", "success": true, "modified": "2016-9-23 15:46:12"}]' @pytest.fixture(scope='module') def subject_get_by_id(): return b'{"first_name": "John", "last_name": "Sample", "created": "2015-09-29 12:09:05.202000", "dob": "2000-01-01", "modified": "2015-09-29 12:09:05.202000", "organization_subject_id": "42424242", "organization": 1, "id": 1}' @pytest.fixture(scope='module') def subject_get_org_info(): return subject_get_by_id() @pytest.fixture(scope='module') def subject_create_response(): return b'[{"success": true, "created": "2016-9-23 16:32:11", "modified": "2016-9-23 16:32:11", "organization_id": 1, "organization_subject_id": "MRN123", "id": "2"}]' @pytest.fixture(scope='module') def subject_update_response(): return b'[{"created": "2016-9-23 16:32:11", "id": "2", "success": true, "modified": "2016-9-23 16:36:24"}]' @pytest.fixture(scope='module') def subject_update_response2(): return b'[{"created": "2016-9-23 16:32:11", "organization_id": "1", "organization_subject_id": "MRN123", "success": true, "modified": "2016-9-23 16:36:24"}]' @pytest.fixture(scope='module') def subject_update_badresponse(): return b'[{"errors": [{"id": 1}], "id": "34", "success": false}]' @pytest.fixture(scope='module') def relationship_create_response(): return b'[{"success": true, "created": "2018-9-21 15:0:22", "subject_1_role": 1, "protocol_id": "1", "modified": "2018-9-21 15:0:22", "subject_1": 2, "subject_2_role": 4, "id": "1"}]' @pytest.fixture(scope='module') def relationship_get_by_subject(): json_response = json.loads("""[{\ "id": 1,\ "subject_1": {\ "created": "2015-01-01 00:00:00",\ "modified": "2015-01-01 00:00:00",\ "first_name": " ",\ "last_name": " ",\ "organization": 2,\ "id": 1,\ "organization_subject_id": "MRN123",\ "organization_id_label": "Medical Record Number",\ "dob": "1970-01-01"\ },\ "subject_2": {\ "created": "2015-01-01 00:00:00",\ "modified": "22015-01-01 00:00:00",\ "first_name": " ",\ "last_name": " ",\ "organization": 2,\ "id": 2,\ "organization_subject_id": "JULYTEST",\ "organization_id_label": "Medical Record Number",\ "dob": "1900-01-02"\ },\ "subject_1_role": {\ "created": "2015-01-01 00:00:00",\ "modified": "2015-01-01 00:00:00",\ "id": "4",\ "typ": "familial-sibling",\ "desc": "Brother"\ },\ "subject_2_role": {\ "created": "2015-01-01 00:00:00",\ "modified": "2015-01-01 00:00:00",\ "id": "4",\ "typ": "familial-sibling",\ "desc": "Sister" }}]""") json_string = json.dumps(json_response) return json_string.encode() @pytest.fixture(scope='module') def relationship_get_by_protocol(): return relationship_get_by_subject()
44.991803
528
0.612862
1,522
10,978
4.292378
0.115637
0.079596
0.11021
0.146946
0.840808
0.811266
0.750038
0.639522
0.519057
0.500842
0
0.156406
0.159592
10,978
243
529
45.176955
0.551702
0
0
0.4125
0
0.1
0.683276
0.045728
0
0
0
0
0
1
0.25
false
0
0.0125
0.24375
0.5125
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
7
36bf31bf4a74de8515d68ef35d5cef8afe7a4952
1,749
py
Python
synology_api/core_backup.py
lukas-hetzenecker/synology-api
d9014917823952bad25ed367336b2650bf3ba562
[ "MIT" ]
null
null
null
synology_api/core_backup.py
lukas-hetzenecker/synology-api
d9014917823952bad25ed367336b2650bf3ba562
[ "MIT" ]
null
null
null
synology_api/core_backup.py
lukas-hetzenecker/synology-api
d9014917823952bad25ed367336b2650bf3ba562
[ "MIT" ]
1
2022-02-03T04:07:11.000Z
2022-02-03T04:07:11.000Z
from . import base_api_core class Backup(base_api_core.Core): def __init__(self, ip_address, port, username, password, secure=False, cert_verify=False, dsm_version=2, debug=True): super(Backup, self).__init__(ip_address, port, username, password, secure, cert_verify, dsm_version, debug) def backup_repository_get(self): api_name = 'SYNO.Backup.Repository' info = self.core_list[api_name] api_path = info['path'] req_param = {'version': info['maxVersion'], 'method': 'get'} return self.request_data(api_name, api_path, req_param) def backup_repository_list(self): api_name = 'SYNO.Backup.Repository' info = self.core_list[api_name] api_path = info['path'] req_param = {'version': info['maxVersion'], 'method': 'list'} return self.request_data(api_name, api_path, req_param) def backup_task_list(self): api_name = 'SYNO.Backup.Task' info = self.core_list[api_name] api_path = info['path'] req_param = {'version': info['maxVersion'], 'method': 'list'} return self.request_data(api_name, api_path, req_param) def backup_task_status(self): api_name = 'SYNO.Backup.Task' info = self.core_list[api_name] api_path = info['path'] req_param = {'version': info['maxVersion'], 'method': 'status'} return self.request_data(api_name, api_path, req_param) def backup_task_get(self): api_name = 'SYNO.Backup.Task' info = self.core_list[api_name] api_path = info['path'] req_param = {'version': info['maxVersion'], 'method': 'get'} return self.request_data(api_name, api_path, req_param)
36.4375
121
0.639794
229
1,749
4.567686
0.179039
0.100382
0.095602
0.133843
0.825048
0.825048
0.744742
0.744742
0.744742
0.744742
0
0.000745
0.232704
1,749
47
122
37.212766
0.778689
0
0
0.705882
0
0
0.141304
0.025172
0
0
0
0
0
1
0.176471
false
0.058824
0.029412
0
0.382353
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
8
36dfbb927284427520e5b7c55be516fc31bf79c5
48,488
py
Python
main.py
patrickjane/hss-skill-s710-weather
a3010c0e9dcb20171fc7fbb1fde4d93a75ced2ea
[ "MIT" ]
2
2020-07-09T03:29:51.000Z
2020-08-07T06:05:56.000Z
main.py
patrickjane/hss-skill-s710-weather
a3010c0e9dcb20171fc7fbb1fde4d93a75ced2ea
[ "MIT" ]
1
2022-01-07T10:03:29.000Z
2022-01-07T10:03:29.000Z
main.py
patrickjane/hss-s710-weather
a3010c0e9dcb20171fc7fbb1fde4d93a75ced2ea
[ "MIT" ]
null
null
null
#!/usr/bin/env python # ----------------------------------------------------------------------------- # HSS skill implementation # Copyright (c) 2020 - Patrick Fial # ----------------------------------------------------------------------------- # main.py # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import skill import asyncio # ------------------------------------------------------------------------------ # main # ------------------------------------------------------------------------------ if __name__ == "__main__": skill = skill.Skill() if not skill.develop: skill.run() else: loop = asyncio.get_event_loop() if skill.default_language.startswith("de"): pass # print("--------------------- s710:getForecast -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "jetzt"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "heute"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "heute früh"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "heute vormittag"}, {"time": "todayForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "gegen mittag"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "am nachmittag"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "am abend"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "in der nacht"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen früh"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen am vormittag"}, {"time": "tomorrowForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen gegen mittag"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen am nachmittag"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen am abend"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "morgen in der nacht"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen früh"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen am vormittag"}, {"time": "dayAfterForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen am mittag"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen nachmittag"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen gegen abend"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "übermorgen in der nacht"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "diese woche"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "ende der woche"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "nächste woche"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "montag"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "dienstag"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "mittwoch"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "donnerstag"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "freitag"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "samstag"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "sonntag"}, {"time": "sunday"})); # print("--------------------- s710:getTemperature -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "jetzt"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "heute"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "heute früh"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "heute vormittag"}, {"time": "todayForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "gegen mittag"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "am nachmittag"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "am abend"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "in der nacht"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen früh"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen am vormittag"}, {"time": "tomorrowForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen gegen mittag"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen am nachmittag"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen am abend"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "morgen in der nacht"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen früh"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen am vormittag"}, {"time": "dayAfterForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen am mittag"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen nachmittag"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen gegen abend"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "übermorgen in der nacht"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "diese woche"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "ende der woche"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "nächste woche"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "montag"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "dienstag"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "mittwoch"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "donnerstag"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "freitag"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "samstag"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "sonntag"}, {"time": "sunday"})); # print("--------------------- s710:hasSun -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "jetzt"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "heute"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "heute früh"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "heute vormittag"}, {"time": "todayForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "gegen mittag"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "am nachmittag"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "am abend"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "in der nacht"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen früh"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen am vormittag"}, {"time": "tomorrowForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen gegen mittag"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen am nachmittag"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen am abend"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "morgen in der nacht"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen früh"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen am vormittag"}, {"time": "dayAfterForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen am mittag"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen nachmittag"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen gegen abend"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "übermorgen in der nacht"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "diese woche"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "ende der woche"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "nächste woche"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "montag"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "dienstag"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "mittwoch"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "donnerstag"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "freitag"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "samstag"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "sonntag"}, {"time": "sunday"})); # print("--------------------- s710:hasRain -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "jetzt"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "heute"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "heute früh"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "heute vormittag"}, {"time": "todayForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "gegen mittag"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "am nachmittag"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "am abend"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "in der nacht"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen früh"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen am vormittag"}, {"time": "tomorrowForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen gegen mittag"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen am nachmittag"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen am abend"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "morgen in der nacht"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen früh"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen am vormittag"}, {"time": "dayAfterForenoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen am mittag"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen nachmittag"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen gegen abend"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "übermorgen in der nacht"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "diese woche"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "ende der woche"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "nächste woche"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "montag"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "dienstag"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "mittwoch"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "donnerstag"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "freitag"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "samstag"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "sonntag"}, {"time": "sunday"})); elif skill.default_language.startswith("en"): pass # print("--------------------- s710:getForecast -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "right now"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "today"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "ealier today"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "around noon"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "towards afternoon"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "this evening"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "at night"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tomorrow"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tomorrow morning"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tomorrow around noon"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tomorrow afternoon"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tomorrow at evening"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tomorrow night"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "day after tomorrow"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "day after tomorrow morning"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "day after tomorrow around noon"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "day after tomorrow at afternoon"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "day after tomorrow evening"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "day after tomorrow night"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "this week"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "towards the end of the week"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "in the next week"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "monday"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "tuesday"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "wednesday"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "thursday"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "friday"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "saturday"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getForecast", {"time": "sunday"}, {"time": "sunday"})); # print("--------------------- s710:getTemperature -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "right now"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "today"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "ealier today"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "around noon"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "towards afternoon"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "this evening"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "at night"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tomorrow"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tomorrow morning"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tomorrow around noon"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tomorrow afternoon"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tomorrow at evening"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tomorrow night"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "day after tomorrow"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "day after tomorrow morning"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "day after tomorrow around noon"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "day after tomorrow at afternoon"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "day after tomorrow evening"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "day after tomorrow night"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "this week"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "towards the end of the week"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "in the next week"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "monday"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "tuesday"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "wednesday"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "thursday"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "friday"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "saturday"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:getTemperature", {"time": "sunday"}, {"time": "sunday"})); # print("--------------------- s710:hasSun -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "right now"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "today"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "ealier today"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "around noon"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "towards afternoon"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "this evening"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "at night"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tomorrow"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tomorrow morning"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tomorrow around noon"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tomorrow afternoon"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tomorrow at evening"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tomorrow night"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "day after tomorrow"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "day after tomorrow morning"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "day after tomorrow around noon"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "day after tomorrow at afternoon"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "day after tomorrow evening"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "day after tomorrow night"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "this week"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "towards the end of the week"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "in the next week"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "monday"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "tuesday"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "wednesday"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "thursday"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "friday"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "saturday"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasSun", {"time": "sunday"}, {"time": "sunday"})); # print("--------------------- s710:hasRain -------------------------") # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "right now"}, {"time": "now"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "today"}, {"time": "today"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "ealier today"}, {"time": "todayMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "around noon"}, {"time": "todayNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "towards afternoon"}, {"time": "todayAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "this evening"}, {"time": "todayEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "at night"}, {"time": "todayNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tomorrow"}, {"time": "tomorrow"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tomorrow morning"}, {"time": "tomorrowMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tomorrow around noon"}, {"time": "tomorrowNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tomorrow afternoon"}, {"time": "tomorrowAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tomorrow at evening"}, {"time": "tomorrowEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tomorrow night"}, {"time": "tomorrowNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "day after tomorrow"}, {"time": "dayAfter"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "day after tomorrow morning"}, {"time": "dayAfterMorning"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "day after tomorrow around noon"}, {"time": "dayAfterNoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "day after tomorrow at afternoon"}, {"time": "dayAfterAfternoon"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "day after tomorrow evening"}, {"time": "dayAfterEvening"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "day after tomorrow night"}, {"time": "dayAfterNight"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "this week"}, {"time": "thisWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "towards the end of the week"}, {"time": "weekend"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "in the next week"}, {"time": "nextWeek"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "monday"}, {"time": "monday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "tuesday"}, {"time": "tuesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "wednesday"}, {"time": "wednesday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "thursday"}, {"time": "thursday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "friday"}, {"time": "friday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "saturday"}, {"time": "saturday"})); # loop.run_until_complete(skill.handle({"empty": True}, "4aac32e9-cbf2-4bfd-a0a3-ae565ab19043", "default", "s710:hasRain", {"time": "sunday"}, {"time": "sunday"}));
167.778547
219
0.640406
5,256
48,488
5.812785
0.023782
0.055905
0.095837
0.159728
0.990737
0.990737
0.989461
0.989461
0.989461
0.989461
0
0.109599
0.12236
48,488
289
220
167.778547
0.608342
0.919939
0
0.166667
0
0
0.003317
0
0
0
0
0
0
1
0
false
0.166667
0.166667
0
0.166667
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
9
36f08d9333f33487222f28add229241d6208b01a
2,304
py
Python
client/icons.py
Lakitna/Longterm-reminder
cfcf079f22fd05bf166df18e51db3749e8e6da23
[ "MIT" ]
1
2018-05-11T13:58:52.000Z
2018-05-11T13:58:52.000Z
client/icons.py
Lakitna/Longterm-reminder
cfcf079f22fd05bf166df18e51db3749e8e6da23
[ "MIT" ]
null
null
null
client/icons.py
Lakitna/Longterm-reminder
cfcf079f22fd05bf166df18e51db3749e8e6da23
[ "MIT" ]
1
2018-05-11T13:58:56.000Z
2018-05-11T13:58:56.000Z
def get(id): if id == 0: # Empty bytearray return bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') if id == 1: # Icon 1 return bytearray(b'\xff\x01\x01\x01\xf1\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\xf1\x01\x01\x01\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x01\x01\x01\xf1\x11\x11\x11\x11\x11\x11\xf1\x01\x01\x01\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x80\x80\x80\x8f\x88\x88\x88\x88\x88\x88\x8f\x80\x80\x80\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\x80\x80\x80\x8f\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x8f\x80\x80\x80\xff') if id == 2: # Icon 2 return bytearray(b'\xff\x01\x01\x01\xf1\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\xf1\x01\x01\x01\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x01\x01\x01\xf1\x11\x11\x11\x11\x11\x11\xf1\x01\x01\x01\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x80\x80\x80\x8f\x88\x88\x88\x88\x88\x88\x8f\x80\x80\x80\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\x80\x80\x80\x8f\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x8f\x80\x80\x80\xff') if id == 'wifi': # Wifi icon return bytearray(b'\x00\x00\x00\x00\x00\x00\x80\x80\xC0\xC0\xC0\xC0\xE0\xE0\xE0\xE0\xE0\xE0\xE0\xE0\xC0\xC0\xC0\xC0\x80\x80\x00\x00\x00\x00\x00\x00\x08\x1C\x3E\x3E\x1F\x1F\x0F\x0F\x07\x87\x83\xC3\xC3\xC3\xC3\xC3\xC3\xC3\xC3\xC3\xC3\x83\x87\x07\x0F\x0F\x1F\x1F\x3E\x3E\x1C\x08\x00\x00\x00\x00\x00\x00\x06\x0F\x1F\x0F\x0F\x07\x87\x83\xC3\xC3\xC3\xC3\x83\x87\x07\x0F\x0F\x1F\x0F\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x07\x0F\x0F\x07\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
144
541
0.721788
547
2,304
3.040219
0.062157
0.728803
0.974143
1.140108
0.905592
0.905592
0.883945
0.869513
0.869513
0.835839
0
0.404611
0.039931
2,304
15
542
153.6
0.347197
0.016927
0
0.222222
0
0.444444
0.908367
0.906596
0
1
0
0
0
1
0.111111
false
0
0
0
0.555556
0
0
0
0
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
1
1
0
0
0
0
1
1
1
null
1
0
0
0
0
0
0
0
0
0
1
0
0
17
7ff2869fbfca91d7168972d6cfcf6f88e89fb5f9
1,022,265
py
Python
testlib/src/main/resources/zssdk_bak.py
Abortbeen/zstack
40f195893250b84881798a702f3b2455c83336a1
[ "Apache-2.0" ]
1
2020-05-08T12:11:20.000Z
2020-05-08T12:11:20.000Z
testlib/src/main/resources/zssdk_bak.py
Abortbeen/zstack
40f195893250b84881798a702f3b2455c83336a1
[ "Apache-2.0" ]
null
null
null
testlib/src/main/resources/zssdk_bak.py
Abortbeen/zstack
40f195893250b84881798a702f3b2455c83336a1
[ "Apache-2.0" ]
null
null
null
import re import sys try: import urllib3 except ImportError: print 'urlib3 is not installed, run "pip install urlib3"' sys.exit(1) import string import json from uuid import uuid4 import time import threading import functools import traceback import base64 import hmac import sha from hashlib import sha1 import datetime import time CONFIG_HOSTNAME = 'hostname' CONFIG_PORT = 'port' CONFIG_POLLING_TIMEOUT = 'default_polling_timeout' CONFIG_POLLING_INTERVAL = 'default_polling_interval' CONFIG_WEBHOOK = 'webhook' CONFIG_READ_TIMEOUT = 'read_timeout' CONFIG_WRITE_TIMEOUT = 'write_timeout' CONFIG_CONTEXT_PATH = 'context_path' HEADER_JOB_UUID = "X-Job-UUID" HEADER_WEBHOOK = "X-Web-Hook" HEADER_JOB_SUCCESS = "X-Job-Success" HEADER_AUTHORIZATION = "Authorization" OAUTH = "OAuth" LOCATION = "location" HTTP_ERROR = "sdk.1000" POLLING_TIMEOUT_ERROR = "sdk.1001" INTERNAL_ERROR = "sdk.1002" __config__ = {} class SdkError(Exception): pass def _exception_safe(func): @functools.wraps(func) def wrap(*args, **kwargs): try: func(*args, **kwargs) except: print traceback.format_exc() return wrap def _error_if_not_configured(): if not __config__: raise SdkError('call configure() before using any APIs') def _http_error(status, body=None): err = ErrorCode() err.code = HTTP_ERROR err.description = 'the http status code[%s] indicates a failure happened' % status err.details = body return {'error': err} def _error(code, desc, details): err = ErrorCode() err.code = code err.desc = desc err.details = details return {'error': err} def configure( hostname='127.0.0.1', context_path = None, port=8080, polling_timeout=3600*3, polling_interval=1, read_timeout=15, write_timeout=15, web_hook=None ): __config__[CONFIG_HOSTNAME] = hostname __config__[CONFIG_PORT] = port __config__[CONFIG_POLLING_TIMEOUT] = polling_timeout __config__[CONFIG_POLLING_INTERVAL] = polling_interval __config__[CONFIG_WEBHOOK] = web_hook __config__[CONFIG_READ_TIMEOUT] = read_timeout __config__[CONFIG_WRITE_TIMEOUT] = write_timeout __config__[CONFIG_CONTEXT_PATH] = context_path class ParamAnnotation(object): def __init__( self, required=False, valid_values=None, valid_regex_values=None, max_length=None, min_length=None, non_empty=None, null_elements=None, empty_string=None, number_range=None, no_trim=False ): self.required = required self.valid_values = valid_values self.valid_regex_values = valid_regex_values self.max_length = max_length self.min_length = min_length self.non_empty = non_empty self.null_elements = null_elements self.empty_string = empty_string self.number_range = number_range self.no_trim = no_trim class ErrorCode(object): def __init__(self): self.code = None self.description = None self.details = None self.cause = None class Obj(object): def __init__(self, d): for a, b in d.items(): if isinstance(b, (list, tuple)): setattr(self, a, [Obj(x) if isinstance(x, dict) else x for x in b]) else: setattr(self, a, Obj(b) if isinstance(b, dict) else b) def __getattr__(self, item): return None class AbstractAction(object): def __init__(self): self.apiId = None self.sessionId = None self.systemTags = None self.userTags = None self.timeout = None self.pollingInterval = None self._param_descriptors = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } self._param_descriptors.update(self.PARAMS) def _check_params(self): for param_name, annotation in self._param_descriptors.items(): value = getattr(self, param_name, None) if value is None and annotation.required: raise SdkError('missing a mandatory parameter[%s]' % param_name) if value is not None and annotation.valid_values and value not in annotation.valid_values: raise SdkError('invalid parameter[%s], the value[%s] is not in the valid options%s' % (param_name, value, annotation.valid_values)) if value is not None and isinstance(value, str) and annotation.max_length and len(value) > annotation.max_length: raise SdkError('invalid length[%s] of the parameter[%s], the max allowed length is %s' % (len(value), param_name, annotation.max_length)) if value is not None and isinstance(value, str) and annotation.min_length and len(value) > annotation.min_length: raise SdkError('invalid length[%s] of the parameter[%s], the minimal allowed length is %s' % (len(value), param_name, annotation.min_length)) if value is not None and isinstance(value, list) and annotation.non_empty is True and len(value) == 0: raise SdkError('invalid parameter[%s], it cannot be an empty list' % param_name) if value is not None and isinstance(value, list) and annotation.null_elements is True and None in value: raise SdkError('invalid parameter[%s], the list cannot contain a null element' % param_name) if value is not None and isinstance(value, str) and annotation.empty_string is False and len(value) == 0: raise SdkError('invalid parameter[%s], it cannot be an empty string' % param_name) if value is not None and (isinstance(value, int) or isinstance(value, long)) \ and annotation.number_range is not None and len(annotation.number_range) == 2: low = annotation.number_range[0] high = annotation.number_range[1] if value < low or value > high: raise SdkError('invalid parameter[%s], its value is not in the valid range' % annotation.number_range) if value is not None and isinstance(value, str) and annotation.no_trim is False: value = str(value).strip() setattr(self, param_name, value) if self.NEED_SESSION: if self.sessionId is None and (self.accessKeyId is None or self.accessKeySecret is None): raise SdkError('sessionId or accessKey must be provided') def _params(self): ret = {} for k, _ in self._param_descriptors.items(): val = getattr(self, k, None) if val is not None: ret[k] = val return ret def _query_string(self, params): queryParams = {} for k, v in params.items(): if k == "accessKeySecret": continue if k == "accessKeyId": continue queryParams[k] = v return '&'.join(['%s=%s' % (k, v) for k, v in queryParams.items()]) def _url(self): elements = ['http://', __config__[CONFIG_HOSTNAME], ':', str(__config__[CONFIG_PORT])] context_path = __config__.get(CONFIG_CONTEXT_PATH, None) if context_path is not None: elements.append(context_path) elements.append('/v1') path = self.PATH.replace('{', '${') unresolved = re.findall('${(.+?)}', path) params = self._params() if unresolved: for u in unresolved: if u in params: raise SdkError('missing a mandatory parameter[%s]' % u) path = string.Template(path).substitute(params) elements.append(path) if self.HTTP_METHOD == 'GET' or self.HTTP_METHOD == 'DELETE': elements.append('?') elements.append(self._query_string(params)) return ''.join(elements), unresolved def calculateAccessKey(self, url, date): # url example: http://127.0.0.1:8080/zstack/v1/vminstances/uuid?xx /* url example: http://127.0.0.1:8080/v1/vminstances/uuid */ elements = url.split(":") path = elements[2].split("/", 2) path = path[2].split("?") h = hmac.new(self.accessKeySecret, self.HTTP_METHOD + "\n" + "\n" # no header: Content_MD5 + "application/json\n" # no header: Content_Type + date + "\n" + "/" + path[0], sha1) Signature = base64.b64encode(h.digest()) return "ZStack %s:%s" % (self.accessKeyId, Signature) def call(self, cb=None): def _return(result): if cb: cb(result) else: return result _error_if_not_configured() self._check_params() url, params_in_url = self._url() headers = {} if self.apiId is not None: headers[HEADER_JOB_UUID] = self.apiId else: headers[HEADER_JOB_UUID] = _uuid() date = time.time() datestr = datetime.datetime.fromtimestamp(date).strftime('%a, %d %b %Y %H:%M:%S CST') if self.NEED_SESSION: if self.sessionId is not None: headers[HEADER_AUTHORIZATION] = "%s %s" % (OAUTH, self.sessionId) else : headers["Date"] = datestr headers[HEADER_AUTHORIZATION] = self.calculateAccessKey(url, datestr) web_hook = __config__.get(CONFIG_WEBHOOK, None) if web_hook is not None: headers[CONFIG_WEBHOOK] = web_hook params = self._params() body = None if self.HTTP_METHOD == 'POST' or self.HTTP_METHOD == 'PUT': m = {} for k, v in params.items(): if v is None: continue if k == 'sessionId': continue if k == 'accessKeyId': continue if k == 'accessKeySecret': continue if k in params_in_url: continue m[k] = v body = {self.PARAM_NAME: m} if not self.timeout: self.timeout = __config__[CONFIG_READ_TIMEOUT] rsp = _json_http(uri=url, body=body, headers=headers, method=self.HTTP_METHOD, timeout=self.timeout) if rsp.status < 200 or rsp.status >= 300: return _return(Obj(_http_error(rsp.status, rsp.data))) elif rsp.status == 200 or rsp.status == 204: # the API completes return _return(Obj(self._write_result(rsp))) elif rsp.status == 202: # the API needs polling return self._poll_result(rsp, cb) else: raise SdkError('[Internal Error] the server returns an unknown status code[%s], body[%s]' % (rsp.status, rsp.data)) def _write_result(self, rsp): data = rsp.data if not data: data = '{}' if rsp.status == 200: return {"value": json.loads(data)} elif rsp.status == 503: return json.loads(data) else: raise SdkError('unknown status code[%s]' % rsp.status) def _poll_result(self, rsp, cb): if not self.NEED_POLL: raise SdkError('[Internal Error] the api is not an async API but the server returns 202 status code') m = json.loads(rsp.data) location = m[LOCATION] if not location: raise SdkError("Internal Error] the api[%s] is an async API but the server doesn't return the polling location url") if cb: # async polling self._async_poll(location, cb) else: # sync polling return self._sync_polling(location) def _fill_timeout_parameters(self): if self.timeout is None: self.timeout = __config__.get(CONFIG_POLLING_TIMEOUT) if self.pollingInterval is None: self.pollingInterval = __config__.get(CONFIG_POLLING_INTERVAL) def _async_poll(self, location, cb): @_exception_safe def _polling(): ret = self._sync_polling(location) cb(ret) threading.Thread(target=_polling).start() def _sync_polling(self, location): count = 0 self._fill_timeout_parameters() while count < self.timeout: rsp = _json_http( uri=location, headers={HEADER_AUTHORIZATION: "%s %s" % (OAUTH, self.sessionId)}, method='GET' ) if rsp.status not in [200, 503, 202]: return Obj(_http_error(rsp.status, rsp.data)) elif rsp.status in [200, 503]: return Obj(self._write_result(rsp)) time.sleep(self.pollingInterval) count += self.pollingInterval return Obj(_error(POLLING_TIMEOUT_ERROR, 'polling an API result time out', 'failed to poll the result after %s seconds' % self.timeout)) class QueryAction(AbstractAction): PARAMS = { 'conditions': ParamAnnotation(required=True), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(valid_values=['asc', 'desc']), 'fields': ParamAnnotation(), } def __init__(self): super(QueryAction, self).__init__() self.conditions = [] self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.sessionId = None def _query_string(self, params): m = [] ps = {} for k, v in params.items(): if k in self.PARAMS: ps[k] = v for k, v in ps.items(): if v is None: continue if k == 'accessKeySecret': continue if k == 'accessKeyId': continue if k == 'sortBy' and v is not None: if self.sortDirection is None: m.append('sort=%s' % v) else: op = '+' if self.sortDirection == 'asc' else '-' m.append('sort=%s%s' % (op, v)) elif k == 'sortDirection': continue elif k == 'fields': m.append('fields=%s' % ','.join(v)) elif k == 'conditions': m.extend(['q=%s' % q for q in v]) else: m.append('%s=%s' % (k, v)) return '&'.join(m) def _uuid(): return str(uuid4()).replace('-', '') def _json_http( uri, body=None, headers={}, method='POST', timeout=120.0 ): pool = urllib3.PoolManager(timeout=timeout, retries=urllib3.util.retry.Retry(15)) headers.update({'Content-Type': 'application/json', 'Connection': 'close'}) if body is not None and not isinstance(body, str): body = json.dumps(body).encode('utf-8') print '[Request]: %s url=%s, headers=%s, body=%s' % (method, uri, headers, body) if body: headers['Content-Length'] = len(body) rsp = pool.request(method, uri, body=body, headers=headers) else: rsp = pool.request(method, uri, headers=headers) print '[Response to %s %s]: status: %s, body: %s' % (method, uri, rsp.status, rsp.data) return rsp class ChangeZoneStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/zones/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeZoneState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeZoneStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmQgaAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/qga' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmQgaAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateWebhookAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/web-hooks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateWebhook' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'opaque': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateWebhookAction, self).__init__() self.uuid = None self.name = None self.description = None self.url = None self.type = None self.opaque = None self.systemTags = None self.userTags = None self.sessionId = None class GetVolumeQosAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{uuid}/qos' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVolumeQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectHost' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectHostAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateClusterAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/clusters/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateCluster' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateClusterAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class PauseVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'pauseVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PauseVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryMetadataAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/meta-data' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'matches': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryMetadataAction, self).__init__() self.matches = None self.systemTags = None self.userTags = None self.sessionId = None class DetachBackupStorageFromZoneAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/zones/{zoneUuid}/backup-storage/{backupStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachBackupStorageFromZoneAction, self).__init__() self.backupStorageUuid = None self.zoneUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVmNicAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVmNicAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteRouteEntryRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/route-entry/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteRouteEntryRemoteAction, self).__init__() self.uuid = None self.type = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEipAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/eips/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEipAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2VxlanNetworkPoolAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vxlan-pool' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2VxlanNetworkPoolAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeletePolicyAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/policies/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeletePolicyAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class LogOutAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/sessions/{sessionUuid}' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'sessionUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogOutAction, self).__init__() self.sessionUuid = None self.systemTags = None self.userTags = None class QueryLoadBalancerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/load-balancers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLoadBalancerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AttachL3NetworkToVmAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmInstanceUuid}/l3-networks/{l3NetworkUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'staticIp': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachL3NetworkToVmAction, self).__init__() self.vmInstanceUuid = None self.l3NetworkUuid = None self.staticIp = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVSwitchRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vswitch/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVSwitchRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEipAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/eips' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEipAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryPolicyAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/policies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryPolicyAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AttachIsoToVmInstanceAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmInstanceUuid}/iso/{isoUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'isoUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachIsoToVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.isoUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachDataVolumeFromVmAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volumes/{uuid}/vm-instances' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachDataVolumeFromVmAction, self).__init__() self.uuid = None self.vmUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVolumeFormatAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/formats' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVolumeFormatAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class DeleteCephPrimaryStoragePoolAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/primary-storage/ceph/pools/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteCephPrimaryStoragePoolAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachSecurityGroupToL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachSecurityGroupToL3NetworkAction, self).__init__() self.securityGroupUuid = None self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVirtualBorderRouterRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVirtualBorderRouterRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'localGatewayIp': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peerGatewayIp': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peeringSubnetMask': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vlanId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'circuitCode': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVirtualBorderRouterRemoteAction, self).__init__() self.uuid = None self.localGatewayIp = None self.peerGatewayIp = None self.peeringSubnetMask = None self.name = None self.description = None self.vlanId = None self.circuitCode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLoadBalancerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/load-balancers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLoadBalancerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateQuotaAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/quotas/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateQuota' PARAMS = { 'identityUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'value': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateQuotaAction, self).__init__() self.identityUuid = None self.name = None self.value = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySchedulerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/schedulers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySchedulerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ExpungeImageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{imageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'expungeImage' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExpungeImageAction, self).__init__() self.imageUuid = None self.backupStorageUuids = None self.systemTags = None self.userTags = None self.sessionId = None class QueryCephPrimaryStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/ceph' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryCephPrimaryStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class RebootEcsInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'rebootEcsInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RebootEcsInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteUserGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/groups/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteUserGroupAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetResourceNamesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/resources/names' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetResourceNamesAction, self).__init__() self.uuids = None self.systemTags = None self.userTags = None self.sessionId = None class CreateWebhookAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/web-hooks' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'opaque': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateWebhookAction, self).__init__() self.name = None self.description = None self.url = None self.type = None self.opaque = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2VxlanNetworkPoolAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vxlan-pool' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2VxlanNetworkPoolAction, self).__init__() self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSchedulerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/schedulers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateScheduler' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'schedulerDescription': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSchedulerAction, self).__init__() self.uuid = None self.schedulerName = None self.schedulerDescription = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateIsoForAttachingVmAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/iso-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateIsoForAttachingVmAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVSwitchInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vswitch/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVSwitchInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSftpBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/sftp/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSftpBackupStorage' PARAMS = { 'username': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSftpBackupStorageAction, self).__init__() self.username = None self.password = None self.hostname = None self.sshPort = None self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/port-forwarding/{uuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPortForwardingRuleAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsSecurityGroupFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncEcsSecurityGroupFromRemote' PARAMS = { 'ecsVpcUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsSecurityGroupId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsSecurityGroupFromRemoteAction, self).__init__() self.ecsVpcUuid = None self.ecsSecurityGroupId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmConsolePasswordAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/console-passwords' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmConsolePasswordAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ExpungeVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'expungeVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExpungeVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteIPsecConnectionAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/ipsec/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteIPsecConnectionAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteNicQosAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/nic-qos' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'direction': ParamAnnotation(required=True,valid_values=['in','out'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteNicQosAction, self).__init__() self.uuid = None self.direction = None self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryLabelValuesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/labels' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'labels': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryLabelValuesAction, self).__init__() self.labels = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeVipStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeVipState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeVipStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAliyunKeySecretAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/key/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAliyunKeySecretAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetEcsInstanceVncUrlAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/ecs-vnc/{uuid}' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetEcsInstanceVncUrlAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class LogInByUserAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/users/login' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'logInByUser' PARAMS = { 'accountUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountName': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'userName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogInByUserAction, self).__init__() self.accountUuid = None self.accountName = None self.userName = None self.password = None self.systemTags = None self.userTags = None class CreateL2NoVlanNetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/no-vlan' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2NoVlanNetworkAction, self).__init__() self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVpcInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vpc/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVpcInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryApplianceVmAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/appliances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryApplianceVmAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryConnectionAccessPointFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/access-point' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryConnectionAccessPointFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsSecurityGroupRuleRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/security-group-rule/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsSecurityGroupRuleRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsVSwitchFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vswitch/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncEcsVSwitchFromRemote' PARAMS = { 'identityZoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vSwitchId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsVSwitchFromRemoteAction, self).__init__() self.identityZoneUuid = None self.vSwitchId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAccountAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAccountAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVmInstanceAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVmInstanceAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetBackupStorageTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetBackupStorageTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsInstanceFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncEcsInstanceFromRemote' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsInstanceFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmStaticIpAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmStaticIp' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ip': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmStaticIpAction, self).__init__() self.vmInstanceUuid = None self.l3NetworkUuid = None self.ip = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateImageStoreBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/image-store/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateImageStoreBackupStorage' PARAMS = { 'username': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateImageStoreBackupStorageAction, self).__init__() self.username = None self.password = None self.hostname = None self.sshPort = None self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateIpRangeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l3-networks/ip-ranges/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateIpRange' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateIpRangeAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRouteEntryForConnectionRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/route-entry' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dstCidrBlock': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterInterfaceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRouteEntryForConnectionRemoteAction, self).__init__() self.vRouterUuid = None self.dstCidrBlock = None self.vRouterInterfaceUuid = None self.vRouterType = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVolumeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volumes' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVolumeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateResourcePriceAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/billings/prices' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceName': ParamAnnotation(required=True,valid_values=['cpu','memory','rootVolume','dataVolume'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUnit': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'timeUnit': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'price': ParamAnnotation(required=True,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dateInLong': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateResourcePriceAction, self).__init__() self.resourceName = None self.resourceUnit = None self.timeUnit = None self.price = None self.accountUuid = None self.dateInLong = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLocalStorageResourceRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/local-storage/resource-refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLocalStorageResourceRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeL3NetworkStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l3-networks/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeL3NetworkState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeL3NetworkStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class AddIpRangeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/ip-ranges' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'netmask': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'gateway': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddIpRangeAction, self).__init__() self.l3NetworkUuid = None self.name = None self.description = None self.startIp = None self.endIp = None self.netmask = None self.gateway = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSecurityGroupRuleAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/rules' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'ruleUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSecurityGroupRuleAction, self).__init__() self.ruleUuids = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBackupStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBackupStorageAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsImageRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/image/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsImageRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsImageFromLocalImageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/image' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsImageFromLocalImageAction, self).__init__() self.imageUuid = None self.dataCenterUuid = None self.backupStorageUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryCephBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/ceph' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryCephBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLdapBindingAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/ldap/bindings/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLdapBindingAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddCephPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/ceph' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'monUrls': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'rootVolumePoolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataVolumePoolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageCachePoolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddCephPrimaryStorageAction, self).__init__() self.monUrls = None self.rootVolumePoolName = None self.dataVolumePoolName = None self.imageCachePoolName = None self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSharedMountPointPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/smp' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSharedMountPointPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetLicenseCapabilitiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/licenses/capabilities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetLicenseCapabilitiesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class RevertVolumeFromSnapshotAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volume-snapshots/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'revertVolumeFromSnapshot' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RevertVolumeFromSnapshotAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateUserAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/users' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateUserAction, self).__init__() self.name = None self.password = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class TerminateVirtualBorderRouterRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'terminateVirtualBorderRouterRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(TerminateVirtualBorderRouterRemoteAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeResourceOwnerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/account/{accountUuid}/resources' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'accountUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeResourceOwnerAction, self).__init__() self.accountUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddAliyunKeySecretAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/key' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'key': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'secret': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddAliyunKeySecretAction, self).__init__() self.name = None self.key = None self.secret = None self.accountUuid = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RecoverImageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{imageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoverImage' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoverImageAction, self).__init__() self.imageUuid = None self.backupStorageUuids = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteL3NetworkAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateClusterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/clusters' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hypervisorType': ParamAnnotation(required=True,valid_values=['KVM','Simulator'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['zstack'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateClusterAction, self).__init__() self.zoneUuid = None self.name = None self.description = None self.hypervisorType = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsImageFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/image/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncEcsImageFromRemote' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsImageFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/data' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'diskOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeAction, self).__init__() self.name = None self.description = None self.diskOfferingUuid = None self.primaryStorageUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/instance-offerings/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteInstanceOfferingAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRebootVmInstanceSchedulerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmUuid}/schedulers/rebooting' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerDescription': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['simple','cron'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'interval': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'repeatCount': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startTime': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cron': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRebootVmInstanceSchedulerAction, self).__init__() self.vmUuid = None self.schedulerName = None self.schedulerDescription = None self.type = None self.interval = None self.repeatCount = None self.startTime = None self.cron = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryUserTagAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/user-tags' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryUserTagAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetVolumeCapabilitiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{uuid}/capabilities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVolumeCapabilitiesAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryUserAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/users' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryUserAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2VxlanNetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vxlan' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2VxlanNetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsImageFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/image' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsImageFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class PowerResetBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerResetBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerResetBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateAccountAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateAccount' PARAMS = { 'uuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateAccountAction, self).__init__() self.uuid = None self.password = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class CreateStopVmInstanceSchedulerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmUuid}/schedulers/stopping' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerDescription': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['simple','cron'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'interval': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'repeatCount': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startTime': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cron': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateStopVmInstanceSchedulerAction, self).__init__() self.vmUuid = None self.schedulerName = None self.schedulerDescription = None self.type = None self.interval = None self.repeatCount = None self.startTime = None self.cron = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVolumeQosAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVolumeQos' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeBandwidth': ParamAnnotation(required=True,number_range=[1024, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVolumeQosAction, self).__init__() self.uuid = None self.volumeBandwidth = None self.systemTags = None self.userTags = None self.sessionId = None class CreateLoadBalancerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/load-balancers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateLoadBalancerAction, self).__init__() self.name = None self.description = None self.vipUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateCephPrimaryStorageMonAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/ceph/mons/{monUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateCephPrimaryStorageMon' PARAMS = { 'monUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshUsername': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPassword': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateCephPrimaryStorageMonAction, self).__init__() self.monUuid = None self.hostname = None self.sshUsername = None self.sshPassword = None self.sshPort = None self.monPort = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDiskOfferingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/disk-offerings' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'diskSize': ParamAnnotation(required=True,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sortKey': ParamAnnotation(), 'allocationStrategy': ParamAnnotation(), 'type': ParamAnnotation(required=False,valid_values=['zstack'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDiskOfferingAction, self).__init__() self.name = None self.description = None self.diskSize = None self.sortKey = None self.allocationStrategy = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateSystemTagAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/system-tags' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceType': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'tag': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateSystemTagAction, self).__init__() self.resourceType = None self.resourceUuid = None self.tag = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteClusterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/clusters/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteClusterAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmMigrationCandidateHostsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/migration-target-hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmMigrationCandidateHostsAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachBackupStorageToZoneAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/zones/{zoneUuid}/backup-storage/{backupStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachBackupStorageToZoneAction, self).__init__() self.zoneUuid = None self.backupStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class LocalStorageGetVolumeMigratableHostsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{volumeUuid}/migration-target-hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(LocalStorageGetVolumeMigratableHostsAction, self).__init__() self.volumeUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddVmNicToLoadBalancerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/load-balancers/listeners/{listenerUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'listenerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVmNicToLoadBalancerAction, self).__init__() self.vmNicUuids = None self.listenerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsSecurityGroupRuleRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/security-group-rule' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsSecurityGroupRuleRemoteAction, self).__init__() self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CloneVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'cloneVmInstance' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'strategy': ParamAnnotation(required=False,valid_values=['InstantStart','JustCreate'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'names': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CloneVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.strategy = None self.names = None self.systemTags = None self.userTags = None self.sessionId = None class AttachOssBucketToEcsDataCenterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/{dataCenterUuid}/oss-bucket/{ossBucketUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ossBucketUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachOssBucketToEcsDataCenterAction, self).__init__() self.ossBucketUuid = None self.dataCenterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryIdentityZoneFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/identity-zone' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryIdentityZoneFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryRouteEntryFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/route-entry' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryRouteEntryFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVipAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVip' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVipAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class CreateLdapBindingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/ldap/bindings' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ldapUid': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountUuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateLdapBindingAction, self).__init__() self.ldapUid = None self.accountUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryGlobalConfigAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/global-configurations' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryGlobalConfigAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVpcRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vpc/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVpcRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVolumeSnapshotTreeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volume-snapshots/trees' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVolumeSnapshotTreeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddIdentityZoneFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/identity-zone' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddIdentityZoneFromRemoteAction, self).__init__() self.dataCenterUuid = None self.zoneId = None self.type = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddKVMHostAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hosts/kvm' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddKVMHostAction, self).__init__() self.username = None self.password = None self.sshPort = None self.name = None self.description = None self.managementIp = None self.clusterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateHost' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateHostAction, self).__init__() self.uuid = None self.name = None self.description = None self.managementIp = None self.systemTags = None self.userTags = None self.sessionId = None class QueryCephPrimaryStoragePoolAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/ceph/pools' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryCephPrimaryStoragePoolAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ReclaimSpaceFromImageStoreAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/image-store/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reclaimSpaceFromImageStore' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReclaimSpaceFromImageStoreAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryVmMonitoringDataAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/vm-instances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'vmUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'instant': ParamAnnotation(), 'startTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'step': ParamAnnotation(), 'expression': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'relativeTime': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryVmMonitoringDataAction, self).__init__() self.vmUuids = None self.instant = None self.startTime = None self.endTime = None self.step = None self.expression = None self.relativeTime = None self.systemTags = None self.userTags = None self.sessionId = None class GetHostAllocatorStrategiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hosts/allocators/strategies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetHostAllocatorStrategiesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class AttachPrimaryStorageToClusterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPrimaryStorageToClusterAction, self).__init__() self.clusterUuid = None self.primaryStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPolicyToUserAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/users/{userUuid}/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPolicyToUserAction, self).__init__() self.userUuid = None self.policyUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveVmNicFromLoadBalancerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/load-balancers/listeners/{listenerUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'listenerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveVmNicFromLoadBalancerAction, self).__init__() self.vmNicUuids = None self.listenerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetAccountQuotaUsageAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/accounts/quota/{uuid}/usages' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetAccountQuotaUsageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateCephBackupStorageMonAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/ceph/mons/{monUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateCephBackupStorageMon' PARAMS = { 'monUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshUsername': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPassword': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateCephBackupStorageMonAction, self).__init__() self.monUuid = None self.hostname = None self.sshUsername = None self.sshPassword = None self.sshPort = None self.monPort = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSchedulerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/schedulers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSchedulerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class MigrateVmAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'migrateVm' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(MigrateVmAction, self).__init__() self.vmInstanceUuid = None self.hostUuid = None self.systemTags = None self.userTags = None self.sessionId = None class StartEcsInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'startEcsInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StartEcsInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPoliciesFromUserAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/users/{userUuid}/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'policyUuids': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPoliciesFromUserAction, self).__init__() self.policyUuids = None self.userUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVolumeSnapshotSchedulerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/{volumeUuid}/schedulers/creating-volume-snapshots' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'snapShotName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeSnapshotDescription': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerDescription': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['simple','cron'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'interval': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'repeatCount': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startTime': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cron': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVolumeSnapshotSchedulerAction, self).__init__() self.volumeUuid = None self.snapShotName = None self.volumeSnapshotDescription = None self.schedulerName = None self.schedulerDescription = None self.type = None self.interval = None self.repeatCount = None self.startTime = None self.cron = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalChassisAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/chassis' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalChassisAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmBootOrderAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmBootOrder' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bootOrder': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmBootOrderAction, self).__init__() self.uuid = None self.bootOrder = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteTagAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/tags/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteTagAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddSecurityGroupRuleAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups/{securityGroupUuid}/rules' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'rules': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSecurityGroupRuleAction, self).__init__() self.securityGroupUuid = None self.rules = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVirtualBorderRouterLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/border-router/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVirtualBorderRouterLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryPortForwardingRuleAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/port-forwarding' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryPortForwardingRuleAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryPrimaryStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryPrimaryStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateVmForAttachingIsoAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/images/iso/{isoUuid}/vm-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'isoUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateVmForAttachingIsoAction, self).__init__() self.isoUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetBackupStorageCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/capacities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetBackupStorageCapacityAction, self).__init__() self.zoneUuids = None self.backupStorageUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVCenterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vcenters/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVCenterAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmSshKeyAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/ssh-keys' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmSshKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmStaticIpAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{vmInstanceUuid}/static-ips' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmStaticIpAction, self).__init__() self.vmInstanceUuid = None self.l3NetworkUuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryUserGroupAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/groups' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryUserGroupAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachL2NetworkFromClusterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l2-networks/{l2NetworkUuid}/clusters/{clusterUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachL2NetworkFromClusterAction, self).__init__() self.l2NetworkUuid = None self.clusterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteDataVolumeAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volumes/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteDataVolumeAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetPrimaryStorageTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPrimaryStorageTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateZonesClustersHostsForCreatingVmAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/candidate-destinations' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'rootDiskOfferingUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataDiskOfferingUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(), 'clusterUuid': ParamAnnotation(), 'defaultL3NetworkUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateZonesClustersHostsForCreatingVmAction, self).__init__() self.instanceOfferingUuid = None self.imageUuid = None self.l3NetworkUuids = None self.rootDiskOfferingUuid = None self.dataDiskOfferingUuids = None self.zoneUuid = None self.clusterUuid = None self.defaultL3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVipAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vips/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVipAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateKVMHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/kvm/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateKVMHost' PARAMS = { 'username': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateKVMHostAction, self).__init__() self.username = None self.password = None self.sshPort = None self.uuid = None self.name = None self.description = None self.managementIp = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterDatacenterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/datacenters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterDatacenterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteExportedImageFromBackupStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/backup-storage/{backupStorageUuid}/exported-images/{imageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteExportedImageFromBackupStorageAction, self).__init__() self.backupStorageUuid = None self.imageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryHybridEipFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/eip' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryHybridEipFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVniRangeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vxlan-pool/vni-range' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVniRangeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateLdapServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ldap/servers/{ldapServerUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateLdapServer' PARAMS = { 'ldapServerUuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'base': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'username': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'encryption': ParamAnnotation(required=False,valid_values=['None','TLS'],max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateLdapServerAction, self).__init__() self.ldapServerUuid = None self.name = None self.description = None self.url = None self.base = None self.username = None self.password = None self.encryption = None self.systemTags = None self.userTags = None self.sessionId = None class TriggerGCJobAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/gc-jobs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'triggerGCJob' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(TriggerGCJobAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsInstanceFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/ecs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsInstanceFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateDiskOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/disk-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateDiskOffering' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateDiskOfferingAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2VlanNetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vlan' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2VlanNetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVmNicInSecurityGroupAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/security-groups/vm-instances/nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVmNicInSecurityGroupAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class LogInByAccountAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/login' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'logInByAccount' PARAMS = { 'accountName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogInByAccountAction, self).__init__() self.accountName = None self.password = None self.systemTags = None self.userTags = None class ChangeVmPasswordAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeVmPassword' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,valid_regex_values=r'[\da-zA-Z-`=\\\[\];',./~!@#$%^&*()_+|{}:"<>?]{1,}',max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=True), 'account': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=True), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeVmPasswordAction, self).__init__() self.uuid = None self.password = None self.account = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualRouterOfferingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/instance-offerings/virtual-routers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualRouterOfferingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetCpuMemoryCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hosts/capacities/cpu-memory' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCpuMemoryCapacityAction, self).__init__() self.zoneUuids = None self.clusterUuids = None self.hostUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeSchedulerStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/schedulers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeSchedulerState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeSchedulerStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmBootOrderAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/boot-orders' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmBootOrderAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeFromVolumeTemplateAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/data/from/data-volume-templates/{imageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeFromVolumeTemplateAction, self).__init__() self.imageUuid = None self.name = None self.description = None self.primaryStorageUuid = None self.hostUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVolumeSizeAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncVolumeSize' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVolumeSizeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class StopVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'stopVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['grace','cold'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StopVmInstanceAction, self).__init__() self.uuid = None self.type = None self.systemTags = None self.userTags = None self.sessionId = None class StartVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'startVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StartVmInstanceAction, self).__init__() self.uuid = None self.clusterUuid = None self.hostUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeVolumeStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeVolumeState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeVolumeStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateRouteInterfaceRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/router-interface/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateRouteInterfaceRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'op': ParamAnnotation(required=True,valid_values=['active','inactive'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateRouteInterfaceRemoteAction, self).__init__() self.uuid = None self.op = None self.vRouterType = None self.systemTags = None self.userTags = None self.sessionId = None class AddLocalPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/local-storage' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddLocalPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryImageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/images' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryImageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class SetNicQosAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setNicQos' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'outboundBandwidth': ParamAnnotation(required=False,number_range=[8192, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'inboundBandwidth': ParamAnnotation(required=False,number_range=[8192, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetNicQosAction, self).__init__() self.uuid = None self.outboundBandwidth = None self.inboundBandwidth = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteRouterInterfaceRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/router-interface/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vrouter','vbr'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteRouterInterfaceRemoteAction, self).__init__() self.uuid = None self.vRouterType = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveMonFromCephBackupStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/backup-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monHostnames': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveMonFromCephBackupStorageAction, self).__init__() self.uuid = None self.monHostnames = None self.systemTags = None self.userTags = None self.sessionId = None class GetCurrentTimeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/management-nodes/actions' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'getCurrentTime' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(GetCurrentTimeAction, self).__init__() self.systemTags = None self.userTags = None class DetachPolicyFromUserGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/groups/{groupUuid}/policies/{policyUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPolicyFromUserGroupAction, self).__init__() self.policyUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVirtualRouterOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/instance-offerings/virtual-routers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVirtualRouterOffering' PARAMS = { 'isDefault': ParamAnnotation(), 'imageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVirtualRouterOfferingAction, self).__init__() self.isDefault = None self.imageUuid = None self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class AddImageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mediaType': ParamAnnotation(required=False,valid_values=['RootVolumeTemplate','ISO','DataVolumeTemplate'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'format': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddImageAction, self).__init__() self.name = None self.description = None self.url = None self.mediaType = None self.guestOsType = None self.system = None self.format = None self.platform = None self.backupStorageUuids = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2VxlanNetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vxlan' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vni': ParamAnnotation(required=False,number_range=[1, 16777214],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'poolUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2VxlanNetworkAction, self).__init__() self.vni = None self.poolUuid = None self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVirtualRouterFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vrouter/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncVirtualRouterFromRemote' PARAMS = { 'vpcUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVirtualRouterFromRemoteAction, self).__init__() self.vpcUuid = None self.vRouterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmAttachableL3NetworkAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/l3-networks-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmAttachableL3NetworkAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSftpBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/sftp' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'hostname': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSftpBackupStorageAction, self).__init__() self.hostname = None self.username = None self.password = None self.sshPort = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVersionAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/management-nodes/actions' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'getVersion' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(GetVersionAction, self).__init__() self.systemTags = None self.userTags = None class DetachPolicyFromUserAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/users/{userUuid}/policies/{policyUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPolicyFromUserAction, self).__init__() self.policyUuid = None self.userUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RefreshLoadBalancerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/load-balancers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'refreshLoadBalancer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RefreshLoadBalancerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddLdapServerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/ldap/servers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'base': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'username': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'encryption': ParamAnnotation(required=True,valid_values=['None','TLS'],max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddLdapServerAction, self).__init__() self.name = None self.description = None self.url = None self.base = None self.username = None self.password = None self.encryption = None self.systemTags = None self.userTags = None self.sessionId = None class GetDataVolumeAttachableVmAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{volumeUuid}/candidate-vm-instances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetDataVolumeAttachableVmAction, self).__init__() self.volumeUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsInstanceFromLocalImageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/ecs' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'ecsRootVolumeType': ParamAnnotation(required=False,valid_values=['cloud','cloud_efficiency','cloud_ssd','ephemeral_ssd'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=256,min_length=2,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsRootVolumeGBSize': ParamAnnotation(required=False,number_range=[40, 500],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'createMode': ParamAnnotation(required=False,valid_values=['atomic','permissive'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'privateIpAddress': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsInstanceName': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatePublicIp': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'identityZoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsVSwitchUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsSecurityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsRootPassword': ParamAnnotation(required=True,valid_regex_values=r'^[a-zA-Z][\w\W]{7,17}$',max_length=30,min_length=8,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsBandWidth': ParamAnnotation(required=True,number_range=[0, 200],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsInstanceFromLocalImageAction, self).__init__() self.ecsRootVolumeType = None self.description = None self.ecsRootVolumeGBSize = None self.createMode = None self.privateIpAddress = None self.ecsInstanceName = None self.allocatePublicIp = None self.identityZoneUuid = None self.backupStorageUuid = None self.imageUuid = None self.instanceOfferingUuid = None self.ecsVSwitchUuid = None self.ecsSecurityGroupUuid = None self.ecsRootPassword = None self.ecsBandWidth = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/baremetal/pxeserver' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dhcpInterface': ParamAnnotation(required=True,max_length=128,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'dhcpRangeBegin': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeEnd': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeNetmask': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateBaremetalPxeServerAction, self).__init__() self.dhcpInterface = None self.dhcpRangeBegin = None self.dhcpRangeEnd = None self.dhcpRangeNetmask = None self.systemTags = None self.userTags = None self.sessionId = None class AttachEipAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/eips/{eipUuid}/vm-instances/nics/{vmNicUuid' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'eipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachEipAction, self).__init__() self.eipUuid = None self.vmNicUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBaremetalHostCfgAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/hostcfg/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBaremetalHostCfg' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'vnc': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'unattended': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'nicCfgs': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'chassisUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBaremetalHostCfgAction, self).__init__() self.uuid = None self.password = None self.vnc = None self.unattended = None self.nicCfgs = None self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteHostAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hosts/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteHostAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ReloadLicenseAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/licenses/actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'reloadLicense' PARAMS = { 'managementNodeUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReloadLicenseAction, self).__init__() self.managementNodeUuids = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsVpcFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vpc/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncEcsVpcFromRemote' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsVpcId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsVpcFromRemoteAction, self).__init__() self.dataCenterUuid = None self.ecsVpcId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsSecurityGroupRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/security-group/remote' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsSecurityGroupRemoteAction, self).__init__() self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualBorderRouterFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/border-router' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualBorderRouterFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVmInstanceAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['UserVm','ApplianceVm'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'rootDiskOfferingUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataDiskOfferingUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuidForRootVolume': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'defaultL3NetworkUuid': ParamAnnotation(), 'strategy': ParamAnnotation(required=False,valid_values=['InstantStart','JustCreate'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVmInstanceAction, self).__init__() self.name = None self.instanceOfferingUuid = None self.imageUuid = None self.l3NetworkUuids = None self.type = None self.rootDiskOfferingUuid = None self.dataDiskOfferingUuids = None self.zoneUuid = None self.clusterUuid = None self.hostUuid = None self.primaryStorageUuidForRootVolume = None self.description = None self.defaultL3NetworkUuid = None self.strategy = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetHypervisorTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hosts/hypervisor-types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetHypervisorTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class DeleteVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volume-snapshots/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVolumeSnapshotAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAccountResourceRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/resources/refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAccountResourceRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateUserGroupAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/groups/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateUserGroup' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateUserGroupAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class UpdatePortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/port-forwarding/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updatePortForwardingRule' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdatePortForwardingRuleAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectConsoleProxyAgentAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/consoles/agents' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectConsoleProxyAgent' PARAMS = { 'agentUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectConsoleProxyAgentAction, self).__init__() self.agentUuids = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVirtualRouterOfferingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/instance-offerings/virtual-routers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementNetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'publicNetworkUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'isDefault': ParamAnnotation(), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuNum': ParamAnnotation(required=True,number_range=[1, 1024],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'memorySize': ParamAnnotation(required=True,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatorStrategy': ParamAnnotation(), 'sortKey': ParamAnnotation(), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVirtualRouterOfferingAction, self).__init__() self.zoneUuid = None self.managementNetworkUuid = None self.imageUuid = None self.publicNetworkUuid = None self.isDefault = None self.name = None self.description = None self.cpuNum = None self.memorySize = None self.allocatorStrategy = None self.sortKey = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBaremetalChassisAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBaremetalChassis' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiAddress': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiUsername': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiPassword': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'provisioned': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBaremetalChassisAction, self).__init__() self.uuid = None self.ipmiAddress = None self.ipmiUsername = None self.ipmiPassword = None self.provisioned = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteIpRangeAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/ip-ranges/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteIpRangeAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class SyncRouterInterfaceFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/router-interface/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncRouterInterfaceFromRemote' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncRouterInterfaceFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetPortForwardingAttachableVmNicsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/port-forwarding/{ruleUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'ruleUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPortForwardingAttachableVmNicsAction, self).__init__() self.ruleUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetL2NetworkTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL2NetworkTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class CheckApiPermissionAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/permissions/actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'checkApiPermission' PARAMS = { 'userUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'apiNames': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CheckApiPermissionAction, self).__init__() self.userUuid = None self.apiNames = None self.systemTags = None self.userTags = None self.sessionId = None class GetTaskProgressAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/task-progresses/{apiId}' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'apiId': ParamAnnotation(), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetTaskProgressAction, self).__init__() self.apiId = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class ExpungeDataVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'expungeDataVolume' PARAMS = { 'uuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExpungeDataVolumeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachNetworkServiceToL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/network-services' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'networkServices': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachNetworkServiceToL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.networkServices = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveMonFromCephPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/primary-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monHostnames': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveMonFromCephPrimaryStorageAction, self).__init__() self.uuid = None self.monHostnames = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectImageStoreBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/image-store/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectImageStoreBackupStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectImageStoreBackupStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSecurityGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSecurityGroupAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySecurityGroupRuleAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/security-groups/rules' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySecurityGroupRuleAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySecurityGroupAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/security-groups' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySecurityGroupAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetDataCenterFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/data-center/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetDataCenterFromRemoteAction, self).__init__() self.type = None self.systemTags = None self.userTags = None self.sessionId = None class AddVmNicToSecurityGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups/{securityGroupUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVmNicToSecurityGroupAction, self).__init__() self.securityGroupUuid = None self.vmNicUuids = None self.systemTags = None self.userTags = None self.sessionId = None class DeletePortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/port-forwarding/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeletePortForwardingRuleAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ExportImageFromBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{backupStorageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'exportImageFromBackupStorage' PARAMS = { 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,max_length=2048,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExportImageFromBackupStorageAction, self).__init__() self.backupStorageUuid = None self.imageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmHostnameAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmHostname' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostname': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmHostnameAction, self).__init__() self.uuid = None self.hostname = None self.systemTags = None self.userTags = None self.sessionId = None class GetPrimaryStorageAllocatorStrategiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/allocators/strategies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPrimaryStorageAllocatorStrategiesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class GetLocalStorageHostDiskCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/local-storage/{primaryStorageUuid}/capacities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetLocalStorageHostDiskCapacityAction, self).__init__() self.hostUuid = None self.primaryStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryNetworkServiceL3NetworkRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/network-services/refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryNetworkServiceL3NetworkRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class LocalStorageMigrateVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/local-storage/volumes/{volumeUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'localStorageMigrateVolume' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'destHostUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(LocalStorageMigrateVolumeAction, self).__init__() self.volumeUuid = None self.destHostUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateBackupStorageForCreatingImageAction(AbstractAction): HTTP_METHOD = 'GET' PATH = 'null' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'volumeUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeSnapshotUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateBackupStorageForCreatingImageAction, self).__init__() self.volumeUuid = None self.volumeSnapshotUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2NetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2NetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ResumeVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'resumeVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ResumeVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPolicyToUserGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/groups/{groupUuid}/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPolicyToUserGroupAction, self).__init__() self.policyUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmInstanceHaLevelAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/ha-levels' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmInstanceHaLevelAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsVSwitchFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vswitch' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsVSwitchFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class IsReadyToGoAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/management-nodes/ready' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'managementNodeId': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(IsReadyToGoAction, self).__init__() self.managementNodeId = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmHostnameAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/hostnames' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmHostnameAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPrimaryStorageFromClusterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPrimaryStorageFromClusterAction, self).__init__() self.primaryStorageUuid = None self.clusterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSimulatorPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/simulators' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'totalCapacity': ParamAnnotation(), 'availableCapacity': ParamAnnotation(), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSimulatorPrimaryStorageAction, self).__init__() self.totalCapacity = None self.availableCapacity = None self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsVpcRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/vpc' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsVpcRemoteAction, self).__init__() self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddCephPrimaryStoragePoolAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/ceph/{primaryStorageUuid}/pools' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'poolName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'errorIfNotExist': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddCephPrimaryStoragePoolAction, self).__init__() self.primaryStorageUuid = None self.poolName = None self.description = None self.errorIfNotExist = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddVCenterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vcenters' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'https': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'port': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'domainName': ParamAnnotation(required=True,max_length=256,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVCenterAction, self).__init__() self.username = None self.password = None self.zoneUuid = None self.name = None self.https = None self.port = None self.domainName = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'dnsDomain': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL3NetworkAction, self).__init__() self.name = None self.description = None self.type = None self.l2NetworkUuid = None self.system = None self.dnsDomain = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'state': ParamAnnotation(required=False,valid_values=['Stopped','Running'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'defaultL3NetworkUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuNum': ParamAnnotation(required=False,number_range=[1, 1024],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'memorySize': ParamAnnotation(required=False,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVmInstanceAction, self).__init__() self.uuid = None self.name = None self.description = None self.state = None self.defaultL3NetworkUuid = None self.platform = None self.cpuNum = None self.memorySize = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectVirtualRouterAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/appliances/virtual-routers/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectVirtualRouter' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectVirtualRouterAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLoadBalancerListenerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/load-balancers/listeners' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLoadBalancerListenerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryResourcePriceAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/billings/prices' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryResourcePriceAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryWebhookAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/web-hooks' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryWebhookAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteConnectionAccessPointLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/access-point/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteConnectionAccessPointLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectPrimaryStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectPrimaryStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CleanUpImageCacheOnPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'cleanUpImageCacheOnPrimaryStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CleanUpImageCacheOnPrimaryStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetImageQgaAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setImageQga' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'enable': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetImageQgaAction, self).__init__() self.uuid = None self.enable = None self.systemTags = None self.userTags = None self.sessionId = None class GetEipAttachableVmNicsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/eips/{eipUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'eipUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetEipAttachableVmNicsAction, self).__init__() self.eipUuid = None self.vipUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryZoneAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/zones' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryZoneAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachSecurityGroupFromL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachSecurityGroupFromL3NetworkAction, self).__init__() self.securityGroupUuid = None self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsVpcFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vpc' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsVpcFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeFromVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/data/from/volume-snapshots/{volumeSnapshotUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeSnapshotUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeFromVolumeSnapshotAction, self).__init__() self.name = None self.description = None self.volumeSnapshotUuid = None self.primaryStorageUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeEipStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/eips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeEipState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeEipStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateL2NetworkAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l2-networks/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateL2Network' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateL2NetworkAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DetachNetworkServiceFromL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/{l3NetworkUuid}/network-services' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'networkServices': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachNetworkServiceFromL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.networkServices = None self.systemTags = None self.userTags = None self.sessionId = None class AddNfsPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/nfs' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddNfsPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsVSwitchRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/vswitch' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsVSwitchRemoteAction, self).__init__() self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateAccountAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['SystemAdmin','Normal'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateAccountAction, self).__init__() self.name = None self.password = None self.type = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmStartingCandidateClustersHostsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/starting-target-hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmStartingCandidateClustersHostsAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class RebootVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'rebootVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RebootVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmAttachableDataVolumeAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/data-volume-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmAttachableDataVolumeAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CleanInvalidLdapBindingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ldap/bindings/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'cleanInvalidLdapBinding' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CleanInvalidLdapBindingAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class QueryAliyunKeySecretAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/key' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAliyunKeySecretAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeClusterStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/clusters/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeClusterState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeClusterStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class AttachDataVolumeToVmAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/{volumeUuid}/vm-instances/{vmInstanceUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachDataVolumeToVmAction, self).__init__() self.vmInstanceUuid = None self.volumeUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveUserFromGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/groups/{groupUuid}/users/{userUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveUserFromGroupAction, self).__init__() self.userUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSimulatorHostAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hosts/simulators' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'memoryCapacity': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuCapacity': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSimulatorHostAction, self).__init__() self.memoryCapacity = None self.cpuCapacity = None self.name = None self.description = None self.managementIp = None self.clusterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVipAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vips' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVipAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class RecoverDataVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoverDataVolume' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoverDataVolumeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsSecurityGroupFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsSecurityGroupFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualRouterVmAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/appliances/virtual-routers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualRouterVmAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateUserGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/groups' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateUserGroupAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateImageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateImage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mediaType': ParamAnnotation(required=False,valid_values=['RootVolumeTemplate','DataVolumeTemplate','ISO'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'format': ParamAnnotation(required=False,valid_values=['raw','qcow2','iso'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateImageAction, self).__init__() self.uuid = None self.name = None self.description = None self.guestOsType = None self.mediaType = None self.format = None self.system = None self.platform = None self.systemTags = None self.userTags = None self.sessionId = None class KvmRunShellAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/kvm/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'kvmRunShell' PARAMS = { 'hostUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'script': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(KvmRunShellAction, self).__init__() self.hostUuids = None self.script = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVolume' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVolumeAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DetachIsoFromVmInstanceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{vmInstanceUuid}/iso' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachIsoFromVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterPrimaryStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/primary-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterPrimaryStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/{volumeUuid}/volume-snapshots' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVolumeSnapshotAction, self).__init__() self.volumeUuid = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveDnsFromL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/{l3NetworkUuid}/dns/{dns}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dns': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveDnsFromL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.dns = None self.systemTags = None self.userTags = None self.sessionId = None class ValidateSessionAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/accounts/sessions/{sessionUuid}/valid' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'sessionUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(ValidateSessionAction, self).__init__() self.sessionUuid = None self.systemTags = None self.userTags = None class QueryDiskOfferingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/disk-offerings' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryDiskOfferingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteResourcePriceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/billings/prices/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteResourcePriceAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterClusterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/clusters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterClusterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachAliyunKeyAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/key/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'detachAliyunKey' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachAliyunKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddImageStoreBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/image-store' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'hostname': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddImageStoreBackupStorageAction, self).__init__() self.hostname = None self.username = None self.password = None self.sshPort = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSecurityGroupAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/security-groups/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSecurityGroup' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSecurityGroupAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class RecoveryVirtualBorderRouterRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoveryVirtualBorderRouterRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoveryVirtualBorderRouterRemoteAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryInstanceOfferingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/instance-offerings' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryInstanceOfferingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmNicFromSecurityGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/{securityGroupUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmNicFromSecurityGroupAction, self).__init__() self.securityGroupUuid = None self.vmNicUuids = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmQgaAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmQga' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'enable': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmQgaAction, self).__init__() self.uuid = None self.enable = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalPxeServerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/pxeserver' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalPxeServerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetL3NetworkDhcpIpAddressAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/{l3NetworkUuid/dhcp-ip' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL3NetworkDhcpIpAddressAction, self).__init__() self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddDataCenterFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/data-center' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddDataCenterFromRemoteAction, self).__init__() self.regionId = None self.type = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/instance-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateInstanceOffering' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateInstanceOfferingAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class CreateSecurityGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateSecurityGroupAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLdapBindingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/ldap/bindings' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLdapBindingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AttachAliyunKeyAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/key/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'attachAliyunKey' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachAliyunKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRouterInterfacePairRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/router-interface' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accessPointUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'Spec': ParamAnnotation(required=True,valid_values=['Small.1','Small.2','Small.5','Middle.1','Middle.2','Middle.5','Large.1','Large.2'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vBorderRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'aDescription': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'aName': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bDescription': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bName': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ownerName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRouterInterfacePairRemoteAction, self).__init__() self.dataCenterUuid = None self.accessPointUuid = None self.Spec = None self.vRouterUuid = None self.vBorderRouterUuid = None self.aDescription = None self.aName = None self.bDescription = None self.bName = None self.ownerName = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSystemTagAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/system-tags/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSystemTag' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'tag': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSystemTagAction, self).__init__() self.uuid = None self.tag = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/backup-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualRouterFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vrouter' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualRouterFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateL3NetworkAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l3-networks/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateL3Network' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateL3NetworkAction, self).__init__() self.uuid = None self.name = None self.description = None self.system = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volume-snapshots/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVolumeSnapshot' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVolumeSnapshotAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class RevokeResourceSharingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/resources/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'revokeResourceSharing' PARAMS = { 'resourceUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'toPublic': ParamAnnotation(), 'accountUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RevokeResourceSharingAction, self).__init__() self.resourceUuids = None self.toPublic = None self.accountUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class QueryClusterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/clusters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryClusterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteWebhookAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/web-hooks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteWebhookAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL3NetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l3-networks' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL3NetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetIpAddressCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/ip-capacity' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipRangeUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetIpAddressCapacityAction, self).__init__() self.zoneUuids = None self.l3NetworkUuids = None self.ipRangeUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class GetOssBucketNameFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/oss/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetOssBucketNameFromRemoteAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class CreateVipAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vips' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatorStrategy': ParamAnnotation(), 'requiredIp': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVipAction, self).__init__() self.name = None self.description = None self.l3NetworkUuid = None self.allocatorStrategy = None self.requiredIp = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryDataCenterFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/data-center' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryDataCenterFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetIdentityZoneFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/identity-zone/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'regionId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetIdentityZoneFromRemoteAction, self).__init__() self.type = None self.dataCenterUuid = None self.regionId = None self.systemTags = None self.userTags = None self.sessionId = None class SyncPrimaryStorageCapacityAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{primaryStorageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncPrimaryStorageCapacity' PARAMS = { 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncPrimaryStorageCapacityAction, self).__init__() self.primaryStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachEipAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/eips/{uuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachEipAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmCapabilitiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/capabilities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmCapabilitiesAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreatePolicyAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'statements': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreatePolicyAction, self).__init__() self.name = None self.description = None self.statements = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEipAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/eips' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEipAction, self).__init__() self.name = None self.description = None self.vipUuid = None self.vmNicUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeTemplateFromVolumeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images/data-volume-templates/from/volumes/{volumeUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeTemplateFromVolumeAction, self).__init__() self.name = None self.description = None self.volumeUuid = None self.backupStorageUuids = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CalculateAccountSpendingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/billings/accounts/{accountUuid}/actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'calculateAccountSpending' PARAMS = { 'accountUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dateStart': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dateEnd': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CalculateAccountSpendingAction, self).__init__() self.accountUuid = None self.dateStart = None self.dateEnd = None self.systemTags = None self.userTags = None self.sessionId = None class CreatePortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/port-forwarding' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipPortStart': ParamAnnotation(required=True,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipPortEnd': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'privatePortStart': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'privatePortEnd': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'protocolType': ParamAnnotation(required=True,valid_values=['TCP','UDP'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allowedCidr': ParamAnnotation(), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreatePortForwardingRuleAction, self).__init__() self.vipUuid = None self.vipPortStart = None self.vipPortEnd = None self.privatePortStart = None self.privatePortEnd = None self.protocolType = None self.vmNicUuid = None self.allowedCidr = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddUserToGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/groups/{groupUuid}/users' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'addUserToGroup' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddUserToGroupAction, self).__init__() self.userUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddDnsToL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/dns' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dns': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddDnsToL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.dns = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAccountAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAccountAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateEcsInstanceVncPasswordAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs-vnc/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateEcsInstanceVncPassword' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,valid_regex_values=r'[A-Za-z0-9]{6}',max_length=6,min_length=6,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateEcsInstanceVncPasswordAction, self).__init__() self.uuid = None self.password = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRootVolumeTemplateFromVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images/root-volume-templates/from/volume-snapshots/{snapshotUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'snapshotUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(), 'backupStorageUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRootVolumeTemplateFromVolumeSnapshotAction, self).__init__() self.snapshotUuid = None self.name = None self.description = None self.guestOsType = None self.backupStorageUuids = None self.platform = None self.system = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectBackupStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectBackupStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetL3NetworkTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL3NetworkTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class CreateUserTagAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/user-tags' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceType': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'tag': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateUserTagAction, self).__init__() self.resourceType = None self.resourceUuid = None self.tag = None self.systemTags = None self.userTags = None self.sessionId = None class AddMonToCephPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monUrls': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddMonToCephPrimaryStorageAction, self).__init__() self.uuid = None self.monUrls = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVirtualRouterLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vrouter/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVirtualRouterLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/baremetal/pxeserver/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBaremetalPxeServerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateIPsecConnectionAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/ipsec' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peerAddress': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'authMode': ParamAnnotation(required=False,valid_values=['psk','certs'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'authKey': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peerCidrs': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'ikeAuthAlgorithm': ParamAnnotation(required=False,valid_values=['md5','sha1','sha256','sha384','sha512'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ikeEncryptionAlgorithm': ParamAnnotation(required=False,valid_values=['3des','aes-128','aes-192','aes-256'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ikeDhGroup': ParamAnnotation(), 'policyAuthAlgorithm': ParamAnnotation(required=False,valid_values=['md5','sha1','sha256','sha384','sha512'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyEncryptionAlgorithm': ParamAnnotation(required=False,valid_values=['3des','aes-128','aes-192','aes-256'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'pfs': ParamAnnotation(required=False,valid_values=['dh-group2','dh-group5','dh-group14','dh-group15','dh-group16','dh-group17','dh-group18','dh-group19','dh-group20','dh-group21','dh-group22','dh-group23','dh-group24','dh-group25','dh-group26'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyMode': ParamAnnotation(required=False,valid_values=['tunnel','transport'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'transformProtocol': ParamAnnotation(required=False,valid_values=['esp','ah','ah-esp'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateIPsecConnectionAction, self).__init__() self.name = None self.description = None self.l3NetworkUuid = None self.peerAddress = None self.authMode = None self.authKey = None self.vipUuid = None self.peerCidrs = None self.ikeAuthAlgorithm = None self.ikeEncryptionAlgorithm = None self.ikeDhGroup = None self.policyAuthAlgorithm = None self.policyEncryptionAlgorithm = None self.pfs = None self.policyMode = None self.transformProtocol = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateStartVmInstanceSchedulerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmUuid}/schedulers/starting' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerDescription': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['simple','cron'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'interval': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'repeatCount': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startTime': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cron': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateStartVmInstanceSchedulerAction, self).__init__() self.vmUuid = None self.clusterUuid = None self.hostUuid = None self.schedulerName = None self.schedulerDescription = None self.type = None self.interval = None self.repeatCount = None self.startTime = None self.cron = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeDiskOfferingStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/disk-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeDiskOfferingState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeDiskOfferingStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySftpBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/sftp' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySftpBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryQuotaAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/quotas' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryQuotaAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteDataCenterInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/data-center/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteDataCenterInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteOssFileBucketNameInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/oss-bucket/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteOssFileBucketNameInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmHostnameAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/hostnames' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmHostnameAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachL3NetworkFromVmAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/nics/{vmNicUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'vmNicUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachL3NetworkFromVmAction, self).__init__() self.vmNicUuid = None self.systemTags = None self.userTags = None self.sessionId = None class StartBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/pxeserver/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'startBaremetalPxeServer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StartBaremetalPxeServerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryOssBucketFileNameAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/oss-bucket' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryOssBucketFileNameAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdatePrimaryStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updatePrimaryStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdatePrimaryStorageAction, self).__init__() self.uuid = None self.name = None self.description = None self.url = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVirtualBorderRouterFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncVirtualBorderRouterFromRemote' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVirtualBorderRouterFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmSshKeyAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmSshKey' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'SshKey': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmSshKeyAction, self).__init__() self.uuid = None self.SshKey = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmInstanceHaLevelAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/ha-levels' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmInstanceHaLevelAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeHostStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeHostState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable','maintain'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeHostStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class CreateBaremetalHostCfgAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/baremetal/hostcfg' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'vnc': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'unattended': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'nicCfgs': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateBaremetalHostCfgAction, self).__init__() self.chassisUuid = None self.password = None self.vnc = None self.unattended = None self.nicCfgs = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryImageStoreBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/image-store' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryImageStoreBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteRouterInterfaceLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/router-interface/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteRouterInterfaceLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsSecurityGroupRuleFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group-rule' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsSecurityGroupRuleFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLdapServerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/ldap/servers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLdapServerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateUserAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/users/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateUser' PARAMS = { 'uuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateUserAction, self).__init__() self.uuid = None self.password = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteZoneAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/zones/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'zone' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteZoneAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeBackupStorageStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeBackupStorageState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeBackupStorageStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAllEcsInstancesFromDataCenterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/dc-ecs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAllEcsInstancesFromDataCenterAction, self).__init__() self.dataCenterUuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryConsoleProxyAgentAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/consoles/agents' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryConsoleProxyAgentAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsInstanceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/ecs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsInstanceAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ProvisionBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'provisionBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ProvisionBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class LogInByLdapAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ldap/login' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'logInByLdap' PARAMS = { 'uid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogInByLdapAction, self).__init__() self.uid = None self.password = None self.systemTags = None self.userTags = None class GetInterdependentL3NetworksImagesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/images-l3networks/dependencies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetInterdependentL3NetworksImagesAction, self).__init__() self.zoneUuid = None self.l3NetworkUuids = None self.imageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPoliciesToUserAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/users/{userUuid}/policy-collection' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPoliciesToUserAction, self).__init__() self.userUuid = None self.policyUuids = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBaremetalChassisAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/baremetal/chassis/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBaremetalChassisAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryHostAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryHostAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class PowerOffBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerOffBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerOffBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmSshKeyAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/ssh-keys' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmSshKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/pxeserver/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBaremetalPxeServer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpInterface': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeBegin': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeEnd': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeNetmask': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBaremetalPxeServerAction, self).__init__() self.uuid = None self.dhcpInterface = None self.dhcpRangeBegin = None self.dhcpRangeEnd = None self.dhcpRangeNetmask = None self.systemTags = None self.userTags = None self.sessionId = None class AttachL2NetworkToClusterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/{l2NetworkUuid}/clusters/{clusterUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachL2NetworkToClusterAction, self).__init__() self.l2NetworkUuid = None self.clusterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddMonToCephBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monUrls': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddMonToCephBackupStorageAction, self).__init__() self.uuid = None self.monUrls = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalHostCfgAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/hostcfg' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalHostCfgAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryPassThroughAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/all' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'instant': ParamAnnotation(), 'startTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'step': ParamAnnotation(), 'expression': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'relativeTime': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryPassThroughAction, self).__init__() self.instant = None self.startTime = None self.endTime = None self.step = None self.expression = None self.relativeTime = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBackupStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/backup-storage/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBackupStorageAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateVmNicForSecurityGroupAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/security-groups/{securityGroupUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateVmNicForSecurityGroupAction, self).__init__() self.securityGroupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetPrimaryStorageCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/capacities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPrimaryStorageCapacityAction, self).__init__() self.zoneUuids = None self.clusterUuids = None self.primaryStorageUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class StopEcsInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'stopEcsInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StopEcsInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmConsolePasswordAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/console-password' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmConsolePasswordAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmInstanceHaLevelAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{uuid}/ha-levels' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'level': ParamAnnotation(required=True,valid_values=['NeverStop','OnHostFailure'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmInstanceHaLevelAction, self).__init__() self.uuid = None self.level = None self.systemTags = None self.userTags = None self.sessionId = None class GetLicenseInfoAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/licenses' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetLicenseInfoAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class ChangeImageStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeImageState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeImageStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class CreateInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/instance-offerings' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuNum': ParamAnnotation(required=True,number_range=[1, 1024],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'memorySize': ParamAnnotation(required=True,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatorStrategy': ParamAnnotation(), 'sortKey': ParamAnnotation(), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateInstanceOfferingAction, self).__init__() self.name = None self.description = None self.cpuNum = None self.memorySize = None self.allocatorStrategy = None self.sortKey = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryManagementNodeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/management-nodes' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryManagementNodeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateEipAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/eips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateEip' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateEipAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeInstanceOfferingStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/instance-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeInstanceOfferingState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeInstanceOfferingStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class GetImageQgaAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/images/{uuid}/qga' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetImageQgaAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeSecurityGroupStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/security-groups/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeSecurityGroupState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeSecurityGroupStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeInstanceOffering' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeInstanceOfferingAction, self).__init__() self.vmInstanceUuid = None self.instanceOfferingUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteDiskOfferingAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/disk-offerings/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteDiskOfferingAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVniRangeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vxlan-pool/{l2NetworkUuid}/vni-ranges' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startVni': ParamAnnotation(required=True,number_range=[0, 16777214],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endVni': ParamAnnotation(required=True,number_range=[0, 16777214],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVniRangeAction, self).__init__() self.name = None self.description = None self.startVni = None self.endVni = None self.l2NetworkUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVolumeSnapshotAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volume-snapshots' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVolumeSnapshotAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class StopBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/pxeserver/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'stopBaremetalPxeServer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StopBaremetalPxeServerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CheckIpAvailabilityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/{l3NetworkUuid}/ip/{ip}/availability' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ip': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CheckIpAvailabilityAction, self).__init__() self.l3NetworkUuid = None self.ip = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLoadBalancerListenerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/load-balancers/listeners/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLoadBalancerListenerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteIdentityZoneInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/identity-zone/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteIdentityZoneInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryIpRangeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/ip-ranges' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryIpRangeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateVmNicsForLoadBalancerAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/load-balancers/listeners/{listenerUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'listenerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateVmNicsForLoadBalancerAction, self).__init__() self.listenerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryRouterInterfaceFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/router-interface' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryRouterInterfaceFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBaremetalHostCfgAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/baremetal/hostcfg/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBaremetalHostCfgAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class PowerOnBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerOnBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerOnBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRootVolumeTemplateFromRootVolumeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images/root-volume-templates/from/volumes/{rootVolumeUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'rootVolumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRootVolumeTemplateFromRootVolumeAction, self).__init__() self.name = None self.description = None self.guestOsType = None self.backupStorageUuids = None self.rootVolumeUuid = None self.platform = None self.system = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteImageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/images/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteImageAction, self).__init__() self.uuid = None self.backupStorageUuids = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySystemTagAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/system-tags' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySystemTagAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsSecurityGroupInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/security-group/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsSecurityGroupInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateZoneAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/zones/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateZone' PARAMS = { 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateZoneAction, self).__init__() self.name = None self.description = None self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DestroyVmInstanceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DestroyVmInstanceAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class RecoverVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoverVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoverVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncImageSizeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncImageSize' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncImageSizeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangePortForwardingRuleStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/port-forwarding/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changePortForwardingRuleState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangePortForwardingRuleStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class CreateLoadBalancerListenerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/load-balancers/{loadBalancerUuid}/listeners' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'loadBalancerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instancePort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'loadBalancerPort': ParamAnnotation(required=True,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'protocol': ParamAnnotation(required=False,valid_values=['tcp','http'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateLoadBalancerListenerAction, self).__init__() self.loadBalancerUuid = None self.name = None self.description = None self.instancePort = None self.loadBalancerPort = None self.protocol = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2VlanNetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vlan' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vlan': ParamAnnotation(required=True,number_range=[1, 4094],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2VlanNetworkAction, self).__init__() self.vlan = None self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetNetworkServiceTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/network-services/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetNetworkServiceTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class QuerySharedResourceAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/resources' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySharedResourceAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteUserAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/users/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteUserAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddOssFileBucketNameAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/oss-bucket' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'bucketName': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddOssFileBucketNameAction, self).__init__() self.bucketName = None self.regionId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetFreeIpAction(AbstractAction): HTTP_METHOD = 'GET' PATH = 'null' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipRangeUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'start': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetFreeIpAction, self).__init__() self.l3NetworkUuid = None self.ipRangeUuid = None self.start = None self.limit = None self.systemTags = None self.userTags = None self.sessionId = None class GetNicQosAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/nic-qos' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetNicQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmConsoleAddressAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/console-addresses' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmConsoleAddressAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReimageVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reimageVmInstance' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReimageVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncRouteEntryFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/route-entry/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncRouteEntryFromRemote' PARAMS = { 'vRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncRouteEntryFromRemoteAction, self).__init__() self.vRouterUuid = None self.vRouterType = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsSecurityGroupRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/security-group/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsSecurityGroupRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLdapServerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/ldap/servers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLdapServerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachOssBucketToEcsDataCenterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/{dataCenterUuid}/oss-bucket/{ossBucketUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ossBucketUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachOssBucketToEcsDataCenterAction, self).__init__() self.ossBucketUuid = None self.dataCenterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateGlobalConfigAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/global-configurations/{category}/{name}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateGlobalConfig' PARAMS = { 'category': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'value': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateGlobalConfigAction, self).__init__() self.category = None self.name = None self.value = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteGCJobAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/gc-jobs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteGCJobAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddConnectionAccessPointFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/access-point' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddConnectionAccessPointFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmConsolePasswordAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmConsolePassword' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'consolePassword': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmConsolePasswordAction, self).__init__() self.uuid = None self.consolePassword = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVolumeQosAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volumes/{uuid}/qos' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVolumeQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class RequestConsoleAccessAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/consoles' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RequestConsoleAccessAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ShareResourceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/resources/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'shareResource' PARAMS = { 'resourceUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'accountUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'toPublic': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ShareResourceAction, self).__init__() self.resourceUuids = None self.accountUuids = None self.toPublic = None self.systemTags = None self.userTags = None self.sessionId = None class QueryIPSecConnectionAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/ipsec' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryIPSecConnectionAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeletePrimaryStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/primary-storage/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeletePrimaryStorageAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/port-forwarding/{ruleUuid}/vm-instances/nics/{vmNicUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ruleUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPortForwardingRuleAction, self).__init__() self.ruleUuid = None self.vmNicUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryGCJobAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/gc-jobs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryGCJobAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsImageLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/image/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsImageLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddSimulatorBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/simulators' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'totalCapacity': ParamAnnotation(), 'availableCapacity': ParamAnnotation(), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSimulatorBackupStorageAction, self).__init__() self.totalCapacity = None self.availableCapacity = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryNetworkServiceProviderAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/network-services/providers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryNetworkServiceProviderAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddIpRangeByNetworkCidrAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/ip-ranges/by-cidr' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'networkCidr': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddIpRangeByNetworkCidrAction, self).__init__() self.name = None self.description = None self.l3NetworkUuid = None self.networkCidr = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddCephBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/ceph' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'monUrls': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'poolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddCephBackupStorageAction, self).__init__() self.monUrls = None self.poolName = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateBaremetalChassisAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/baremetal/chassis' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'ipmiAddress': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiUsername': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiPassword': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateBaremetalChassisAction, self).__init__() self.ipmiAddress = None self.ipmiUsername = None self.ipmiPassword = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteL2NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l2-networks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteL2NetworkAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateZoneAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/zones' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateZoneAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVniRangeAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l2-networks/vxlan-pool/vni-ranges/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVniRangeAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ChangePrimaryStorageStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changePrimaryStorageState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable','maintain','deleting'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangePrimaryStorageStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySchedulerTriggerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/scheduler/triggers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySchedulerTriggerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateLdapBindingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/ldap/bindings' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ldapUid': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountUuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateLdapBindingAction, self).__init__() self.ldapUid = None self.accountUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetConnectionBetweenL3NetworkAndAliyunVSwitchAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/connections' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceType': ParamAnnotation(required=True,valid_values=['vswitch','l3network','vroutervm','vbr','vpc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetConnectionBetweenL3NetworkAndAliyunVSwitchAction, self).__init__() self.uuid = None self.resourceType = None self.systemTags = None self.userTags = None self.sessionId = None class QueryIPSecConnectionAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/ipsec' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryIPSecConnectionAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVSwitchInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vswitch/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVSwitchInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteClusterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/clusters/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteClusterAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ReimageVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reimageVmInstance' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReimageVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveUserFromGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/groups/{groupUuid}/users/{userUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveUserFromGroupAction, self).__init__() self.userUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncRouterInterfaceFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/router-interface/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncRouterInterfaceFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateGlobalConfigAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/global-configurations/{category}/{name}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateGlobalConfig' PARAMS = { 'category': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'value': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateGlobalConfigAction, self).__init__() self.category = None self.name = None self.value = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/instance-offerings/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteInstanceOfferingAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2VxlanNetworkPoolAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vxlan-pool' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2VxlanNetworkPoolAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachDataVolumeFromVmAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volumes/{uuid}/vm-instances' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachDataVolumeFromVmAction, self).__init__() self.uuid = None self.vmUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVSwitchRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vswitch/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVSwitchRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVCenterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vcenters/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVCenterAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class LogOutAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/sessions/{sessionUuid}' NEED_SESSION = False NEED_POLL = False PARAM_NAME = '' PARAMS = { 'sessionUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogOutAction, self).__init__() self.sessionUuid = None self.systemTags = None self.userTags = None class QueryVCenterPrimaryStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/primary-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterPrimaryStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySharedResourceAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/resources' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySharedResourceAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DestroyVmInstanceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DestroyVmInstanceAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateL3NetworkAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l3-networks/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateL3Network' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateL3NetworkAction, self).__init__() self.uuid = None self.name = None self.description = None self.system = None self.systemTags = None self.userTags = None self.sessionId = None class QueryClusterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/clusters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryClusterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddVmNicToSecurityGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups/{securityGroupUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVmNicToSecurityGroupAction, self).__init__() self.securityGroupUuid = None self.vmNicUuids = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVolumeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volumes' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVolumeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class TriggerGCJobAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/gc-jobs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'triggerGCJob' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(TriggerGCJobAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetNetworkServiceTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/network-services/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetNetworkServiceTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class UpdateMonitorTriggerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/monitoring/triggers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateMonitorTrigger' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'expression': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'duration': ParamAnnotation(required=False,number_range=[1, 2147483647],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateMonitorTriggerAction, self).__init__() self.uuid = None self.name = None self.description = None self.expression = None self.duration = None self.systemTags = None self.userTags = None self.sessionId = None class QueryMediaAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/media' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryMediaAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBackupFileInPublicAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/backup-mysql' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'file': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBackupFileInPublicAction, self).__init__() self.type = None self.regionId = None self.file = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volume-snapshots/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVolumeSnapshotAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeVipStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeVipState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeVipStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class AddKVMHostAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hosts/kvm' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddKVMHostAction, self).__init__() self.username = None self.password = None self.sshPort = None self.name = None self.description = None self.managementIp = None self.clusterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetResourceNamesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/resources/names' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetResourceNamesAction, self).__init__() self.uuids = None self.systemTags = None self.userTags = None self.sessionId = None class DetachL3NetworkFromVmAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/nics/{vmNicUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vmNicUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachL3NetworkFromVmAction, self).__init__() self.vmNicUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVipAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vips' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatorStrategy': ParamAnnotation(), 'requiredIp': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVipAction, self).__init__() self.name = None self.description = None self.l3NetworkUuid = None self.allocatorStrategy = None self.requiredIp = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetL3NetworkDhcpIpAddressAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/{l3NetworkUuid/dhcp-ip' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL3NetworkDhcpIpAddressAction, self).__init__() self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddVRouterRouteEntryAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vrouter-route-tables/{routeTableUuid}/route-entries' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['UserStatic','UserBlackHole'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'routeTableUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'destination': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'target': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'distance': ParamAnnotation(required=False,number_range=[1, 254],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVRouterRouteEntryAction, self).__init__() self.description = None self.type = None self.routeTableUuid = None self.destination = None self.target = None self.distance = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeTemplateFromVolumeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images/data-volume-templates/from/volumes/{volumeUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeTemplateFromVolumeAction, self).__init__() self.name = None self.description = None self.volumeUuid = None self.backupStorageUuids = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetTaskProgressAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/task-progresses/{apiId}' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'apiId': ParamAnnotation(), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetTaskProgressAction, self).__init__() self.apiId = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsImageFromLocalImageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/image' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsImageFromLocalImageAction, self).__init__() self.imageUuid = None self.dataCenterUuid = None self.backupStorageUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddVCenterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vcenters' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'https': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'port': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'domainName': ParamAnnotation(required=True,max_length=256,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVCenterAction, self).__init__() self.username = None self.password = None self.zoneUuid = None self.name = None self.https = None self.port = None self.domainName = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachL3NetworkToVmAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmInstanceUuid}/l3-networks/{l3NetworkUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'staticIp': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachL3NetworkToVmAction, self).__init__() self.vmInstanceUuid = None self.l3NetworkUuid = None self.staticIp = None self.systemTags = None self.userTags = None self.sessionId = None class LogInByLdapAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ldap/login' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'logInByLdap' PARAMS = { 'uid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogInByLdapAction, self).__init__() self.uid = None self.password = None self.systemTags = None self.userTags = None class DeleteEcsSecurityGroupInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/security-group/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsSecurityGroupInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DetachMonitorTriggerActionFromTriggerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/monitoring/triggers/{triggerUuid}/trigger-actions/{actionUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'triggerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'actionUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachMonitorTriggerActionFromTriggerAction, self).__init__() self.triggerUuid = None self.actionUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachVRouterRouteTableFromVRouterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vrouter-route-tables/{routeTableUuid}/detach' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'routeTableUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'virtualRouterVmUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachVRouterRouteTableFromVRouterAction, self).__init__() self.routeTableUuid = None self.virtualRouterVmUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectHost' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectHostAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateL2NetworkAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l2-networks/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateL2Network' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateL2NetworkAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVpcIkeConfigFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpn-connection/ike' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVpcIkeConfigFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeHostStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeHostState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable','maintain'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeHostStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class AddImageStoreBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/image-store' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'hostname': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddImageStoreBackupStorageAction, self).__init__() self.hostname = None self.username = None self.password = None self.sshPort = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CloneVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'cloneVmInstance' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'strategy': ParamAnnotation(required=False,valid_values=['InstantStart','JustCreate'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'names': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CloneVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.strategy = None self.names = None self.systemTags = None self.userTags = None self.sessionId = None class PauseVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'pauseVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PauseVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateWebhookAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/web-hooks' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'opaque': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateWebhookAction, self).__init__() self.name = None self.description = None self.url = None self.type = None self.opaque = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteL2NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l2-networks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteL2NetworkAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeFromVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/data/from/volume-snapshots/{volumeSnapshotUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeSnapshotUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeFromVolumeSnapshotAction, self).__init__() self.name = None self.description = None self.volumeSnapshotUuid = None self.primaryStorageUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddLdapServerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/ldap/servers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'base': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'username': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'encryption': ParamAnnotation(required=True,valid_values=['None','TLS'],max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddLdapServerAction, self).__init__() self.name = None self.description = None self.url = None self.base = None self.username = None self.password = None self.encryption = None self.systemTags = None self.userTags = None self.sessionId = None class AddDataCenterFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/data-center' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddDataCenterFromRemoteAction, self).__init__() self.regionId = None self.type = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RecoverImageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{imageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoverImage' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoverImageAction, self).__init__() self.imageUuid = None self.backupStorageUuids = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/baremetal/pxeserver/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBaremetalPxeServerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmHostnameAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/hostnames' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmHostnameAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetL2NetworkTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL2NetworkTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class QueryManagementNodeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/management-nodes' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryManagementNodeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPoliciesToUserAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/users/{userUuid}/policy-collection' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPoliciesToUserAction, self).__init__() self.userUuid = None self.policyUuids = None self.systemTags = None self.userTags = None self.sessionId = None class QueryNetworkServiceL3NetworkRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/network-services/refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryNetworkServiceL3NetworkRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryResourcePriceAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/billings/prices' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryResourcePriceAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class PowerResetBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerResetBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerResetBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSecurityGroupRuleAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/rules' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ruleUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSecurityGroupRuleAction, self).__init__() self.ruleUuids = None self.systemTags = None self.userTags = None self.sessionId = None class GetOssBackupBucketFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/backup-mysql/oss' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetOssBackupBucketFromRemoteAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryMetadataAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/meta-data' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'matches': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryMetadataAction, self).__init__() self.matches = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmNicFromSecurityGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/{securityGroupUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmNicFromSecurityGroupAction, self).__init__() self.securityGroupUuid = None self.vmNicUuids = None self.systemTags = None self.userTags = None self.sessionId = None class QueryImageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/images' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryImageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBackupStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBackupStorageAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEipAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/eips' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEipAction, self).__init__() self.name = None self.description = None self.vipUuid = None self.vmNicUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryApplianceVmAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/appliances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryApplianceVmAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateZonesClustersHostsForCreatingVmAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/candidate-destinations' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'rootDiskOfferingUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataDiskOfferingUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(), 'clusterUuid': ParamAnnotation(), 'defaultL3NetworkUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateZonesClustersHostsForCreatingVmAction, self).__init__() self.instanceOfferingUuid = None self.imageUuid = None self.l3NetworkUuids = None self.rootDiskOfferingUuid = None self.dataDiskOfferingUuids = None self.zoneUuid = None self.clusterUuid = None self.defaultL3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetBackupStorageCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/capacities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetBackupStorageCapacityAction, self).__init__() self.zoneUuids = None self.backupStorageUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVpcVpnGatewayFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpc-vpn/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVpcVpnGatewayFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachVRouterRouteTableToVRouterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vrouter-route-tables/{routeTableUuid}/attach' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'routeTableUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'virtualRouterVmUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachVRouterRouteTableToVRouterAction, self).__init__() self.routeTableUuid = None self.virtualRouterVmUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryQuotaAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/quotas' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryQuotaAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteRouterInterfaceRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/router-interface/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vrouter','vbr'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteRouterInterfaceRemoteAction, self).__init__() self.uuid = None self.vRouterType = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetInterdependentL3NetworksImagesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/images-l3networks/dependencies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetInterdependentL3NetworksImagesAction, self).__init__() self.zoneUuid = None self.l3NetworkUuids = None self.imageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryCephPrimaryStoragePoolAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/ceph/pools' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryCephPrimaryStoragePoolAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddMonToCephPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monUrls': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddMonToCephPrimaryStorageAction, self).__init__() self.uuid = None self.monUrls = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeEipStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/eips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeEipState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeEipStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmBootOrderAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmBootOrder' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bootOrder': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmBootOrderAction, self).__init__() self.uuid = None self.bootOrder = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualRouterVmAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/appliances/virtual-routers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualRouterVmAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveMonFromCephBackupStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/backup-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monHostnames': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveMonFromCephBackupStorageAction, self).__init__() self.uuid = None self.monHostnames = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteCephPrimaryStoragePoolAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/primary-storage/ceph/pools/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteCephPrimaryStoragePoolAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVRouterRouteTableAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vrouter-route-tables' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVRouterRouteTableAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBaremetalChassisAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/baremetal/chassis/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBaremetalChassisAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateOssBackupBucketRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/backup-mysql/oss' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateOssBackupBucketRemoteAction, self).__init__() self.regionId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBaremetalHostCfgAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/baremetal/hostcfg/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBaremetalHostCfgAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class SyncAliyunRouteEntryFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/route-entry/{vRouterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncAliyunRouteEntryFromRemoteAction, self).__init__() self.vRouterUuid = None self.vRouterType = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateLoadBalancerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/load-balancers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateLoadBalancerAction, self).__init__() self.name = None self.description = None self.vipUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryNetworkServiceProviderAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/network-services/providers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryNetworkServiceProviderAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsInstanceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/ecs/{uuid}/remote' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsInstanceAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateVmNicsForLoadBalancerAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/load-balancers/listeners/{listenerUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'listenerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateVmNicsForLoadBalancerAction, self).__init__() self.listenerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSimulatorPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/simulators' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'totalCapacity': ParamAnnotation(), 'availableCapacity': ParamAnnotation(), 'availablePhysicalCapacity': ParamAnnotation(), 'totalPhysicalCapacity': ParamAnnotation(), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSimulatorPrimaryStorageAction, self).__init__() self.totalCapacity = None self.availableCapacity = None self.availablePhysicalCapacity = None self.totalPhysicalCapacity = None self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class LocalStorageGetVolumeMigratableHostsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{volumeUuid}/migration-target-hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(LocalStorageGetVolumeMigratableHostsAction, self).__init__() self.volumeUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPolicyToUserGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/groups/{groupUuid}/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPolicyToUserGroupAction, self).__init__() self.policyUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeVolumeStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeVolumeState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeVolumeStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteWebhookAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/web-hooks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteWebhookAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryHybridEipFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/eip' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryHybridEipFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateIPsecConnectionAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ipsec/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateIPsecConnection' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateIPsecConnectionAction, self).__init__() self.uuid = None self.name = None self.description = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetResourceAccountAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/resources/accounts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'resourceUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetResourceAccountAction, self).__init__() self.resourceUuids = None self.systemTags = None self.userTags = None self.sessionId = None class ReloadLicenseAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/licenses/actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'reloadLicense' PARAMS = { 'managementNodeUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReloadLicenseAction, self).__init__() self.managementNodeUuids = None self.systemTags = None self.userTags = None self.sessionId = None class StartVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'startVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StartVmInstanceAction, self).__init__() self.uuid = None self.clusterUuid = None self.hostUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAliyunKeySecretAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/key/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAliyunKeySecretAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLoadBalancerListenerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/load-balancers/listeners' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLoadBalancerListenerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualRouterVRouterRouteTableRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vrouter-route-tables/virtual-router-refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualRouterVRouterRouteTableRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachEipAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/eips/{uuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachEipAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2VlanNetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vlan' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2VlanNetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/backup-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeFromVolumeTemplateAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/data/from/data-volume-templates/{imageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeFromVolumeTemplateAction, self).__init__() self.imageUuid = None self.name = None self.description = None self.primaryStorageUuid = None self.hostUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveVmNicFromLoadBalancerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/load-balancers/listeners/{listenerUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'listenerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveVmNicFromLoadBalancerAction, self).__init__() self.vmNicUuids = None self.listenerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateUserAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/users/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateUser' PARAMS = { 'uuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateUserAction, self).__init__() self.uuid = None self.password = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSystemTagAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/system-tags/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSystemTag' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'tag': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSystemTagAction, self).__init__() self.uuid = None self.tag = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectPrimaryStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectPrimaryStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateVmNicForSecurityGroupAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/security-groups/{securityGroupUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateVmNicForSecurityGroupAction, self).__init__() self.securityGroupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAliyunKeySecretAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/key' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAliyunKeySecretAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddUserToGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/groups/{groupUuid}/users' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddUserToGroupAction, self).__init__() self.userUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ShareResourceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/resources/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'shareResource' PARAMS = { 'resourceUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'accountUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'toPublic': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ShareResourceAction, self).__init__() self.resourceUuids = None self.accountUuids = None self.toPublic = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalPxeServerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/pxeserver' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalPxeServerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteMediaAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/media/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteMediaAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPoliciesFromUserAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/users/{userUuid}/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'policyUuids': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPoliciesFromUserAction, self).__init__() self.policyUuids = None self.userUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAccountAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAccountAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class BackupDatabaseToPublicCloudAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/backup-mysql' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'local': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(BackupDatabaseToPublicCloudAction, self).__init__() self.type = None self.regionId = None self.local = None self.systemTags = None self.userTags = None self.sessionId = None class QueryOssBucketFileNameAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/oss-bucket' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryOssBucketFileNameAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVipQosAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vips/{uuid}/vip-qos' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'direction': ParamAnnotation(required=True,valid_values=['in','out','all'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVipQosAction, self).__init__() self.uuid = None self.direction = None self.systemTags = None self.userTags = None self.sessionId = None class GetHostAllocatorStrategiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hosts/allocators/strategies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetHostAllocatorStrategiesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class DeleteExportedImageFromBackupStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/backup-storage/{backupStorageUuid}/exported-images/{imageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteExportedImageFromBackupStorageAction, self).__init__() self.backupStorageUuid = None self.imageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class MigrateVmAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'migrateVm' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(MigrateVmAction, self).__init__() self.vmInstanceUuid = None self.hostUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmHostnameAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/hostnames' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmHostnameAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetAccountQuotaUsageAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/accounts/quota/{uuid}/usages' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetAccountQuotaUsageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryPortForwardingRuleAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/port-forwarding' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryPortForwardingRuleAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CheckIpAvailabilityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/{l3NetworkUuid}/ip/{ip}/availability' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ip': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CheckIpAvailabilityAction, self).__init__() self.l3NetworkUuid = None self.ip = None self.systemTags = None self.userTags = None self.sessionId = None class GetOssBucketNameFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/oss/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetOssBucketNameFromRemoteAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class CreateVpnIkeConfigAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/vpn-connection/ike' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'psk': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'pfs': ParamAnnotation(required=False,valid_values=['disabled','group1','group2','group5','group14','group24'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'version': ParamAnnotation(required=False,valid_values=['ikev1','ikev2'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mode': ParamAnnotation(required=False,valid_values=['main','aggressive'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'encAlg': ParamAnnotation(required=False,valid_values=['3des','aes-128','aes-192','aes-256','des'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'authAlg': ParamAnnotation(required=False,valid_values=['md5','sha1'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'lifetime': ParamAnnotation(required=False,number_range=[60, 86400],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'localIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'remoteIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVpnIkeConfigAction, self).__init__() self.name = None self.psk = None self.pfs = None self.version = None self.mode = None self.encAlg = None self.authAlg = None self.lifetime = None self.localIp = None self.remoteIp = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsImageRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/image/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsImageRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateSchedulerTriggerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/scheduler/triggers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerInterval': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'repeatCount': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startTime': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerType': ParamAnnotation(required=True,valid_values=['simple','cron'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cron': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateSchedulerTriggerAction, self).__init__() self.name = None self.description = None self.schedulerInterval = None self.repeatCount = None self.startTime = None self.schedulerType = None self.cron = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateBackupStorageForCreatingImageAction(AbstractAction): HTTP_METHOD = 'GET' PATH = 'null' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'volumeUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeSnapshotUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateBackupStorageForCreatingImageAction, self).__init__() self.volumeUuid = None self.volumeSnapshotUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateResourcePriceAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/billings/prices' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceName': ParamAnnotation(required=True,valid_values=['cpu','memory','rootVolume','dataVolume','snapShot'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUnit': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'timeUnit': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'price': ParamAnnotation(required=True,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dateInLong': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateResourcePriceAction, self).__init__() self.resourceName = None self.resourceUnit = None self.timeUnit = None self.price = None self.accountUuid = None self.dateInLong = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVirtualBorderRouterLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/border-router/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVirtualBorderRouterLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class SyncAliyunVirtualRouterFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vrouter/{vpcUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vpcUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncAliyunVirtualRouterFromRemoteAction, self).__init__() self.vpcUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangePortForwardingRuleStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/port-forwarding/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changePortForwardingRuleState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangePortForwardingRuleStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateRouteInterfaceRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/router-interface/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateRouteInterfaceRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'op': ParamAnnotation(required=True,valid_values=['active','inactive'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateRouteInterfaceRemoteAction, self).__init__() self.uuid = None self.op = None self.vRouterType = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeResourceOwnerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/account/{accountUuid}/resources' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'accountUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeResourceOwnerAction, self).__init__() self.accountUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsInstanceFromLocalImageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/ecs' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'ecsRootVolumeType': ParamAnnotation(required=False,valid_values=['cloud','cloud_efficiency','cloud_ssd','ephemeral_ssd'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=256,min_length=2,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsRootVolumeGBSize': ParamAnnotation(required=False,number_range=[40, 500],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'createMode': ParamAnnotation(required=False,valid_values=['atomic','permissive'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'privateIpAddress': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsInstanceName': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatePublicIp': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsConsolePassword': ParamAnnotation(required=False,valid_regex_values=r'[a-zA-Z0-9]{6}',max_length=6,min_length=6,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsVSwitchUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsSecurityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsRootPassword': ParamAnnotation(required=True,valid_regex_values=r'^[a-zA-Z][\w\W]{7,17}$',max_length=30,min_length=8,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsBandWidth': ParamAnnotation(required=True,number_range=[0, 200],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsInstanceFromLocalImageAction, self).__init__() self.ecsRootVolumeType = None self.description = None self.ecsRootVolumeGBSize = None self.createMode = None self.privateIpAddress = None self.ecsInstanceName = None self.allocatePublicIp = None self.ecsConsolePassword = None self.backupStorageUuid = None self.imageUuid = None self.instanceOfferingUuid = None self.ecsVSwitchUuid = None self.ecsSecurityGroupUuid = None self.ecsRootPassword = None self.ecsBandWidth = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateIsoForAttachingVmAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/iso-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateIsoForAttachingVmAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryPrimaryStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryPrimaryStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ExpungeImageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{imageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'expungeImage' PARAMS = { 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExpungeImageAction, self).__init__() self.imageUuid = None self.backupStorageUuids = None self.systemTags = None self.userTags = None self.sessionId = None class AddCephPrimaryStoragePoolAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/ceph/{primaryStorageUuid}/pools' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'poolName': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'errorIfNotExist': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddCephPrimaryStoragePoolAction, self).__init__() self.primaryStorageUuid = None self.poolName = None self.description = None self.errorIfNotExist = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualRouterOfferingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/instance-offerings/virtual-routers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualRouterOfferingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddIpRangeByNetworkCidrAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/ip-ranges/by-cidr' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'networkCidr': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddIpRangeByNetworkCidrAction, self).__init__() self.name = None self.description = None self.l3NetworkUuid = None self.networkCidr = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateCephBackupStorageMonAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/ceph/mons/{monUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateCephBackupStorageMon' PARAMS = { 'monUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshUsername': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPassword': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateCephBackupStorageMonAction, self).__init__() self.monUuid = None self.hostname = None self.sshUsername = None self.sshPassword = None self.sshPort = None self.monPort = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVolumeSnapshotAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volume-snapshots' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVolumeSnapshotAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVpcVpnConnectionRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/vpn-connection' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'userGatewayUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vpnGatewayUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'localCidr': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'remoteCidr': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'active': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ikeConfUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipsecConfUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVpcVpnConnectionRemoteAction, self).__init__() self.userGatewayUuid = None self.vpnGatewayUuid = None self.name = None self.localCidr = None self.remoteCidr = None self.active = None self.ikeConfUuid = None self.ipsecConfUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsImageFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/image/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsImageFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteHostAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hosts/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteHostAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddNfsPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/nfs' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddNfsPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RecoverVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoverVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoverVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVRouterRouteTableAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vrouter-route-tables/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVRouterRouteTableAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeImageStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeImageState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeImageStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class GetVRouterRouteTableAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vrouter-route-tables/vrouter/{virtualRouterVmUuid}' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'virtualRouterVmUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVRouterRouteTableAction, self).__init__() self.virtualRouterVmUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeMediaStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/media/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeMediaState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeMediaStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAlertAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/monitoring/alerts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAlertAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetPrimaryStorageTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPrimaryStorageTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class UpdateSchedulerTriggerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/scheduler/triggers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSchedulerTrigger' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSchedulerTriggerAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSchedulerJobAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/scheduler/jobs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSchedulerJobAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcVpnGatewayLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/vpn-gateway/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcVpnGatewayLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryRouterInterfaceFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/router-interface' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryRouterInterfaceFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryCephPrimaryStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/ceph' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryCephPrimaryStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class PowerOnBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerOnBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerOnBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateUserAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/users' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateUserAction, self).__init__() self.name = None self.password = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVirtualRouterOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/instance-offerings/virtual-routers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVirtualRouterOffering' PARAMS = { 'isDefault': ParamAnnotation(), 'imageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVirtualRouterOfferingAction, self).__init__() self.isDefault = None self.imageUuid = None self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class GetEipAttachableVmNicsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/eips/{eipUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'eipUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetEipAttachableVmNicsAction, self).__init__() self.eipUuid = None self.vipUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveSchedulerJobFromSchedulerTriggerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/scheduler/jobs/{schedulerJobUuid}/scheduler/triggers/{schedulerTriggerUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'schedulerJobUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerTriggerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveSchedulerJobFromSchedulerTriggerAction, self).__init__() self.schedulerJobUuid = None self.schedulerTriggerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVtepAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vteps' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVtepAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEipAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/eips' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEipAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsImageLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/image/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsImageLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLoadBalancerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/load-balancers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLoadBalancerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateUserTagAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/user-tags' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceType': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'tag': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateUserTagAction, self).__init__() self.resourceType = None self.resourceUuid = None self.tag = None self.systemTags = None self.userTags = None self.sessionId = None class QueryZoneAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/zones' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryZoneAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateSchedulerJobAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/scheduler/jobs' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'targetResourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'parameters': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateSchedulerJobAction, self).__init__() self.name = None self.description = None self.targetResourceUuid = None self.type = None self.parameters = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveDnsFromL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/{l3NetworkUuid}/dns/{dns}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dns': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveDnsFromL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.dns = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVipAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vips/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVipAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryMonitorTriggerActionAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/monitoring/trigger-actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryMonitorTriggerActionAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVipAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vips' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVipAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteDataCenterInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/data-center/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteDataCenterInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVmNicInSecurityGroupAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/security-groups/vm-instances/nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVmNicInSecurityGroupAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeInstanceOfferingStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/instance-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeInstanceOfferingState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeInstanceOfferingStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class ResumeVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'resumeVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ResumeVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateEipAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/eips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateEip' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateEipAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class TerminateVirtualBorderRouterRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'terminateVirtualBorderRouterRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(TerminateVirtualBorderRouterRemoteAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsSecurityGroupRuleRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/security-group-rule/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsSecurityGroupRuleRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetVolumeFormatAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/formats' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVolumeFormatAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class GetVmConsolePasswordAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/console-passwords' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmConsolePasswordAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class IsReadyToGoAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/management-nodes/ready' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'managementNodeId': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(IsReadyToGoAction, self).__init__() self.managementNodeId = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteMonitorTriggerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/monitoring/triggers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteMonitorTriggerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateLoadBalancerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/load-balancers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateLoadBalancer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateLoadBalancerAction, self).__init__() self.uuid = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetEcsInstanceVncUrlAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/ecs-vnc/{uuid}' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetEcsInstanceVncUrlAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVersionAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/management-nodes/actions' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'getVersion' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(GetVersionAction, self).__init__() self.systemTags = None self.userTags = None class GetVolumeQosAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{uuid}/qos' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVolumeQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachOssBucketToEcsDataCenterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/{dataCenterUuid}/oss-bucket/{ossBucketUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ossBucketUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachOssBucketToEcsDataCenterAction, self).__init__() self.ossBucketUuid = None self.dataCenterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVolume' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVolumeAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySecurityGroupRuleAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/security-groups/rules' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySecurityGroupRuleAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetLocalStorageHostDiskCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/local-storage/{primaryStorageUuid}/capacities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetLocalStorageHostDiskCapacityAction, self).__init__() self.hostUuid = None self.primaryStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLdapBindingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/ldap/bindings' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLdapBindingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeletePrimaryStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/primary-storage/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeletePrimaryStorageAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeZoneStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/zones/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeZoneState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeZoneStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateQuotaAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/quotas/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateQuota' PARAMS = { 'identityUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'value': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateQuotaAction, self).__init__() self.identityUuid = None self.name = None self.value = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDataVolumeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/data' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'diskOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDataVolumeAction, self).__init__() self.name = None self.description = None self.diskOfferingUuid = None self.primaryStorageUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVolumeQosAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volumes/{uuid}/qos' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVolumeQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetDataVolumeAttachableVmAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{volumeUuid}/candidate-vm-instances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetDataVolumeAttachableVmAction, self).__init__() self.volumeUuid = None self.systemTags = None self.userTags = None self.sessionId = None class StartBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/pxeserver/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'startBaremetalPxeServer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StartBaremetalPxeServerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSecurityGroupAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/security-groups/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSecurityGroup' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSecurityGroupAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmConsolePasswordAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/console-password' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmConsolePasswordAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateImageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateImage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mediaType': ParamAnnotation(required=False,valid_values=['RootVolumeTemplate','DataVolumeTemplate','ISO'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'format': ParamAnnotation(required=False,valid_values=['raw','qcow2','iso'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateImageAction, self).__init__() self.uuid = None self.name = None self.description = None self.guestOsType = None self.mediaType = None self.format = None self.system = None self.platform = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVirtualRouterLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vrouter/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVirtualRouterLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/port-forwarding/{ruleUuid}/vm-instances/nics/{vmNicUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ruleUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPortForwardingRuleAction, self).__init__() self.ruleUuid = None self.vmNicUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeletePortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/port-forwarding/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeletePortForwardingRuleAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddCephPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/ceph' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'monUrls': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'rootVolumePoolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataVolumePoolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageCachePoolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddCephPrimaryStorageAction, self).__init__() self.monUrls = None self.rootVolumePoolName = None self.dataVolumePoolName = None self.imageCachePoolName = None self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectVirtualRouterAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/appliances/virtual-routers/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectVirtualRouter' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectVirtualRouterAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryCephBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/ceph' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryCephBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsSecurityGroupRuleFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group-rule' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsSecurityGroupRuleFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryIdentityZoneFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/identity-zone' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryIdentityZoneFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetMonitorItemAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/monitoring/items' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'resourceType': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetMonitorItemAction, self).__init__() self.resourceType = None self.systemTags = None self.userTags = None self.sessionId = None class RemoveMonFromCephPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/primary-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monHostnames': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RemoveMonFromCephPrimaryStorageAction, self).__init__() self.uuid = None self.monHostnames = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL3NetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l3-networks' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL3NetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/port-forwarding/{uuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPortForwardingRuleAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ExpungeDataVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'expungeDataVolume' PARAMS = { 'uuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExpungeDataVolumeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmStaticIpAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmStaticIp' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ip': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmStaticIpAction, self).__init__() self.vmInstanceUuid = None self.l3NetworkUuid = None self.ip = None self.systemTags = None self.userTags = None self.sessionId = None class CreatePortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/port-forwarding' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipPortStart': ParamAnnotation(required=True,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipPortEnd': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'privatePortStart': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'privatePortEnd': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'protocolType': ParamAnnotation(required=True,valid_values=['TCP','UDP'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allowedCidr': ParamAnnotation(), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreatePortForwardingRuleAction, self).__init__() self.vipUuid = None self.vipPortStart = None self.vipPortEnd = None self.privatePortStart = None self.privatePortEnd = None self.protocolType = None self.vmNicUuid = None self.allowedCidr = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RevertVolumeFromSnapshotAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volume-snapshots/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'revertVolumeFromSnapshot' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RevertVolumeFromSnapshotAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSchedulerTriggerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/scheduler/triggers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSchedulerTriggerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetPortForwardingAttachableVmNicsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/port-forwarding/{ruleUuid}/vm-instances/candidate-nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'ruleUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPortForwardingAttachableVmNicsAction, self).__init__() self.ruleUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalHardwareInfoAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/hardwareinfo' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalHardwareInfoAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachAliyunKeyAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/key/{uuid}/detach' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'detachAliyunKey' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachAliyunKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachEipAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/eips/{eipUuid}/vm-instances/nics/{vmNicUuid' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'eipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vmNicUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachEipAction, self).__init__() self.eipUuid = None self.vmNicUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySchedulerJobAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/scheduler/jobs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySchedulerJobAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPolicyFromUserAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/users/{userUuid}/policies/{policyUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPolicyFromUserAction, self).__init__() self.policyUuid = None self.userUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVpcUserVpnGatewayFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/user-vpn' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVpcUserVpnGatewayFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ProvisionBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'provisionBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ProvisionBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateBaremetalHostCfgAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/baremetal/hostcfg' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'vnc': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'unattended': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cfgItems': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateBaremetalHostCfgAction, self).__init__() self.chassisUuid = None self.password = None self.vnc = None self.unattended = None self.cfgItems = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryUserGroupAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/groups' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryUserGroupAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetCurrentTimeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/management-nodes/actions' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'getCurrentTime' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(GetCurrentTimeAction, self).__init__() self.systemTags = None self.userTags = None class CreateAccountAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['SystemAdmin','Normal'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateAccountAction, self).__init__() self.name = None self.password = None self.type = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsVpcFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vpc/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ecsVpcId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsVpcFromRemoteAction, self).__init__() self.dataCenterUuid = None self.ecsVpcId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class PowerOffBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerOffBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerOffBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcIkeConfigLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/vpn-connection/ike/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcIkeConfigLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AttachOssBucketToEcsDataCenterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/{dataCenterUuid}/oss-bucket/{ossBucketUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ossBucketUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachOssBucketToEcsDataCenterAction, self).__init__() self.ossBucketUuid = None self.dataCenterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReclaimSpaceFromImageStoreAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/image-store/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reclaimSpaceFromImageStore' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReclaimSpaceFromImageStoreAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateClusterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/clusters' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hypervisorType': ParamAnnotation(required=True,valid_values=['KVM','Simulator'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['zstack'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateClusterAction, self).__init__() self.zoneUuid = None self.name = None self.description = None self.hypervisorType = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmBootOrderAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/boot-orders' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmBootOrderAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class RecoveryVirtualBorderRouterRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoveryVirtualBorderRouterRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoveryVirtualBorderRouterRemoteAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryPolicyAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/policies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryPolicyAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachNetworkServiceFromL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/{l3NetworkUuid}/network-services' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'networkServices': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachNetworkServiceFromL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.networkServices = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteOssBucketRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/oss-bucket/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteOssBucketRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsSecurityGroupRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/security-group/remote' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vpcUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=256,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'strategy': ParamAnnotation(required=False,valid_values=['security','all'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsSecurityGroupRemoteAction, self).__init__() self.vpcUuid = None self.description = None self.name = None self.strategy = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class RebootVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'rebootVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RebootVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVolumeQosAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVolumeQos' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeBandwidth': ParamAnnotation(required=True,number_range=[1024, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVolumeQosAction, self).__init__() self.uuid = None self.volumeBandwidth = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateCephPrimaryStorageMonAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/ceph/mons/{monUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateCephPrimaryStorageMon' PARAMS = { 'monUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshUsername': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPassword': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateCephPrimaryStorageMonAction, self).__init__() self.monUuid = None self.hostname = None self.sshUsername = None self.sshPassword = None self.sshPort = None self.monPort = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2VxlanNetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vxlan' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vni': ParamAnnotation(required=False,number_range=[1, 16777214],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'poolUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2VxlanNetworkAction, self).__init__() self.vni = None self.poolUuid = None self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2NetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2NetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetVipQosAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vip/{uuid}/vip-qos' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVipQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddImageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mediaType': ParamAnnotation(required=False,valid_values=['RootVolumeTemplate','ISO','DataVolumeTemplate'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'format': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddImageAction, self).__init__() self.name = None self.description = None self.url = None self.mediaType = None self.guestOsType = None self.system = None self.format = None self.platform = None self.backupStorageUuids = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAlertAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/monitoring/alerts' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAlertAction, self).__init__() self.uuids = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddZsesPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/zses' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddZsesPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/instance-offerings' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuNum': ParamAnnotation(required=True,number_range=[1, 1024],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'memorySize': ParamAnnotation(required=True,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatorStrategy': ParamAnnotation(), 'sortKey': ParamAnnotation(), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateInstanceOfferingAction, self).__init__() self.name = None self.description = None self.cpuNum = None self.memorySize = None self.allocatorStrategy = None self.sortKey = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsInstanceLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/ecs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsInstanceLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteUserGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/groups/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteUserGroupAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CalculateAccountSpendingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/billings/accounts/{accountUuid}/actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'calculateAccountSpending' PARAMS = { 'accountUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dateStart': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dateEnd': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CalculateAccountSpendingAction, self).__init__() self.accountUuid = None self.dateStart = None self.dateEnd = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcVpnConnectionLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/vpn-connection/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcVpnConnectionLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetImageQgaAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/images/{uuid}/qga' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetImageQgaAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DownloadBackupFileFromPublicCloudAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/backup-mysql/download' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'file': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DownloadBackupFileFromPublicCloudAction, self).__init__() self.regionId = None self.file = None self.type = None self.systemTags = None self.userTags = None self.sessionId = None class UpdatePortForwardingRuleAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/port-forwarding/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updatePortForwardingRule' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdatePortForwardingRuleAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class AttachDataVolumeToVmAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/{volumeUuid}/vm-instances/{vmInstanceUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachDataVolumeToVmAction, self).__init__() self.vmInstanceUuid = None self.volumeUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateAccountAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateAccount' PARAMS = { 'uuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateAccountAction, self).__init__() self.uuid = None self.password = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateClusterAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/clusters/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateCluster' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateClusterAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class StopEcsInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'stopEcsInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StopEcsInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAliyunVirtualRouterFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vrouter' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAliyunVirtualRouterFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryImageStoreBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/image-store' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryImageStoreBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddSecurityGroupRuleAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups/{securityGroupUuid}/rules' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'rules': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSecurityGroupRuleAction, self).__init__() self.securityGroupUuid = None self.rules = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateHost' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateHostAction, self).__init__() self.uuid = None self.name = None self.description = None self.managementIp = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBaremetalHostCfgAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/hostcfg/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBaremetalHostCfg' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'vnc': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'unattended': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBaremetalHostCfgAction, self).__init__() self.uuid = None self.password = None self.vnc = None self.unattended = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmQgaAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmQga' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'enable': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmQgaAction, self).__init__() self.uuid = None self.enable = None self.systemTags = None self.userTags = None self.sessionId = None class SyncPrimaryStorageCapacityAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{primaryStorageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncPrimaryStorageCapacity' PARAMS = { 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncPrimaryStorageCapacityAction, self).__init__() self.primaryStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeClusterStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/clusters/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeClusterState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeClusterStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateKVMHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/kvm/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateKVMHost' PARAMS = { 'username': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateKVMHostAction, self).__init__() self.username = None self.password = None self.sshPort = None self.uuid = None self.name = None self.description = None self.managementIp = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmSshKeyAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmSshKey' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'SshKey': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmSshKeyAction, self).__init__() self.uuid = None self.SshKey = None self.systemTags = None self.userTags = None self.sessionId = None class CreateLoadBalancerListenerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/load-balancers/{loadBalancerUuid}/listeners' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'loadBalancerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instancePort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'loadBalancerPort': ParamAnnotation(required=True,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'protocol': ParamAnnotation(required=False,valid_values=['tcp','http'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateLoadBalancerListenerAction, self).__init__() self.loadBalancerUuid = None self.name = None self.description = None self.instancePort = None self.loadBalancerPort = None self.protocol = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetPrimaryStorageAllocatorStrategiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/allocators/strategies' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPrimaryStorageAllocatorStrategiesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalHostCfgAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/hostcfg' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalHostCfgAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdatePrimaryStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updatePrimaryStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdatePrimaryStorageAction, self).__init__() self.uuid = None self.name = None self.description = None self.url = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySftpBackupStorageAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/sftp' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySftpBackupStorageAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVniRangeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vxlan-pool/{l2NetworkUuid}/vni-ranges' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startVni': ParamAnnotation(required=True,number_range=[0, 16777214],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endVni': ParamAnnotation(required=True,number_range=[0, 16777214],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVniRangeAction, self).__init__() self.name = None self.description = None self.startVni = None self.endVni = None self.l2NetworkUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryBaremetalChassisAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/baremetal/chassis' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryBaremetalChassisAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class SetL3NetworkMtuAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/mtu' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mtu': ParamAnnotation(required=True,number_range=[68, 9216],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetL3NetworkMtuAction, self).__init__() self.l3NetworkUuid = None self.mtu = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/volumes/{volumeUuid}/volume-snapshots' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVolumeSnapshotAction, self).__init__() self.volumeUuid = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVpcUserVpnGatewayFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/user-vpn/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVpcUserVpnGatewayFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmAttachableDataVolumeAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/data-volume-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmAttachableDataVolumeAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetLicenseCapabilitiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/licenses/capabilities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetLicenseCapabilitiesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class QueryWebhookAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/web-hooks' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryWebhookAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeDiskOfferingStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/disk-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeDiskOfferingState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeDiskOfferingStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class ExpungeVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'expungeVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExpungeVmInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetFreeIpAction(AbstractAction): HTTP_METHOD = 'GET' PATH = 'null' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipRangeUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'start': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetFreeIpAction, self).__init__() self.l3NetworkUuid = None self.ipRangeUuid = None self.start = None self.limit = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmSshKeyAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/ssh-keys' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmSshKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'state': ParamAnnotation(required=False,valid_values=['Stopped','Running'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'defaultL3NetworkUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuNum': ParamAnnotation(required=False,number_range=[1, 1024],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'memorySize': ParamAnnotation(required=False,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVmInstanceAction, self).__init__() self.uuid = None self.name = None self.description = None self.state = None self.defaultL3NetworkUuid = None self.platform = None self.cpuNum = None self.memorySize = None self.systemTags = None self.userTags = None self.sessionId = None class QueryUserAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/users' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryUserAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class RevokeResourceSharingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/resources/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'revokeResourceSharing' PARAMS = { 'resourceUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'toPublic': ParamAnnotation(), 'accountUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RevokeResourceSharingAction, self).__init__() self.resourceUuids = None self.toPublic = None self.accountUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAllEcsInstancesFromDataCenterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/dc-ecs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAllEcsInstancesFromDataCenterAction, self).__init__() self.dataCenterUuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetDataCenterFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/data-center/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetDataCenterFromRemoteAction, self).__init__() self.type = None self.systemTags = None self.userTags = None self.sessionId = None class SyncImageSizeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncImageSize' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncImageSizeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSchedulerJobToSchedulerTriggerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/scheduler/jobs/{schedulerJobUuid}/scheduler/triggers/{schedulerTriggerUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'schedulerJobUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'schedulerTriggerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSchedulerJobToSchedulerTriggerAction, self).__init__() self.schedulerJobUuid = None self.schedulerTriggerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEipAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/eips/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEipAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2NoVlanNetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/no-vlan' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2NoVlanNetworkAction, self).__init__() self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddIpRangeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/ip-ranges' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'startIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'netmask': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'gateway': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddIpRangeAction, self).__init__() self.l3NetworkUuid = None self.name = None self.description = None self.startIp = None self.endIp = None self.netmask = None self.gateway = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVpcVpnConfigurationFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpn-conf/{uuid}/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVpcVpnConfigurationFromRemoteAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsVSwitchRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/vswitch' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vpcUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'identityZoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cidrBlock': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsVSwitchRemoteAction, self).__init__() self.vpcUuid = None self.identityZoneUuid = None self.cidrBlock = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateLdapServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ldap/servers/{ldapServerUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateLdapServer' PARAMS = { 'ldapServerUuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'base': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'username': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'encryption': ParamAnnotation(required=False,valid_values=['None','TLS'],max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateLdapServerAction, self).__init__() self.ldapServerUuid = None self.name = None self.description = None self.url = None self.base = None self.username = None self.password = None self.encryption = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterDatacenterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/datacenters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterDatacenterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsImageFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/image' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsImageFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateImageStoreBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/image-store/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateImageStoreBackupStorage' PARAMS = { 'username': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateImageStoreBackupStorageAction, self).__init__() self.username = None self.password = None self.hostname = None self.sshPort = None self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volume-snapshots/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVolumeSnapshot' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVolumeSnapshotAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class GetCpuMemoryCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hosts/capacities/cpu-memory' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCpuMemoryCapacityAction, self).__init__() self.zoneUuids = None self.clusterUuids = None self.hostUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVRouterRouteTableAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vrouter-route-tables' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVRouterRouteTableAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmCapabilitiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/capabilities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmCapabilitiesAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVpcUserVpnGatewayRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/user-vpn' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ip': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVpcUserVpnGatewayRemoteAction, self).__init__() self.dataCenterUuid = None self.ip = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateWebhookAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/web-hooks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateWebhook' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'opaque': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateWebhookAction, self).__init__() self.uuid = None self.name = None self.description = None self.url = None self.type = None self.opaque = None self.systemTags = None self.userTags = None self.sessionId = None class AddSimulatorBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/simulators' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'totalCapacity': ParamAnnotation(), 'availableCapacity': ParamAnnotation(), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSimulatorBackupStorageAction, self).__init__() self.totalCapacity = None self.availableCapacity = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteIdentityZoneInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/identity-zone/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteIdentityZoneInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeletePolicyAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/policies/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeletePolicyAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteImageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/images/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteImageAction, self).__init__() self.uuid = None self.backupStorageUuids = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryShareableVolumeVmInstanceRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volumes/vm-instances/refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryShareableVolumeVmInstanceRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPrimaryStorageFromClusterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPrimaryStorageFromClusterAction, self).__init__() self.primaryStorageUuid = None self.clusterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class IsOpensourceVersionAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/meta-data/opensource' NEED_SESSION = False NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(IsOpensourceVersionAction, self).__init__() self.systemTags = None self.userTags = None class PrometheusQueryVmMonitoringDataAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/vm-instances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'vmUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'instant': ParamAnnotation(), 'startTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'step': ParamAnnotation(), 'expression': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'relativeTime': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryVmMonitoringDataAction, self).__init__() self.vmUuids = None self.instant = None self.startTime = None self.endTime = None self.step = None self.expression = None self.relativeTime = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVpnIpsecAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/vpn-connection/ipsec' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'pfs': ParamAnnotation(required=False,valid_values=['disabled','group1','group2','group5','group14','group24'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'encAlg': ParamAnnotation(required=False,valid_values=['3des','aes-128','aes-192','aes-256','des'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'authAlg': ParamAnnotation(required=False,valid_values=['md5','sha1'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'lifetime': ParamAnnotation(required=False,number_range=[60, 86400],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVpnIpsecAction, self).__init__() self.name = None self.pfs = None self.encAlg = None self.authAlg = None self.lifetime = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVpcVpnConnectionRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/vpn-connection/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVpcVpnConnectionRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'localCidr': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'remoteCidr': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'active': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ikeConfUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipsecConfUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVpcVpnConnectionRemoteAction, self).__init__() self.uuid = None self.name = None self.localCidr = None self.remoteCidr = None self.active = None self.ikeConfUuid = None self.ipsecConfUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSftpBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/sftp' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'hostname': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'username': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSftpBackupStorageAction, self).__init__() self.hostname = None self.username = None self.password = None self.sshPort = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsSecurityGroupFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsSecurityGroupFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeSecurityGroupStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/security-groups/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeSecurityGroupState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeSecurityGroupStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateConnectionBetweenL3NetWorkAndAliyunVSwitchAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/connections/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateConnectionBetweenL3NetWorkAndAliyunVSwitch' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateConnectionBetweenL3NetWorkAndAliyunVSwitchAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmQgaAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/qga' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmQgaAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeSchedulerStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/schedulers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeSchedulerState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeSchedulerStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcVpnConnectionRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/vpn-connection/{uuid}/remote' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcVpnConnectionRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteIPsecConnectionAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/ipsec/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteIPsecConnectionAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AttachIsoToVmInstanceAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{vmInstanceUuid}/iso/{isoUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'isoUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachIsoToVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.isoUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddAliyunKeySecretAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/key' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'key': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'secret': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddAliyunKeySecretAction, self).__init__() self.name = None self.key = None self.secret = None self.accountUuid = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryGCJobAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/gc-jobs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryGCJobAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmConsolePasswordAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmConsolePassword' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'consolePassword': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmConsolePasswordAction, self).__init__() self.uuid = None self.consolePassword = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPolicyToUserAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/users/{userUuid}/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'userUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPolicyToUserAction, self).__init__() self.userUuid = None self.policyUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachPrimaryStorageToClusterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachPrimaryStorageToClusterAction, self).__init__() self.clusterUuid = None self.primaryStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetImageQgaAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/images/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setImageQga' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'enable': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetImageQgaAction, self).__init__() self.uuid = None self.enable = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateEcsInstanceVncPasswordAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs-vnc/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateEcsInstanceVncPassword' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,valid_regex_values=r'[A-Za-z0-9]{6}',max_length=6,min_length=6,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateEcsInstanceVncPasswordAction, self).__init__() self.uuid = None self.password = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2VxlanNetworkPoolAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vxlan-pool' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2VxlanNetworkPoolAction, self).__init__() self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddOssBucketFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/oss-bucket' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'bucketName': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddOssBucketFromRemoteAction, self).__init__() self.bucketName = None self.regionId = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddSimulatorHostAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hosts/simulators' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'memoryCapacity': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuCapacity': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSimulatorHostAction, self).__init__() self.memoryCapacity = None self.cpuCapacity = None self.name = None self.description = None self.managementIp = None self.clusterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVmInstanceAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVmInstanceAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteConnectionBetweenL3NetWorkAndAliyunVSwitchAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/connections/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteConnectionBetweenL3NetWorkAndAliyunVSwitchAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetL3NetworkMtuAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/{l3NetworkUuid}/mtu' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL3NetworkMtuAction, self).__init__() self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteDiskOfferingAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/disk-offerings/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteDiskOfferingAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class LogInByUserAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/users/login' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'logInByUser' PARAMS = { 'accountUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accountName': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'userName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogInByUserAction, self).__init__() self.accountUuid = None self.accountName = None self.userName = None self.password = None self.systemTags = None self.userTags = None class RecoverDataVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'recoverDataVolume' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RecoverDataVolumeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteUserAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/users/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteUserAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AttachMonitorTriggerActionToTriggerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/monitoring/triggers/{triggerUuid}/trigger-actions/{actionUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'triggerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'actionUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachMonitorTriggerActionToTriggerAction, self).__init__() self.triggerUuid = None self.actionUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryInstanceOfferingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/instance-offerings' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryInstanceOfferingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySystemTagAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/system-tags' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySystemTagAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVpcVpnConnectionFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpn-connection' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVpcVpnConnectionFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmConsoleAddressAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/console-addresses' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmConsoleAddressAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryConsoleProxyAgentAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/consoles/agents' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryConsoleProxyAgentAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSftpBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/sftp/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSftpBackupStorage' PARAMS = { 'username': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostname': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sshPort': ParamAnnotation(required=False,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSftpBackupStorageAction, self).__init__() self.username = None self.password = None self.hostname = None self.sshPort = None self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteAliyunRouteEntryRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/route-entry/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteAliyunRouteEntryRemoteAction, self).__init__() self.uuid = None self.type = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DetachBackupStorageFromZoneAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/zones/{zoneUuid}/backup-storage/{backupStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachBackupStorageFromZoneAction, self).__init__() self.backupStorageUuid = None self.zoneUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeBackupStorageStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeBackupStorageState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeBackupStorageStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateSchedulerJobAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/scheduler/jobs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateSchedulerJob' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateSchedulerJobAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class StopBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/pxeserver/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'stopBaremetalPxeServer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StopBaremetalPxeServerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QuerySecurityGroupAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/security-groups' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QuerySecurityGroupAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AttachAliyunKeyAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/key/{uuid}/attach' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'attachAliyunKey' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachAliyunKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddVmNicToLoadBalancerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/load-balancers/listeners/{listenerUuid}/vm-instances/nics' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmNicUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'listenerUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddVmNicToLoadBalancerAction, self).__init__() self.vmNicUuids = None self.listenerUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetCandidateVmForAttachingIsoAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/images/iso/{isoUuid}/vm-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'isoUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetCandidateVmForAttachingIsoAction, self).__init__() self.isoUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CleanUpImageCacheOnPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'cleanUpImageCacheOnPrimaryStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CleanUpImageCacheOnPrimaryStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachBackupStorageToZoneAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/zones/{zoneUuid}/backup-storage/{backupStorageUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachBackupStorageToZoneAction, self).__init__() self.zoneUuid = None self.backupStorageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAliyunRouteEntryFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/route-entry' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAliyunRouteEntryFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLocalStorageResourceRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/local-storage/resource-refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLocalStorageResourceRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryLabelValuesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/labels' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'labels': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryLabelValuesAction, self).__init__() self.labels = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVpcVpnConnectionFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpn-connection/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVpcVpnConnectionFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class KvmRunShellAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hosts/kvm/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'kvmRunShell' PARAMS = { 'hostUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'script': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(KvmRunShellAction, self).__init__() self.hostUuids = None self.script = None self.systemTags = None self.userTags = None self.sessionId = None class CreateDiskOfferingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/disk-offerings' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'diskSize': ParamAnnotation(required=True,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'sortKey': ParamAnnotation(), 'allocationStrategy': ParamAnnotation(), 'type': ParamAnnotation(required=False,valid_values=['zstack'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateDiskOfferingAction, self).__init__() self.name = None self.description = None self.diskSize = None self.sortKey = None self.allocationStrategy = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class PowerStatusBaremetalHostAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'powerStatusBaremetalHost' PARAMS = { 'chassisUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PowerStatusBaremetalHostAction, self).__init__() self.chassisUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CleanInvalidLdapBindingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/ldap/bindings/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'cleanInvalidLdapBinding' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CleanInvalidLdapBindingAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class CreateBaremetalChassisAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/baremetal/chassis' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiAddress': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiUsername': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiPassword': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateBaremetalChassisAction, self).__init__() self.name = None self.description = None self.ipmiAddress = None self.ipmiUsername = None self.ipmiPassword = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVmNicAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/nics' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVmNicAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVRouterRouteEntryAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vrouter-route-tables/route-entries' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVRouterRouteEntryAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteConnectionAccessPointLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/access-point/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteConnectionAccessPointLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class PrometheusQueryPassThroughAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/prometheus/all' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'instant': ParamAnnotation(), 'startTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'endTime': ParamAnnotation(required=False,number_range=[0, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'step': ParamAnnotation(), 'expression': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'relativeTime': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(PrometheusQueryPassThroughAction, self).__init__() self.instant = None self.startTime = None self.endTime = None self.step = None self.expression = None self.relativeTime = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmInstanceHaLevelAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/ha-levels' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmInstanceHaLevelAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetPrimaryStorageCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/primary-storage/capacities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetPrimaryStorageCapacityAction, self).__init__() self.zoneUuids = None self.clusterUuids = None self.primaryStorageUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class AddSharedMountPointPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/smp' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddSharedMountPointPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteDataVolumeAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/volumes/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteDataVolumeAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateIpRangeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l3-networks/ip-ranges/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateIpRange' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateIpRangeAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class ExportImageFromBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{backupStorageUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'exportImageFromBackupStorage' PARAMS = { 'backupStorageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,max_length=2048,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ExportImageFromBackupStorageAction, self).__init__() self.backupStorageUuid = None self.imageUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAccountAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAccountAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetVolumeCapabilitiesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/volumes/{uuid}/capabilities' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVolumeCapabilitiesAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL2VlanNetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/vlan' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vlan': ParamAnnotation(required=True,number_range=[1, 4094],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'physicalInterface': ParamAnnotation(required=True,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL2VlanNetworkAction, self).__init__() self.vlan = None self.name = None self.description = None self.zoneUuid = None self.physicalInterface = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRootVolumeTemplateFromRootVolumeAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images/root-volume-templates/from/volumes/{rootVolumeUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(), 'backupStorageUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'rootVolumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRootVolumeTemplateFromRootVolumeAction, self).__init__() self.name = None self.description = None self.guestOsType = None self.backupStorageUuids = None self.rootVolumeUuid = None self.platform = None self.system = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachSecurityGroupFromL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachSecurityGroupFromL3NetworkAction, self).__init__() self.securityGroupUuid = None self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVolumeSnapshotTreeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/volume-snapshots/trees' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVolumeSnapshotTreeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateUserGroupAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/groups/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateUserGroup' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateUserGroupAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteTagAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/tags/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteTagAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetIpAddressCapacityAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/ip-capacity' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'zoneUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipRangeUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'all': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetIpAddressCapacityAction, self).__init__() self.zoneUuids = None self.l3NetworkUuids = None self.ipRangeUuids = None self.all = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVolumeSizeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/volumes/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'syncVolumeSize' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVolumeSizeAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateDiskOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/disk-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateDiskOffering' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateDiskOfferingAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeMonitorTriggerStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/monitoring/triggers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeMonitorTriggerState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeMonitorTriggerStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class LocalStorageMigrateVolumeAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/local-storage/volumes/{volumeUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'localStorageMigrateVolume' PARAMS = { 'volumeUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'destHostUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(LocalStorageMigrateVolumeAction, self).__init__() self.volumeUuid = None self.destHostUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'dnsDomain': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateL3NetworkAction, self).__init__() self.name = None self.description = None self.type = None self.l2NetworkUuid = None self.system = None self.dnsDomain = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeVmPasswordAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeVmPassword' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,valid_regex_values=r'[\da-zA-Z-`=\\\[\];',./~!@#$%^&*()_+|{}:"<>?]{1,}',max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=True), 'account': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=True), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeVmPasswordAction, self).__init__() self.uuid = None self.password = None self.account = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVpcIpSecConfigFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpn-connection/ipsec' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVpcIpSecConfigFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVirtualBorderRouterFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/border-router' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVirtualBorderRouterFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLdapServerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/ldap/servers/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLdapServerAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVirtualRouterOfferingAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/instance-offerings/virtual-routers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'managementNetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'publicNetworkUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'isDefault': ParamAnnotation(), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpuNum': ParamAnnotation(required=True,number_range=[1, 1024],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'memorySize': ParamAnnotation(required=True,number_range=[1, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'allocatorStrategy': ParamAnnotation(), 'sortKey': ParamAnnotation(), 'type': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVirtualRouterOfferingAction, self).__init__() self.zoneUuid = None self.managementNetworkUuid = None self.imageUuid = None self.publicNetworkUuid = None self.isDefault = None self.name = None self.description = None self.cpuNum = None self.memorySize = None self.allocatorStrategy = None self.sortKey = None self.type = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateOssBucketRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/oss-bucket/remote' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'regionId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bucketName': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateOssBucketRemoteAction, self).__init__() self.regionId = None self.bucketName = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetNicQosAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setNicQos' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'outboundBandwidth': ParamAnnotation(required=False,number_range=[8192, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'inboundBandwidth': ParamAnnotation(required=False,number_range=[8192, 9223372036854775807],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetNicQosAction, self).__init__() self.uuid = None self.outboundBandwidth = None self.inboundBandwidth = None self.systemTags = None self.userTags = None self.sessionId = None class CheckApiPermissionAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/permissions/actions' NEED_SESSION = True NEED_POLL = False PARAM_NAME = 'checkApiPermission' PARAMS = { 'userUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'apiNames': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CheckApiPermissionAction, self).__init__() self.userUuid = None self.apiNames = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmSshKeyAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/ssh-keys' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmSshKeyAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class LogInByAccountAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/accounts/login' NEED_SESSION = False NEED_POLL = False PARAM_NAME = 'logInByAccount' PARAMS = { 'accountName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(LogInByAccountAction, self).__init__() self.accountName = None self.password = None self.systemTags = None self.userTags = None class DeleteVRouterRouteEntryAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vrouter-route-tables/{routeTableUuid}/route-entries/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'routeTableUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVRouterRouteEntryAction, self).__init__() self.uuid = None self.routeTableUuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetL3NetworkTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetL3NetworkTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class ChangeL3NetworkStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/l3-networks/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeL3NetworkState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeL3NetworkStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEmailMediaAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/media/emails' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'smtpServer': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'smtpPort': ParamAnnotation(required=True,number_range=[1, 65535],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'emailAddress': ParamAnnotation(required=True,max_length=512,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'username': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'password': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEmailMediaAction, self).__init__() self.smtpServer = None self.smtpPort = None self.emailAddress = None self.username = None self.password = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateSecurityGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateSecurityGroupAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteResourcePriceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/billings/prices/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteResourcePriceAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class GetBackupStorageTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/backup-storage/types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetBackupStorageTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class CreateIPsecConnectionAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/ipsec' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peerAddress': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'authMode': ParamAnnotation(required=False,valid_values=['psk','certs'],max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'authKey': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vipUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peerCidrs': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'ikeAuthAlgorithm': ParamAnnotation(required=False,valid_values=['md5','sha1','sha256','sha384','sha512'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ikeEncryptionAlgorithm': ParamAnnotation(required=False,valid_values=['3des','aes-128','aes-192','aes-256'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ikeDhGroup': ParamAnnotation(), 'policyAuthAlgorithm': ParamAnnotation(required=False,valid_values=['md5','sha1','sha256','sha384','sha512'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyEncryptionAlgorithm': ParamAnnotation(required=False,valid_values=['3des','aes-128','aes-192','aes-256'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'pfs': ParamAnnotation(required=False,valid_values=['dh-group2','dh-group5','dh-group14','dh-group15','dh-group16','dh-group17','dh-group18','dh-group19','dh-group20','dh-group21','dh-group22','dh-group23','dh-group24','dh-group25','dh-group26'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policyMode': ParamAnnotation(required=False,valid_values=['tunnel','transport'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'transformProtocol': ParamAnnotation(required=False,valid_values=['esp','ah','ah-esp'],max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateIPsecConnectionAction, self).__init__() self.name = None self.description = None self.l3NetworkUuid = None self.peerAddress = None self.authMode = None self.authKey = None self.vipUuid = None self.peerCidrs = None self.ikeAuthAlgorithm = None self.ikeEncryptionAlgorithm = None self.ikeDhGroup = None self.policyAuthAlgorithm = None self.policyEncryptionAlgorithm = None self.pfs = None self.policyMode = None self.transformProtocol = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreatePolicyAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/policies' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'statements': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreatePolicyAction, self).__init__() self.name = None self.description = None self.statements = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsSecurityGroupRuleRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/security-group-rule' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'direction': ParamAnnotation(required=True,valid_values=['ingress','egress'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'protocol': ParamAnnotation(required=True,valid_values=['tcp','udp','icmp','gre','all'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'portRange': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cidr': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'policy': ParamAnnotation(required=False,valid_values=['accept','drop'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'nictype': ParamAnnotation(required=False,valid_values=['intranet','internet'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'priority': ParamAnnotation(required=False,number_range=[1, 100],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=256,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsSecurityGroupRuleRemoteAction, self).__init__() self.groupUuid = None self.direction = None self.protocol = None self.portRange = None self.cidr = None self.policy = None self.nictype = None self.priority = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryHostAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryHostAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectBackupStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectBackupStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetHypervisorTypesAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hosts/hypervisor-types' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetHypervisorTypesAction, self).__init__() self.systemTags = None self.userTags = None self.sessionId = None class DeleteOssBucketFileRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/oss-bucket-file/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'bucketUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fileName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteOssBucketFileRemoteAction, self).__init__() self.bucketUuid = None self.fileName = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/baremetal/pxeserver' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpInterface': ParamAnnotation(required=True,max_length=128,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'dhcpRangeBegin': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeEnd': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeNetmask': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateBaremetalPxeServerAction, self).__init__() self.name = None self.description = None self.dhcpInterface = None self.dhcpRangeBegin = None self.dhcpRangeEnd = None self.dhcpRangeNetmask = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteSecurityGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/security-groups/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteSecurityGroupAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryConnectionAccessPointFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/access-point' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryConnectionAccessPointFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DetachIsoFromVmInstanceAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{vmInstanceUuid}/iso' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachIsoFromVmInstanceAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateSystemTagAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/system-tags' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'resourceType': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'tag': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateSystemTagAction, self).__init__() self.resourceType = None self.resourceUuid = None self.tag = None self.systemTags = None self.userTags = None self.sessionId = None class QueryL2VxlanNetworkAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vxlan' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryL2VxlanNetworkAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsInstanceFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/ecs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsInstanceFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddCephBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/ceph' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'monUrls': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'poolName': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'url': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'importImages': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddCephBackupStorageAction, self).__init__() self.monUrls = None self.poolName = None self.url = None self.name = None self.description = None self.type = None self.importImages = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddMonToCephBackupStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/backup-storage/ceph/{uuid}/mons' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'monUrls': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddMonToCephBackupStorageAction, self).__init__() self.uuid = None self.monUrls = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmHostnameAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVmHostname' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostname': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmHostnameAction, self).__init__() self.uuid = None self.hostname = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsSecurityGroupRuleFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group-rule/{uuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsSecurityGroupRuleFromRemoteAction, self).__init__() self.uuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeMonitorTriggerActionStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/monitoring/trigger-actions/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeMonitorTriggerActionState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeMonitorTriggerActionStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVpcRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vpc/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVpcRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class RebootEcsInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'rebootEcsInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RebootEcsInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsVSwitchFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vswitch/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vSwitchId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsVSwitchFromRemoteAction, self).__init__() self.dataCenterUuid = None self.vSwitchId = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryGlobalConfigAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/global-configurations' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryGlobalConfigAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class SetVmInstanceHaLevelAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances/{uuid}/ha-levels' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'level': ParamAnnotation(required=True,valid_values=['NeverStop','OnHostFailure'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVmInstanceHaLevelAction, self).__init__() self.uuid = None self.level = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsSecurityGroupFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/security-group/{ecsVpcUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'ecsVpcUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsSecurityGroupFromRemoteAction, self).__init__() self.ecsVpcUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryDataCenterFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/data-center' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryDataCenterFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLoadBalancerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/load-balancers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLoadBalancerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AttachSecurityGroupToL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/security-groups/{securityGroupUuid}/l3-networks/{l3NetworkUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'securityGroupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachSecurityGroupToL3NetworkAction, self).__init__() self.securityGroupUuid = None self.l3NetworkUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcUserVpnGatewayLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/user-gateway/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcUserVpnGatewayLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVniRangeAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l2-networks/vxlan-pool/vni-ranges/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVniRangeAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DetachPolicyFromUserGroupAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/accounts/groups/{groupUuid}/policies/{policyUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'policyUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'groupUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachPolicyFromUserGroupAction, self).__init__() self.policyUuid = None self.groupUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddConnectionAccessPointFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/access-point' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddConnectionAccessPointFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateMonitorTriggerActionAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/monitoring/trigger-actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'postScript': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'mediaUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'triggerUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateMonitorTriggerActionAction, self).__init__() self.name = None self.description = None self.postScript = None self.mediaUuids = None self.triggerUuids = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVpcVpnGatewayFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/vpc-vpn' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVpcVpnGatewayFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class GetNicQosAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/nic-qos' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetNicQosAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryUserTagAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/user-tags' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryUserTagAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ChangePrimaryStorageStateAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/primary-storage/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changePrimaryStorageState' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'stateEvent': ParamAnnotation(required=True,valid_values=['enable','disable','maintain','deleting'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangePrimaryStorageStateAction, self).__init__() self.uuid = None self.stateEvent = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteHybridEipFromLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/eip/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteHybridEipFromLocalAction, self).__init__() self.type = None self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsVSwitchFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vswitch' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsVSwitchFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVniRangeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l2-networks/vxlan-pool/vni-range' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVniRangeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLoadBalancerListenerAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/load-balancers/listeners/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLoadBalancerListenerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmStaticIpAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{vmInstanceUuid}/static-ips' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmStaticIpAction, self).__init__() self.vmInstanceUuid = None self.l3NetworkUuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteZoneAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/zones/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteZoneAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteOssBucketNameLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/oss-bucket/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteOssBucketNameLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class CreateConnectionBetweenL3NetworkAndAliyunVSwitchAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/connections' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3networkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vSwitchUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vpcRiuuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vbrRiUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vbrUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpeIp': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cpeRiId': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'direction': ParamAnnotation(required=True,valid_values=['in','out','both'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateConnectionBetweenL3NetworkAndAliyunVSwitchAction, self).__init__() self.l3networkUuid = None self.vSwitchUuid = None self.vpcRiuuid = None self.vbrRiUuid = None self.vbrUuid = None self.cpeIp = None self.cpeRiId = None self.name = None self.description = None self.direction = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRouterInterfacePairRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/router-interface' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'accessPointUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'Spec': ParamAnnotation(required=True,valid_values=['Small.1','Small.2','Small.5','Middle.1','Middle.2','Middle.5','Large.1','Large.2'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vBorderRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'aDescription': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'aName': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bDescription': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'bName': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ownerName': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRouterInterfacePairRemoteAction, self).__init__() self.dataCenterUuid = None self.accessPointUuid = None self.Spec = None self.vRouterUuid = None self.vBorderRouterUuid = None self.aDescription = None self.aName = None self.bDescription = None self.bName = None self.ownerName = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectConsoleProxyAgentAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/consoles/agents' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectConsoleProxyAgent' PARAMS = { 'agentUuids': ParamAnnotation(required=False,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectConsoleProxyAgentAction, self).__init__() self.agentUuids = None self.systemTags = None self.userTags = None self.sessionId = None class CreateEcsVpcRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/vpc' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'cidrBlock': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=256,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateEcsVpcRemoteAction, self).__init__() self.dataCenterUuid = None self.cidrBlock = None self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateAliyunVpcVirtualRouterEntryRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/aliyun/route-entry' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vRouterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dstCidrBlock': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'nextHopUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'nextHopType': ParamAnnotation(required=True,valid_values=['Instance','RouterInterface'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vRouterType': ParamAnnotation(required=True,valid_values=['vbr','vrouter'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateAliyunVpcVirtualRouterEntryRemoteAction, self).__init__() self.vRouterUuid = None self.dstCidrBlock = None self.nextHopUuid = None self.nextHopType = None self.vRouterType = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteIpRangeAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/ip-ranges/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteIpRangeAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteNicQosAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/nic-qos' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'direction': ParamAnnotation(required=True,valid_values=['in','out'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteNicQosAction, self).__init__() self.uuid = None self.direction = None self.systemTags = None self.userTags = None self.sessionId = None class ChangeInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{vmInstanceUuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'changeInstanceOffering' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ChangeInstanceOfferingAction, self).__init__() self.vmInstanceUuid = None self.instanceOfferingUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AddLocalPrimaryStorageAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/primary-storage/local-storage' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'url': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(), 'zoneUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddLocalPrimaryStorageAction, self).__init__() self.url = None self.name = None self.description = None self.type = None self.zoneUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBaremetalPxeServerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/pxeserver/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBaremetalPxeServer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeBegin': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeEnd': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dhcpRangeNetmask': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBaremetalPxeServerAction, self).__init__() self.uuid = None self.name = None self.description = None self.dhcpRangeBegin = None self.dhcpRangeEnd = None self.dhcpRangeNetmask = None self.systemTags = None self.userTags = None self.sessionId = None class QueryEcsVpcFromLocalAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/vpc' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryEcsVpcFromLocalAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class AddIdentityZoneFromRemoteAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/hybrid/identity-zone' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=1024,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddIdentityZoneFromRemoteAction, self).__init__() self.dataCenterUuid = None self.zoneId = None self.type = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryDiskOfferingAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/disk-offerings' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryDiskOfferingAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class CreateVmInstanceAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/vm-instances' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'instanceOfferingUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'imageUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'l3NetworkUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['UserVm','ApplianceVm'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'rootDiskOfferingUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataDiskOfferingUuids': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'zoneUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'hostUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'primaryStorageUuidForRootVolume': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'defaultL3NetworkUuid': ParamAnnotation(), 'strategy': ParamAnnotation(required=False,valid_values=['InstantStart','JustCreate'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateVmInstanceAction, self).__init__() self.name = None self.instanceOfferingUuid = None self.imageUuid = None self.l3NetworkUuids = None self.type = None self.rootDiskOfferingUuid = None self.dataDiskOfferingUuids = None self.zoneUuid = None self.clusterUuid = None self.hostUuid = None self.primaryStorageUuidForRootVolume = None self.description = None self.defaultL3NetworkUuid = None self.strategy = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteBackupStorageAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/backup-storage/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteBackupStorageAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteEcsVpcInLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/vpc/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsVpcInLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateLoadBalancerListenerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/load-balancers/listeners/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateLoadBalancerListener' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateLoadBalancerListenerAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class StopVmInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vm-instances/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'stopVmInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'type': ParamAnnotation(required=False,valid_values=['grace','cold'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StopVmInstanceAction, self).__init__() self.uuid = None self.type = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcIpSecConfigLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/vpn-connection/ipsec/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcIpSecConfigLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteMonitorTriggerActionAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/monitoring/trigger-actions/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteMonitorTriggerActionAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class AddDnsToL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/dns' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dns': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AddDnsToL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.dns = None self.systemTags = None self.userTags = None self.sessionId = None class GetOssBucketFileFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/oss/file/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetOssBucketFileFromRemoteAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVpcUserVpnGatewayRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/user-gateway/{uuid}/remote' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVpcUserVpnGatewayRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class ValidateSessionAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/accounts/sessions/{sessionUuid}/valid' NEED_SESSION = False NEED_POLL = False PARAM_NAME = '' PARAMS = { 'sessionUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(ValidateSessionAction, self).__init__() self.sessionUuid = None self.systemTags = None self.userTags = None class AttachL2NetworkToClusterAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l2-networks/{l2NetworkUuid}/clusters/{clusterUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'null' PARAMS = { 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachL2NetworkToClusterAction, self).__init__() self.l2NetworkUuid = None self.clusterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SetVipQosAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'setVipQos' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'outboundBandwidth': ParamAnnotation(required=False,number_range=[8192, 34359738367],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'inboundBandwidth': ParamAnnotation(required=False,number_range=[8192, 34359738367],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SetVipQosAction, self).__init__() self.uuid = None self.outboundBandwidth = None self.inboundBandwidth = None self.systemTags = None self.userTags = None self.sessionId = None class CreateRootVolumeTemplateFromVolumeSnapshotAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/images/root-volume-templates/from/volume-snapshots/{snapshotUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'snapshotUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'guestOsType': ParamAnnotation(), 'backupStorageUuids': ParamAnnotation(required=True,non_empty=True,null_elements=False,empty_string=True,no_trim=False), 'platform': ParamAnnotation(required=False,valid_values=['Linux','Windows','Other','Paravirtualization','WindowsVirtio'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'system': ParamAnnotation(), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateRootVolumeTemplateFromVolumeSnapshotAction, self).__init__() self.snapshotUuid = None self.name = None self.description = None self.guestOsType = None self.backupStorageUuids = None self.platform = None self.system = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateBaremetalChassisAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/baremetal/chassis/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateBaremetalChassis' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=False,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiAddress': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiUsername': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'ipmiPassword': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'provisioned': ParamAnnotation(required=False,valid_values=['true','false'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateBaremetalChassisAction, self).__init__() self.uuid = None self.name = None self.description = None self.ipmiAddress = None self.ipmiUsername = None self.ipmiPassword = None self.provisioned = None self.systemTags = None self.userTags = None self.sessionId = None class RefreshLoadBalancerAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/load-balancers/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'refreshLoadBalancer' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RefreshLoadBalancerAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryIpRangeAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/l3-networks/ip-ranges' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryIpRangeAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteVmInstanceHaLevelAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/vm-instances/{uuid}/ha-levels' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteVmInstanceHaLevelAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class DetachL2NetworkFromClusterAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l2-networks/{l2NetworkUuid}/clusters/{clusterUuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'l2NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'clusterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DetachL2NetworkFromClusterAction, self).__init__() self.l2NetworkUuid = None self.clusterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateMonitorTriggerAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/monitoring/triggers' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'expression': ParamAnnotation(required=True,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'duration': ParamAnnotation(required=True,number_range=[1, 2147483647],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'recoveryExpression': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'targetResourceUuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateMonitorTriggerAction, self).__init__() self.name = None self.expression = None self.duration = None self.recoveryExpression = None self.description = None self.targetResourceUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteGCJobAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/gc-jobs/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteGCJobAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateUserGroupAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/accounts/groups' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateUserGroupAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmAttachableL3NetworkAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/l3-networks-candidates' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmAttachableL3NetworkAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetIdentityZoneFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/identity-zone/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'regionId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetIdentityZoneFromRemoteAction, self).__init__() self.type = None self.dataCenterUuid = None self.regionId = None self.systemTags = None self.userTags = None self.sessionId = None class QueryLdapServerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/ldap/servers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryLdapServerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateInstanceOfferingAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/instance-offerings/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateInstanceOffering' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateInstanceOfferingAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateZoneAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/zones/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateZone' PARAMS = { 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateZoneAction, self).__init__() self.name = None self.description = None self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class CreateZoneAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/zones' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'name': ParamAnnotation(required=True,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(CreateZoneAction, self).__init__() self.name = None self.description = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteLdapBindingAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/ldap/bindings/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,max_length=32,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteLdapBindingAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class StartEcsInstanceAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/ecs/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'startEcsInstance' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(StartEcsInstanceAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetConnectionAccessPointFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/access-point{dataCenterUuid}/remote' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetConnectionAccessPointFromRemoteAction, self).__init__() self.dataCenterUuid = None self.systemTags = None self.userTags = None self.sessionId = None class AttachNetworkServiceToL3NetworkAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/l3-networks/{l3NetworkUuid}/network-services' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'l3NetworkUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'networkServices': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(AttachNetworkServiceToL3NetworkAction, self).__init__() self.l3NetworkUuid = None self.networkServices = None self.systemTags = None self.userTags = None self.sessionId = None class SyncVirtualBorderRouterFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/border-router/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncVirtualBorderRouterFromRemoteAction, self).__init__() self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmMigrationCandidateHostsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{vmInstanceUuid}/migration-target-hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmMigrationCandidateHostsAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class GetVmStartingCandidateClustersHostsAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/vm-instances/{uuid}/starting-target-hosts' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(GetVmStartingCandidateClustersHostsAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryVCenterClusterAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/vcenters/clusters' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryVCenterClusterAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class ReconnectImageStoreBackupStorageAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/backup-storage/image-store/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'reconnectImageStoreBackupStorage' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(ReconnectImageStoreBackupStorageAction, self).__init__() self.uuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryMonitorTriggerAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/monitoring/triggers' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryMonitorTriggerAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteRouterInterfaceLocalAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/router-interface/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteRouterInterfaceLocalAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVirtualBorderRouterRemoteAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/hybrid/aliyun/border-router/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVirtualBorderRouterRemote' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'localGatewayIp': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peerGatewayIp': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'peeringSubnetMask': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=64,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=128,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'vlanId': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'circuitCode': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVirtualBorderRouterRemoteAction, self).__init__() self.uuid = None self.localGatewayIp = None self.peerGatewayIp = None self.peeringSubnetMask = None self.name = None self.description = None self.vlanId = None self.circuitCode = None self.systemTags = None self.userTags = None self.sessionId = None class DeleteL3NetworkAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/l3-networks/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteL3NetworkAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class RequestConsoleAccessAction(AbstractAction): HTTP_METHOD = 'POST' PATH = '/consoles' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'params' PARAMS = { 'vmInstanceUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(RequestConsoleAccessAction, self).__init__() self.vmInstanceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class QueryAccountResourceRefAction(QueryAction): HTTP_METHOD = 'GET' PATH = '/accounts/resources/refs' NEED_SESSION = True NEED_POLL = False PARAM_NAME = '' PARAMS = { 'conditions': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'limit': ParamAnnotation(), 'start': ParamAnnotation(), 'count': ParamAnnotation(), 'groupBy': ParamAnnotation(), 'replyWithCount': ParamAnnotation(), 'sortBy': ParamAnnotation(), 'sortDirection': ParamAnnotation(required=False,valid_values=['asc','desc'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'fields': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(QueryAccountResourceRefAction, self).__init__() self.conditions = None self.limit = None self.start = None self.count = None self.groupBy = None self.replyWithCount = None self.sortBy = None self.sortDirection = None self.fields = None self.systemTags = None self.userTags = None self.sessionId = None class UpdateVipAction(AbstractAction): HTTP_METHOD = 'PUT' PATH = '/vips/{uuid}/actions' NEED_SESSION = True NEED_POLL = True PARAM_NAME = 'updateVip' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'name': ParamAnnotation(required=False,max_length=255,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'description': ParamAnnotation(required=False,max_length=2048,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(UpdateVipAction, self).__init__() self.uuid = None self.name = None self.description = None self.systemTags = None self.userTags = None self.sessionId = None class GetLicenseInfoAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/licenses' NEED_SESSION = False NEED_POLL = False PARAM_NAME = '' PARAMS = { 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation() } def __init__(self): super(GetLicenseInfoAction, self).__init__() self.systemTags = None self.userTags = None class DeleteEcsSecurityGroupRemoteAction(AbstractAction): HTTP_METHOD = 'DELETE' PATH = '/hybrid/aliyun/security-group/remote/{uuid}' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'uuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'deleteMode': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(DeleteEcsSecurityGroupRemoteAction, self).__init__() self.uuid = None self.deleteMode = None self.systemTags = None self.userTags = None self.sessionId = None class SyncHybridEipFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/eip/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'type': ParamAnnotation(required=True,valid_values=['aliyun'],non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncHybridEipFromRemoteAction, self).__init__() self.type = None self.dataCenterUuid = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None class SyncEcsInstanceFromRemoteAction(AbstractAction): HTTP_METHOD = 'GET' PATH = '/hybrid/aliyun/ecs/{dataCenterUuid}/sync' NEED_SESSION = True NEED_POLL = True PARAM_NAME = '' PARAMS = { 'dataCenterUuid': ParamAnnotation(required=True,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'onlyZstack': ParamAnnotation(required=False,non_empty=False,null_elements=False,empty_string=True,no_trim=False), 'resourceUuid': ParamAnnotation(), 'systemTags': ParamAnnotation(), 'userTags': ParamAnnotation(), 'sessionId': ParamAnnotation(required=True) } def __init__(self): super(SyncEcsInstanceFromRemoteAction, self).__init__() self.dataCenterUuid = None self.onlyZstack = None self.resourceUuid = None self.systemTags = None self.userTags = None self.sessionId = None
35.973713
337
0.672065
102,153
1,022,265
6.504185
0.015555
0.07252
0.0983
0.076752
0.976545
0.974321
0.971614
0.969778
0.967174
0.964355
0
0.004629
0.215801
1,022,265
28,416
338
35.974979
0.82418
0
0
0.927174
0
0.000041
0.103283
0.026112
0
0
0
0
0
0
null
null
0.005877
0.001356
null
null
0.000164
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
7ffbdc9aacabfff54f751a7506513583200686a7
127
py
Python
pyramda/relation/max_test.py
sergiors/pyramda
5bf200888809b1bc946e813e29460f204bccd13e
[ "MIT" ]
124
2015-07-30T21:34:25.000Z
2022-02-19T08:45:50.000Z
pyramda/relation/max_test.py
sergiors/pyramda
5bf200888809b1bc946e813e29460f204bccd13e
[ "MIT" ]
37
2015-08-31T23:02:20.000Z
2022-02-04T04:45:28.000Z
pyramda/relation/max_test.py
sergiors/pyramda
5bf200888809b1bc946e813e29460f204bccd13e
[ "MIT" ]
20
2015-08-04T18:59:09.000Z
2021-12-13T08:08:59.000Z
from .max import max from pyramda.private.asserts import assert_equal def max_test(): assert_equal(max([1, 3, 4, 2]), 4)
18.142857
48
0.708661
22
127
3.954545
0.636364
0.252874
0
0
0
0
0
0
0
0
0
0.04717
0.165354
127
6
49
21.166667
0.773585
0
0
0
0
0
0
0
0
0
0
0
0.5
1
0.25
true
0
0.5
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
1
0
1
0
1
0
0
8
7ffc5466dff501e97279718d2851b62116b92aa9
15,080
py
Python
CSCI560/Energy_Disaggregation/Event_Detection.py
bridget-haus/Energy_Disaggregation
5cf5a9277bda471c3c4e3b897a7d2fc32a782da3
[ "MIT" ]
null
null
null
CSCI560/Energy_Disaggregation/Event_Detection.py
bridget-haus/Energy_Disaggregation
5cf5a9277bda471c3c4e3b897a7d2fc32a782da3
[ "MIT" ]
null
null
null
CSCI560/Energy_Disaggregation/Event_Detection.py
bridget-haus/Energy_Disaggregation
5cf5a9277bda471c3c4e3b897a7d2fc32a782da3
[ "MIT" ]
1
2021-03-16T23:45:04.000Z
2021-03-16T23:45:04.000Z
import numpy as np import pandas as pd import datetime import matplotlib.pyplot as plt import datetime from cycler import cycler import itertools import time import math import warnings warnings.filterwarnings("ignore") import glob from preprocess import * import random import pickle from sklearn import svm from sklearn.metrics import recall_score from sklearn.metrics import precision_score from sklearn.metrics import accuracy_score def generate_training_labels(W, full_df, string_type, skew, plot=False): prev_value = {} num_one_labels = 0 num_houses = len(full_df) all_windows = {} for i in range(1, num_houses + 1): df = full_df[i] columns = [col for col in df.columns if 'main' not in col] #[col for col in df.columns if string_type in col] df_apps = df[columns] df["mains"] = df["1_mains"] + df["2_mains"] columns = ['mains'] windows = {} window_list = {} window_start = {} prev_diff = {} prev_diff[string_type] = 0 prev_diff['rest'] = 0 plot_list = {} plot_list['rest'] = {} plot_list[string_type] = {} for col in columns: window_list[col] = [] prev_value[col] = df[:1][col].values[0] window_start[col] = df[:1][col].index.strftime("%Y-%m-%d %H:%M:%S")[0] windows[col] = {} prev_diff[col] = 0 df_mains = df[columns] row_one = True for (mains, apps) in zip(df_mains.iterrows(), df_apps.iterrows()): index = mains[0] main_row = mains[1] app_row = apps[1] if row_one: row_one = False prev_app_row = app_row for ind, value in main_row.items(): diff = value - prev_value[ind] str_window_start = str(window_start[ind]) str_index = str(index) date_window_start = datetime.datetime.strptime(str_window_start, '%Y-%m-%d %H:%M:%S') date_index = datetime.datetime.strptime(str_index, '%Y-%m-%d %H:%M:%S') # for item, prev_item in zip(app_row.iteritems(), prev_app_row.iteritems()): # appliance = item[0] # val = abs(item[1] - prev_item[1]) # if val > W: # max_val = val # if string_type in appliance: # label = 1 # else: # label = 0 if abs(diff) > W: max_val = W - 1 label = 0 row_diffs = app_row - prev_app_row row_diffs = row_diffs.abs() row_diff_sum = row_diffs.sum() high_val = max(abs(diff), row_diff_sum) for item, prev_item in zip(app_row.iteritems(), prev_app_row.iteritems()): appliance = item[0] val = abs(item[1] - prev_item[1]) if val > max_val: max_val = val if string_type in appliance and abs(val / high_val) > 0.3: label = 1 else: label = 0 x = random.randint(0,skew) window_list_val = window_list[ind] if plot: if label == 1: prev_diff[string_type] = abs(diff) prev_diff[string_type] = 0 #plot_list[string_type][date_window_start] = abs(diff) plot_list[string_type][date_index] = diff #abs(diff) #plot_list['rest'][date_window_start] = 0 plot_list['rest'][date_index] = 0 else: prev_diff[string_type] = 0 prev_diff['rest'] = abs(diff) #plot_list[string_type][date_window_start] = 0 plot_list[string_type][date_index] = 0 #plot_list['rest'][date_window_start] = abs(diff) plot_list['rest'][date_index] = diff #abs(diff) if x == 1 or label == 1: windows[ind][str_window_start] = {'end': str_index} windows[ind][str_window_start]["diff"] = prev_diff[ind] time_diff = date_index - date_window_start diff_seconds = time_diff.total_seconds() windows[ind][str_window_start]["duration"] = diff_seconds hour = int(str_window_start.split(" ")[1].split(":")[0]) if hour < 9 or hour > 17: night_day = 0 else: night_day = 1 level = abs(diff) / value windows[ind][str_window_start]["hour"] = night_day windows[ind][str_window_start]["level"] = level windows[ind][str_window_start]['label'] = label windows[ind][str_window_start]["max"] = max(window_list_val) windows[ind][str_window_start]["min"] = min(window_list_val) windows[ind][str_window_start]["avg"] = sum(window_list_val) / len(window_list_val) num_one_labels += label prev_diff[ind] = diff window_start[ind] = index window_list[ind] = [] else: #plot_list[string_type][date_window_start] = 0 #prev_diff[string_type] plot_list[string_type][date_index] = prev_diff[string_type] #plot_list['rest'][date_window_start] = 0 #prev_diff['rest'] plot_list['rest'][date_index] = prev_diff['rest'] prev_value[ind] = value window_list[ind].append(value) prev_app_row = app_row all_windows[i] = windows if plot: new_df = pd.DataFrame(data=plot_list) df_mains.plot(); plt.legend(loc='best') plt.title("Main Energy Usage") new_df.plot(); plt.legend(loc='best') plt.ylim(-250, 250) plt.title("Energy Window Classifications") return all_windows def generate_training_labels_cnn(W, full_df, string_type, skew, plot=False): prev_value = {} num_one_labels = 0 num_houses = len(full_df) all_windows = {} for i in range(1, num_houses + 1): df = full_df[i] columns = [col for col in df.columns if 'main' not in col] #[col for col in df.columns if string_type in col] df_apps = df[columns] df["mains"] = df["1_mains"] + df["2_mains"] columns = ['mains'] windows = {} window_list = {} window_start = {} prev_diff = {} prev_diff[string_type] = 0 prev_diff['rest'] = 0 plot_list = {} plot_list['rest'] = {} plot_list[string_type] = {} for col in columns: window_list[col] = [] prev_value[col] = df[:1][col].values[0] window_start[col] = df[:1][col].index.strftime("%Y-%m-%d %H:%M:%S")[0] windows[col] = {} prev_diff[col] = 0 df_mains = df[columns] row_one = True for (mains, apps) in zip(df_mains.iterrows(), df_apps.iterrows()): index = mains[0] main_row = mains[1] app_row = apps[1] if row_one: row_one = False prev_app_row = app_row for ind, value in main_row.items(): diff = value - prev_value[ind] str_window_start = str(window_start[ind]) str_index = str(index) date_window_start = datetime.datetime.strptime(str_window_start, '%Y-%m-%d %H:%M:%S') date_index = datetime.datetime.strptime(str_index, '%Y-%m-%d %H:%M:%S') # for item, prev_item in zip(app_row.iteritems(), prev_app_row.iteritems()): # appliance = item[0] # val = abs(item[1] - prev_item[1]) # if val > W: # max_val = val # if string_type in appliance: # label = 1 # else: # label = 0 if abs(diff) > W: max_val = W - 1 label = 0 row_diffs = app_row - prev_app_row row_diffs = row_diffs.abs() row_diff_sum = row_diffs.sum() high_val = max(abs(diff), row_diff_sum) for item, prev_item in zip(app_row.iteritems(), prev_app_row.iteritems()): appliance = item[0] val = abs(item[1] - prev_item[1]) if val > max_val: max_val = val if string_type in appliance and abs(val / high_val) > 0.3: label = 1 else: label = 0 x = random.randint(0, skew) window_list_val = window_list[ind] if plot: if label == 1: prev_diff[string_type] = abs(diff) prev_diff[string_type] = 0 #plot_list[string_type][date_window_start] = abs(diff) plot_list[string_type][date_index] = diff #abs(diff) #plot_list['rest'][date_window_start] = 0 plot_list['rest'][date_index] = 0 else: prev_diff[string_type] = 0 prev_diff['rest'] = abs(diff) #plot_list[string_type][date_window_start] = 0 plot_list[string_type][date_index] = 0 #plot_list['rest'][date_window_start] = abs(diff) plot_list['rest'][date_index] = diff #abs(diff) if x == 1 or label == 1: windows[ind][str_window_start] = {'end': str_index} windows[ind][str_window_start]["diff"] = prev_diff[ind] time_diff = date_index - date_window_start diff_seconds = time_diff.total_seconds() windows[ind][str_window_start]["duration"] = diff_seconds hour = int(str_window_start.split(" ")[1].split(":")[0]) if hour < 9 or hour > 17: night_day = 0 else: night_day = 1 level = abs(diff) / value windows[ind][str_window_start]["hour"] = night_day windows[ind][str_window_start]["level"] = level windows[ind][str_window_start]['label'] = label windows[ind][str_window_start]["max"] = max(window_list_val) windows[ind][str_window_start]["min"] = min(window_list_val) windows[ind][str_window_start]["avg"] = sum(window_list_val) / len(window_list_val) num_one_labels += label prev_diff[ind] = diff window_start[ind] = index window_list[ind] = [] else: #plot_list[string_type][date_window_start] = 0 #prev_diff[string_type] plot_list[string_type][date_index] = prev_diff[string_type] #plot_list['rest'][date_window_start] = 0 #prev_diff['rest'] plot_list['rest'][date_index] = prev_diff['rest'] prev_value[ind] = value window_list[ind].append(value) prev_app_row = app_row all_windows[i] = windows if plot: new_df = pd.DataFrame(data=plot_list) df_mains.plot(); plt.legend(loc='best') plt.title("Main Energy Usage") new_df.plot(); plt.legend(loc='best') plt.ylim(-250, 250) plt.title("Energy Window Classifications") return all_windows def create_feature_vector(windows,timestamps=None) : X = [] Y = [] num_houses = len(windows) for house_dict in windows.values(): for type, dics in house_dict.items(): for k, lower_dic in dics.items(): diff_val = abs(lower_dic['diff']) label = lower_dic['label'] if not diff_val == 0: Y.append(label) X.append([abs(lower_dic['diff']), lower_dic['hour'], lower_dic['level']]) #, lower_dic['max'], lower_dic['min'], lower_dic['avg']]) lower_dic['duration'], return X, Y def create_svm(feature_vector): pass def main(): #H1 # 10: 0.55 , 20: 0.60 , 30: 0.59 #H2 # 20: 0.12 , 30: 0.14 W = 15 Noise = 15 start = time.time() #df = get_preproccess_data() df_train = read_pre_proc('train') df_test = read_pre_proc('test') # main_windows = generate_training_labels(W, df_train, 'wash', 25) #, plot=True) # # f = open(f"windows_${W}.pkl", "wb") # pickle.dump(main_windows, f) # f.close() with open(f'pkl_files/windows.pkl', 'rb') as handle: main_windows = pickle.load(handle) # test_main_windows = generate_training_labels(W, df_test, 'wash', 25) # # f = open(f"test_windows_${W}.pkl", "wb") # pickle.dump(test_main_windows, f) # f.close() with open(f'test_windows_${W}.pkl', 'rb') as handle: test_main_windows = pickle.load(handle) X, Y = create_feature_vector(main_windows) clf = svm.SVC() clf.fit(X, Y) X_Test, Y_true = create_feature_vector(main_windows) Y_pred = clf.predict(X_Test) recall = recall_score(Y_true, Y_pred) precision = precision_score(Y_true, Y_pred) accuracy = accuracy_score(Y_true, Y_pred) print(f"Recall: {recall}") print(f"Precision: {precision}") print(f"Accuracy: {accuracy}") # filename = 'finalized_model.sav' # pickle.dump(clf, open(filename, 'wb')) end = time.time() print("Time: ", end - start) plt.show() print("Done") #H1 # Recall: 0.75 # Precision: 0.5454545454545454 # Accuracy: 0.6111111111111112 # Time: 189.97088646888733 #TODO #We need to cherry pick 7 days of data from houses 1-4 that we like and are good if __name__ == "__main__" : main()
34.907407
174
0.496021
1,770
15,080
3.964972
0.116949
0.075235
0.051867
0.048447
0.812625
0.781704
0.77173
0.77173
0.752636
0.752636
0
0.022108
0.394098
15,080
432
175
34.907407
0.745978
0.134019
0
0.778182
0
0
0.043174
0.003232
0
0
0
0.002315
0
1
0.018182
false
0.003636
0.065455
0
0.094545
0.018182
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3d059df91fca100bb5d72e26ba4b4ff64b0f677f
76
py
Python
src/gamenight/app/blueprints/_helpers.py
justanr/gamenight
968dad4b60179c6a2dbdc5006835eda7dc17640d
[ "MIT" ]
3
2018-04-24T07:54:48.000Z
2021-05-15T02:55:11.000Z
src/gamenight/app/blueprints/_helpers.py
justanr/gamenight
968dad4b60179c6a2dbdc5006835eda7dc17640d
[ "MIT" ]
11
2018-04-25T02:30:00.000Z
2018-05-08T01:03:33.000Z
src/gamenight/app/blueprints/_helpers.py
justanr/gamenight
968dad4b60179c6a2dbdc5006835eda7dc17640d
[ "MIT" ]
null
null
null
from flask import Blueprint class GamenightBlueprint(Blueprint): pass
12.666667
36
0.789474
8
76
7.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0.171053
76
5
37
15.2
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0.666667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
1
0
7
18671cba219e442fe471db1be8aa2835e7ee4c61
97
py
Python
qian_dev/basic/__init__.py
QianWanghhu/factor_fixing
68a8b13e8ad1c335a490857b25b3fa850abb4e3a
[ "MIT" ]
null
null
null
qian_dev/basic/__init__.py
QianWanghhu/factor_fixing
68a8b13e8ad1c335a490857b25b3fa850abb4e3a
[ "MIT" ]
null
null
null
qian_dev/basic/__init__.py
QianWanghhu/factor_fixing
68a8b13e8ad1c335a490857b25b3fa850abb4e3a
[ "MIT" ]
null
null
null
# from .boots_pya import * from .group_fix import * from .utils import * from .boots_pya import *
24.25
26
0.742268
15
97
4.6
0.466667
0.434783
0.347826
0.521739
0
0
0
0
0
0
0
0
0.164948
97
4
27
24.25
0.851852
0.247423
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
188028f9e72ece7e378403d1fc24ed273ef1588f
936
py
Python
aliexpress/top/api/rest/__init__.py
sumenkov/python-aliexpress-api
e03944ec7d36b69468e091ab2edd141e1751217a
[ "MIT" ]
1
2021-08-17T14:43:11.000Z
2021-08-17T14:43:11.000Z
aliexpress/top/api/rest/__init__.py
sumenkov/python-aliexpress-api
e03944ec7d36b69468e091ab2edd141e1751217a
[ "MIT" ]
null
null
null
aliexpress/top/api/rest/__init__.py
sumenkov/python-aliexpress-api
e03944ec7d36b69468e091ab2edd141e1751217a
[ "MIT" ]
null
null
null
from aliexpress.top.api.rest.AliexpressAffiliateFeaturedpromoGetRequest import AliexpressAffiliateFeaturedpromoGetRequest from aliexpress.top.api.rest.AliexpressAffiliateOrderGetRequest import AliexpressAffiliateOrderGetRequest from aliexpress.top.api.rest.AliexpressAffiliateProductQueryRequest import AliexpressAffiliateProductQueryRequest from aliexpress.top.api.rest.AliexpressAffiliateFeaturedpromoProductsGetRequest import AliexpressAffiliateFeaturedpromoProductsGetRequest from aliexpress.top.api.rest.AliexpressAffiliateOrderListRequest import AliexpressAffiliateOrderListRequest from aliexpress.top.api.rest.AliexpressAffiliateProductdetailGetRequest import AliexpressAffiliateProductdetailGetRequest from aliexpress.top.api.rest.AliexpressAffiliateLinkGenerateRequest import AliexpressAffiliateLinkGenerateRequest from aliexpress.top.api.rest.AliexpressAffiliateCategoryGetRequest import AliexpressAffiliateCategoryGetRequest
104
137
0.931624
64
936
13.625
0.21875
0.12844
0.155963
0.183486
0.220183
0
0
0
0
0
0
0
0.034188
936
8
138
117
0.964602
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
1
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
43fae14308e6a057faaa2e8ee0a03119a6060a98
18,422
py
Python
data_utils/ShapeNetDataLoader.py
matheusgadelha/PointCloudLearningACD
ba3348bf3b2aedcf6ee31a1053fb53302cab5a2c
[ "MIT" ]
29
2020-04-08T03:30:32.000Z
2022-02-16T11:48:40.000Z
data_utils/ShapeNetDataLoader.py
matheusgadelha/PointCloudLearningACD
ba3348bf3b2aedcf6ee31a1053fb53302cab5a2c
[ "MIT" ]
4
2020-07-27T11:01:51.000Z
2020-12-12T21:05:19.000Z
data_utils/ShapeNetDataLoader.py
matheusgadelha/PointCloudLearningACD
ba3348bf3b2aedcf6ee31a1053fb53302cab5a2c
[ "MIT" ]
2
2021-06-18T02:43:31.000Z
2021-08-02T03:15:12.000Z
# *_*coding:utf-8 *_* import os import os.path as osp import json import warnings import numpy as np import random import math from torch.utils.data import Dataset warnings.filterwarnings('ignore') DEBUG = True def pc_normalize(pc): centroid = np.mean(pc, axis=0) pc = pc - centroid m = np.max(np.sqrt(np.sum(pc ** 2, axis=1))) pc = pc / m return pc class PartNormalDataset(Dataset): def __init__(self,root = './data/shapenetcore_partanno_segmentation_benchmark_v0_normal', npoints=2500, split='train', class_choice=None, normal_channel=False, k_shot=-1): self.npoints = npoints self.root = root self.catfile = os.path.join(self.root, 'synsetoffset2category.txt') self.cat = {} self.normal_channel = normal_channel self.k_shot = k_shot with open(self.catfile, 'r') as f: for line in f: ls = line.strip().split() self.cat[ls[0]] = ls[1] self.cat = {k: v for k, v in self.cat.items()} self.classes_original = dict(zip(self.cat, range(len(self.cat)))) if not class_choice is None: self.cat = {k:v for k,v in self.cat.items() if k in class_choice} # print(self.cat) self.meta = {} with open(os.path.join(self.root, 'train_test_split', 'shuffled_train_file_list.json'), 'r') as f: train_ids = set([str(d.split('/')[2]) for d in json.load(f)]) with open(os.path.join(self.root, 'train_test_split', 'shuffled_val_file_list.json'), 'r') as f: val_ids = set([str(d.split('/')[2]) for d in json.load(f)]) with open(os.path.join(self.root, 'train_test_split', 'shuffled_test_file_list.json'), 'r') as f: test_ids = set([str(d.split('/')[2]) for d in json.load(f)]) for item in self.cat: # print('category', item) self.meta[item] = [] dir_point = os.path.join(self.root, self.cat[item]) fns = sorted(os.listdir(dir_point)) # print(fns[0][0:-4]) if split == 'trainval': fns = [fn for fn in fns if ((fn[0:-4] in train_ids) or (fn[0:-4] in val_ids))] elif split == 'train': fns = [fn for fn in fns if fn[0:-4] in train_ids] elif split == 'val': fns = [fn for fn in fns if fn[0:-4] in val_ids] elif split == 'test': fns = [fn for fn in fns if fn[0:-4] in test_ids] else: print('Unknown split: %s. Exiting..' % (split)) exit(-1) if self.k_shot > 0 and len(fns) > self.k_shot: fns = random.sample(fns, self.k_shot) # random few-shot samples pass # print(os.path.basename(fns)) for fn in fns: token = (os.path.splitext(os.path.basename(fn))[0]) self.meta[item].append(os.path.join(dir_point, token + '.txt')) self.datapath = [] for item in self.cat: for fn in self.meta[item]: self.datapath.append((item, fn)) self.classes = {} for i in self.cat.keys(): self.classes[i] = self.classes_original[i] # Mapping from category ('Chair') to a list of int [10,11,12,13] as segmentation labels self.seg_classes = {'Earphone': [16, 17, 18], 'Motorbike': [30, 31, 32, 33, 34, 35], 'Rocket': [41, 42, 43], 'Car': [8, 9, 10, 11], 'Laptop': [28, 29], 'Cap': [6, 7], 'Skateboard': [44, 45, 46], 'Mug': [36, 37], 'Guitar': [19, 20, 21], 'Bag': [4, 5], 'Lamp': [24, 25, 26, 27], 'Table': [47, 48, 49], 'Airplane': [0, 1, 2, 3], 'Pistol': [38, 39, 40], 'Chair': [12, 13, 14, 15], 'Knife': [22, 23]} # for cat in sorted(self.seg_classes.keys()): # print(cat, self.seg_classes[cat]) self.cache = {} # from index to (point_set, cls, seg) tuple self.cache_size = 20000 def __getitem__(self, index): if index in self.cache: ppoint_set, cls, seg = self.cache[index] else: fn = self.datapath[index] cat = self.datapath[index][0] cls = self.classes[cat] cls = np.array([cls]).astype(np.int32) data = np.loadtxt(fn[1]).astype(np.float32) if not self.normal_channel: point_set = data[:, 0:3] else: point_set = data[:, 0:6] seg = data[:, -1].astype(np.int32) if len(self.cache) < self.cache_size: self.cache[index] = (point_set, cls, seg) point_set[:, 0:3] = pc_normalize(point_set[:, 0:3]) choice = np.random.choice(len(seg), self.npoints, replace=True) # resample point_set = point_set[choice, :] seg = seg[choice] return point_set, cls, seg def __len__(self): return len(self.datapath) class SelfSupPartNormalDataset(Dataset): def __init__(self, root = './data/shapenetcore_partanno_segmentation_benchmark_v0_normal', npoints=2500, split='train', class_choice=None, normal_channel=False, k_shot=-1, labeled_fns=None): self.npoints = npoints self.root = root self.catfile = os.path.join(self.root, 'synsetoffset2category.txt') self.cat = {} self.normal_channel = normal_channel self.k_shot = k_shot self.labeled_files = set([osp.basename(x) for x in labeled_fns]) # assert len(labeled_fns) == self.k_shot with open(self.catfile, 'r') as f: for line in f: ls = line.strip().split() self.cat[ls[0]] = ls[1] self.cat = {k: v for k, v in self.cat.items()} self.classes_original = dict(zip(self.cat, range(len(self.cat)))) if not class_choice is None: self.cat = {k:v for k,v in self.cat.items() if k in class_choice} # print(self.cat) self.meta = {} with open(os.path.join(self.root, 'train_test_split', 'shuffled_train_file_list.json'), 'r') as f: train_ids = set([str(d.split('/')[2]) for d in json.load(f)]) with open(os.path.join(self.root, 'train_test_split', 'shuffled_val_file_list.json'), 'r') as f: val_ids = set([str(d.split('/')[2]) for d in json.load(f)]) with open(os.path.join(self.root, 'train_test_split', 'shuffled_test_file_list.json'), 'r') as f: test_ids = set([str(d.split('/')[2]) for d in json.load(f)]) for item in self.cat: # print('category', item) self.meta[item] = [] dir_point = os.path.join(self.root, self.cat[item]) fns = os.listdir(dir_point) fns = sorted(list(set(fns) - set(self.labeled_files))) # remove files used as labeled data # print(fns[0][0:-4]) if split == 'trainval': fns = [fn for fn in fns if ((fn[0:-4] in train_ids) or (fn[0:-4] in val_ids))] elif split == 'train': fns = [fn for fn in fns if fn[0:-4] in train_ids] elif split == 'val': fns = [fn for fn in fns if fn[0:-4] in val_ids] elif split == 'test': fns = [fn for fn in fns if fn[0:-4] in test_ids] else: print('Unknown split: %s. Exiting..' % (split)) exit(-1) if self.k_shot > 0: print('Subsampling self-supervised dataset.') fns = random.sample(fns, self.k_shot) # print(os.path.basename(fns)) for fn in fns: token = (os.path.splitext(os.path.basename(fn))[0]) self.meta[item].append(os.path.join(dir_point, token + '.txt')) self.datapath = [] for item in self.cat: for fn in self.meta[item]: self.datapath.append((item, fn)) self.classes = {} for i in self.cat.keys(): self.classes[i] = self.classes_original[i] # Mapping from category ('Chair') to a list of int [10,11,12,13] as segmentation labels self.seg_classes = {'Earphone': [16, 17, 18], 'Motorbike': [30, 31, 32, 33, 34, 35], 'Rocket': [41, 42, 43], 'Car': [8, 9, 10, 11], 'Laptop': [28, 29], 'Cap': [6, 7], 'Skateboard': [44, 45, 46], 'Mug': [36, 37], 'Guitar': [19, 20, 21], 'Bag': [4, 5], 'Lamp': [24, 25, 26, 27], 'Table': [47, 48, 49], 'Airplane': [0, 1, 2, 3], 'Pistol': [38, 39, 40], 'Chair': [12, 13, 14, 15], 'Knife': [22, 23]} # for cat in sorted(self.seg_classes.keys()): # print(cat, self.seg_classes[cat]) self.cache = {} # from index to (point_set, cls, seg) tuple self.cache_size = 20000 def __getitem__(self, index): if index in self.cache: ppoint_set, cls, seg = self.cache[index] else: fn = self.datapath[index] cat = self.datapath[index][0] cls = self.classes[cat] cls = np.array([cls]).astype(np.int32) data = np.loadtxt(fn[1]).astype(np.float32) if not self.normal_channel: point_set = data[:, 0:3] else: point_set = data[:, 0:6] seg = data[:, -1].astype(np.int32) if len(self.cache) < self.cache_size: self.cache[index] = (point_set, cls, seg) point_set[:, 0:3] = pc_normalize(point_set[:, 0:3]) choice = np.random.choice(len(seg), self.npoints, replace=True) # resample point_set = point_set[choice, :] seg = seg[choice] return point_set, cls, seg def __len__(self): return len(self.datapath) class ACDSelfSupDataset(Dataset): def __init__(self, root = '/srv/data2/mgadelha/ShapeNetACD/', npoints=2500, class_choice=None, normal_channel=False, k_shot=-1, exclude_fns=[], splits=None, use_val=False): ''' Expected self-supervised dataset folder structure: ROOT |--- <sub-folder-1> | | -- af55f398af2373aa18b14db3b83de9ff.npy | | -- ff77ea82fb4a5f92da9afa637af35064.npy | ... | |--- <sub-folder-2> ... The "subfolders" loosely correspond to "object categories", but can be arbitrary. The code works with a single subfolder. However, it does not work if there are no subfolders at all under the ROOT path. ''' self.npoints = npoints self.root = root self.normal_channel = normal_channel self.k_shot = k_shot self.meta = {} subfolders = os.listdir(root) self.classes_original = dict(zip(subfolders, range(len(subfolders)))) self.cat = self.classes_original self.use_val = use_val if len(exclude_fns) > 0: self.exclude_fns = [osp.basename(x) for x in exclude_fns] else: self.exclude_fns = [] # self.classes = self.classes_original for item in self.cat: # print('category', item) self.meta[item] = [] dir_point = os.path.join(self.root, item) fns = [f for f in os.listdir(dir_point) if f.endswith('.npy')] num_all_fns = len(fns) if len(self.exclude_fns) > 0: # print('Removing overlaps with excluded files list . . .') fns = sorted(list(set([osp.splitext(osp.basename(f))[0] for f in fns]) - set(osp.splitext(osp.basename(f))[0] for f in self.exclude_fns))) # print('Removed %d overlapping samples' % (num_all_fns - len(fns))) NUM_SAMPLES = len(fns) # support for specifying a random subset of the self-sup data if self.k_shot > 0: print('Subsampling self-supervised dataset (%d samples).' % args.k_shot) fns = random.sample(fns, self.k_shot) if self.use_val: # we fix 80/20 train/val splits per category fns = random.sample(fns, math.floor(NUM_SAMPLES * 0.8)) for fn in fns: token = (osp.splitext(osp.basename(fn))[0]) self.meta[item].append(osp.join(dir_point, token + '.npy')) # NOTE: .npy files self.datapath = [] for item in self.cat.keys(): for fn in self.meta[item]: self.datapath.append((item, fn)) self.classes = {} for i in self.cat.keys(): self.classes[i] = self.classes_original[i] # for cat in sorted(self.seg_classes.keys()): # print(cat, self.seg_classes[cat]) self.cache = {} # from index to (point_set, cls, seg) tuple self.cache_size = 20000 def __getitem__(self, index): if index in self.cache: ppoint_set, cls, seg = self.cache[index] else: fn = self.datapath[index] cat = self.datapath[index][0] cls = self.classes[cat] cls = np.array([cls]).astype(np.int32) data = np.load(fn[1]).astype(np.float32) if not self.normal_channel: point_set = data[:, 0:3] else: point_set = data[:, 0:6] # TODO: make sure the extra cols with normals exist seg = data[:, -1].astype(np.int32) if len(self.cache) < self.cache_size: self.cache[index] = (point_set, cls, seg) point_set[:, 0:3] = pc_normalize(point_set[:, 0:3]) choice = np.random.choice(len(seg), self.npoints, replace=True) point_set = point_set[choice, :] # resample seg = seg[choice] return point_set, cls, seg def __len__(self): return len(self.datapath) class MultiACDSelfSupDataset(Dataset): def __init__(self, root = '/srv/data2/mgadelha/ShapeNetACD/', npoints=2500, class_choice=None, normal_channel=False, k_shot=-1, exclude_fns=[], splits=None, use_val=False): ''' Expected self-supervised dataset folder structure: ROOT |--- <sub-folder-1> | | -- af55f398af2373aa18b14db3b83de9ff.npy | | -- ff77ea82fb4a5f92da9afa637af35064.npy | ... | |--- <sub-folder-2> ... The "subfolders" loosely correspond to "object categories", but can be arbitrary. The code works with a single subfolder. However, it does not work if there are no subfolders at all under the ROOT path. ''' self.npoints = npoints self.root = root self.normal_channel = normal_channel self.k_shot = k_shot self.meta = {} subfolders = os.listdir(root) self.classes_original = dict(zip(subfolders, range(len(subfolders)))) self.cat = self.classes_original self.use_val = use_val if len(exclude_fns) > 0: self.exclude_fns = [osp.basename(x) for x in exclude_fns] else: self.exclude_fns = [] # self.classes = self.classes_original for item in self.cat: # print('category', item) self.meta[item] = [] dir_point = os.path.join(self.root, item) fns = [f for f in os.listdir(dir_point) if f.endswith('.npy')] num_all_fns = len(fns) if len(self.exclude_fns) > 0: # print('Removing overlaps with excluded files list . . .') fns = sorted(list(set([osp.splitext(osp.basename(f))[0] for f in fns]) - set(osp.splitext(osp.basename(f))[0] for f in self.exclude_fns))) # print('Removed %d overlapping samples' % (num_all_fns - len(fns))) NUM_SAMPLES = len(fns) # support for specifying a random subset of the self-sup data if self.k_shot > 0: print('Subsampling self-supervised dataset (%d samples).' % args.k_shot) fns = random.sample(fns, self.k_shot) if self.use_val: # we fix 80/20 train/val splits per category fns = random.sample(fns, math.floor(NUM_SAMPLES * 0.8)) for fn in fns: token = (osp.splitext(osp.basename(fn))[0]) self.meta[item].append(osp.join(dir_point, token + '.npy')) # NOTE: .npy files self.datapath = [] for item in self.cat.keys(): for fn in self.meta[item]: self.datapath.append((item, fn)) self.classes = {} for i in self.cat.keys(): self.classes[i] = self.classes_original[i] # for cat in sorted(self.seg_classes.keys()): # print(cat, self.seg_classes[cat]) self.cache = {} # from index to (point_set, cls, seg) tuple self.cache_size = 20000 def __getitem__(self, index): if index in self.cache: ppoint_set, cls, seg = self.cache[index] else: fn = self.datapath[index] cat = self.datapath[index][0] cls = self.classes[cat] cls = np.array([cls]).astype(np.int32) data = np.load(fn[1]).astype(np.float32) if not self.normal_channel: point_set = data[:, 0:3] else: point_set = data[:, 0:6] # TODO: make sure the extra cols with normals exist seg = data[:, -1].astype(np.int32) if len(self.cache) < self.cache_size: self.cache[index] = (point_set, cls, seg) point_set[:, 0:3] = pc_normalize(point_set[:, 0:3]) choice = np.random.choice(len(seg), self.npoints, replace=True) point_set = point_set[choice, :] # resample seg = seg[choice] return point_set, cls, seg def __len__(self): return len(self.datapath)
39.279318
116
0.531593
2,410
18,422
3.947303
0.116598
0.030274
0.015137
0.01766
0.94313
0.94313
0.941238
0.9384
0.9384
0.935036
0
0.036859
0.334329
18,422
468
117
39.363248
0.738889
0.143578
0
0.904762
0
0
0.062561
0.026218
0
0
0
0.004274
0
1
0.04127
false
0.003175
0.025397
0.012698
0.107937
0.015873
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
a1485f3905625cb579d95ae4465ca22fe777314f
21,885
py
Python
ppdet/modeling/heads/simota_head.py
codedlong/PaddleDetection_tmp
016b59ef19f0c376076d0e2d66b06df575db3964
[ "Apache-2.0" ]
3
2022-03-23T08:48:06.000Z
2022-03-28T01:59:34.000Z
ppdet/modeling/heads/simota_head.py
Lymtics-5205/PaddleDetection
3fca7404d0a253545c4f8e8e2c4d69ff1016a42e
[ "Apache-2.0" ]
null
null
null
ppdet/modeling/heads/simota_head.py
Lymtics-5205/PaddleDetection
3fca7404d0a253545c4f8e8e2c4d69ff1016a42e
[ "Apache-2.0" ]
1
2021-08-09T14:53:28.000Z
2021-08-09T14:53:28.000Z
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # The code is based on: # https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/dense_heads/yolox_head.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import math from functools import partial import numpy as np import paddle import paddle.nn as nn import paddle.nn.functional as F from paddle import ParamAttr from paddle.nn.initializer import Normal, Constant from ppdet.core.workspace import register from ppdet.modeling.bbox_utils import distance2bbox, bbox2distance from ppdet.data.transform.atss_assigner import bbox_overlaps from .gfl_head import GFLHead @register class OTAHead(GFLHead): """ OTAHead Args: conv_feat (object): Instance of 'FCOSFeat' num_classes (int): Number of classes fpn_stride (list): The stride of each FPN Layer prior_prob (float): Used to set the bias init for the class prediction layer loss_qfl (object): Instance of QualityFocalLoss. loss_dfl (object): Instance of DistributionFocalLoss. loss_bbox (object): Instance of bbox loss. assigner (object): Instance of label assigner. reg_max: Max value of integral set :math: `{0, ..., reg_max}` n QFL setting. Default: 16. """ __inject__ = [ 'conv_feat', 'dgqp_module', 'loss_class', 'loss_dfl', 'loss_bbox', 'assigner', 'nms' ] __shared__ = ['num_classes'] def __init__(self, conv_feat='FCOSFeat', dgqp_module=None, num_classes=80, fpn_stride=[8, 16, 32, 64, 128], prior_prob=0.01, loss_class='QualityFocalLoss', loss_dfl='DistributionFocalLoss', loss_bbox='GIoULoss', assigner='SimOTAAssigner', reg_max=16, feat_in_chan=256, nms=None, nms_pre=1000, cell_offset=0): super(OTAHead, self).__init__( conv_feat=conv_feat, dgqp_module=dgqp_module, num_classes=num_classes, fpn_stride=fpn_stride, prior_prob=prior_prob, loss_class=loss_class, loss_dfl=loss_dfl, loss_bbox=loss_bbox, reg_max=reg_max, feat_in_chan=feat_in_chan, nms=nms, nms_pre=nms_pre, cell_offset=cell_offset) self.conv_feat = conv_feat self.dgqp_module = dgqp_module self.num_classes = num_classes self.fpn_stride = fpn_stride self.prior_prob = prior_prob self.loss_qfl = loss_class self.loss_dfl = loss_dfl self.loss_bbox = loss_bbox self.reg_max = reg_max self.feat_in_chan = feat_in_chan self.nms = nms self.nms_pre = nms_pre self.cell_offset = cell_offset self.use_sigmoid = self.loss_qfl.use_sigmoid self.assigner = assigner def _get_target_single(self, flatten_cls_pred, flatten_center_and_stride, flatten_bbox, gt_bboxes, gt_labels): """Compute targets for priors in a single image. """ pos_num, label, label_weight, bbox_target = self.assigner( F.sigmoid(flatten_cls_pred), flatten_center_and_stride, flatten_bbox, gt_bboxes, gt_labels) return (pos_num, label, label_weight, bbox_target) def get_loss(self, head_outs, gt_meta): cls_scores, bbox_preds = head_outs num_level_anchors = [ featmap.shape[-2] * featmap.shape[-1] for featmap in cls_scores ] num_imgs = gt_meta['im_id'].shape[0] featmap_sizes = [[featmap.shape[-2], featmap.shape[-1]] for featmap in cls_scores] decode_bbox_preds = [] center_and_strides = [] for featmap_size, stride, bbox_pred in zip(featmap_sizes, self.fpn_stride, bbox_preds): # center in origin image yy, xx = self.get_single_level_center_point(featmap_size, stride, self.cell_offset) center_and_stride = paddle.stack([xx, yy, stride, stride], -1).tile( [num_imgs, 1, 1]) center_and_strides.append(center_and_stride) center_in_feature = center_and_stride.reshape( [-1, 4])[:, :-2] / stride bbox_pred = bbox_pred.transpose([0, 2, 3, 1]).reshape( [num_imgs, -1, 4 * (self.reg_max + 1)]) pred_distances = self.distribution_project(bbox_pred) decode_bbox_pred_wo_stride = distance2bbox( center_in_feature, pred_distances).reshape([num_imgs, -1, 4]) decode_bbox_preds.append(decode_bbox_pred_wo_stride * stride) flatten_cls_preds = [ cls_pred.transpose([0, 2, 3, 1]).reshape( [num_imgs, -1, self.cls_out_channels]) for cls_pred in cls_scores ] flatten_cls_preds = paddle.concat(flatten_cls_preds, axis=1) flatten_bboxes = paddle.concat(decode_bbox_preds, axis=1) flatten_center_and_strides = paddle.concat(center_and_strides, axis=1) gt_boxes, gt_labels = gt_meta['gt_bbox'], gt_meta['gt_class'] pos_num_l, label_l, label_weight_l, bbox_target_l = [], [], [], [] for flatten_cls_pred,flatten_center_and_stride,flatten_bbox,gt_box, gt_label \ in zip(flatten_cls_preds.detach(),flatten_center_and_strides.detach(), \ flatten_bboxes.detach(),gt_boxes, gt_labels): pos_num, label, label_weight, bbox_target = self._get_target_single( flatten_cls_pred, flatten_center_and_stride, flatten_bbox, gt_box, gt_label) pos_num_l.append(pos_num) label_l.append(label) label_weight_l.append(label_weight) bbox_target_l.append(bbox_target) labels = paddle.to_tensor(np.stack(label_l, axis=0)) label_weights = paddle.to_tensor(np.stack(label_weight_l, axis=0)) bbox_targets = paddle.to_tensor(np.stack(bbox_target_l, axis=0)) center_and_strides_list = self._images_to_levels( flatten_center_and_strides, num_level_anchors) labels_list = self._images_to_levels(labels, num_level_anchors) label_weights_list = self._images_to_levels(label_weights, num_level_anchors) bbox_targets_list = self._images_to_levels(bbox_targets, num_level_anchors) num_total_pos = sum(pos_num_l) try: num_total_pos = paddle.distributed.all_reduce(num_total_pos.clone( )) / paddle.distributed.get_world_size() except: num_total_pos = max(num_total_pos, 1) loss_bbox_list, loss_dfl_list, loss_qfl_list, avg_factor = [], [], [], [] for cls_score, bbox_pred, center_and_strides, labels, label_weights, bbox_targets, stride in zip( cls_scores, bbox_preds, center_and_strides_list, labels_list, label_weights_list, bbox_targets_list, self.fpn_stride): center_and_strides = center_and_strides.reshape([-1, 4]) cls_score = cls_score.transpose([0, 2, 3, 1]).reshape( [-1, self.cls_out_channels]) bbox_pred = bbox_pred.transpose([0, 2, 3, 1]).reshape( [-1, 4 * (self.reg_max + 1)]) bbox_targets = bbox_targets.reshape([-1, 4]) labels = labels.reshape([-1]) label_weights = label_weights.reshape([-1]) bg_class_ind = self.num_classes pos_inds = paddle.nonzero( paddle.logical_and((labels >= 0), (labels < bg_class_ind)), as_tuple=False).squeeze(1) score = np.zeros(labels.shape) if len(pos_inds) > 0: pos_bbox_targets = paddle.gather(bbox_targets, pos_inds, axis=0) pos_bbox_pred = paddle.gather(bbox_pred, pos_inds, axis=0) pos_centers = paddle.gather( center_and_strides[:, :-2], pos_inds, axis=0) / stride weight_targets = F.sigmoid(cls_score.detach()) weight_targets = paddle.gather( weight_targets.max(axis=1, keepdim=True), pos_inds, axis=0) pos_bbox_pred_corners = self.distribution_project(pos_bbox_pred) pos_decode_bbox_pred = distance2bbox(pos_centers, pos_bbox_pred_corners) pos_decode_bbox_targets = pos_bbox_targets / stride bbox_iou = bbox_overlaps( pos_decode_bbox_pred.detach().numpy(), pos_decode_bbox_targets.detach().numpy(), is_aligned=True) score[pos_inds.numpy()] = bbox_iou pred_corners = pos_bbox_pred.reshape([-1, self.reg_max + 1]) target_corners = bbox2distance(pos_centers, pos_decode_bbox_targets, self.reg_max).reshape([-1]) # regression loss loss_bbox = paddle.sum( self.loss_bbox(pos_decode_bbox_pred, pos_decode_bbox_targets) * weight_targets) # dfl loss loss_dfl = self.loss_dfl( pred_corners, target_corners, weight=weight_targets.expand([-1, 4]).reshape([-1]), avg_factor=4.0) else: loss_bbox = bbox_pred.sum() * 0 loss_dfl = bbox_pred.sum() * 0 weight_targets = paddle.to_tensor([0], dtype='float32') # qfl loss score = paddle.to_tensor(score) loss_qfl = self.loss_qfl( cls_score, (labels, score), weight=label_weights, avg_factor=num_total_pos) loss_bbox_list.append(loss_bbox) loss_dfl_list.append(loss_dfl) loss_qfl_list.append(loss_qfl) avg_factor.append(weight_targets.sum()) avg_factor = sum(avg_factor) try: avg_factor = paddle.distributed.all_reduce(avg_factor.clone()) avg_factor = paddle.clip( avg_factor / paddle.distributed.get_world_size(), min=1) except: avg_factor = max(avg_factor.item(), 1) if avg_factor <= 0: loss_qfl = paddle.to_tensor(0, dtype='float32', stop_gradient=False) loss_bbox = paddle.to_tensor( 0, dtype='float32', stop_gradient=False) loss_dfl = paddle.to_tensor(0, dtype='float32', stop_gradient=False) else: losses_bbox = list(map(lambda x: x / avg_factor, loss_bbox_list)) losses_dfl = list(map(lambda x: x / avg_factor, loss_dfl_list)) loss_qfl = sum(loss_qfl_list) loss_bbox = sum(losses_bbox) loss_dfl = sum(losses_dfl) loss_states = dict( loss_qfl=loss_qfl, loss_bbox=loss_bbox, loss_dfl=loss_dfl) return loss_states @register class OTAVFLHead(OTAHead): __inject__ = [ 'conv_feat', 'dgqp_module', 'loss_class', 'loss_dfl', 'loss_bbox', 'assigner', 'nms' ] __shared__ = ['num_classes'] def __init__(self, conv_feat='FCOSFeat', dgqp_module=None, num_classes=80, fpn_stride=[8, 16, 32, 64, 128], prior_prob=0.01, loss_class='VarifocalLoss', loss_dfl='DistributionFocalLoss', loss_bbox='GIoULoss', assigner='SimOTAAssigner', reg_max=16, feat_in_chan=256, nms=None, nms_pre=1000, cell_offset=0): super(OTAVFLHead, self).__init__( conv_feat=conv_feat, dgqp_module=dgqp_module, num_classes=num_classes, fpn_stride=fpn_stride, prior_prob=prior_prob, loss_class=loss_class, loss_dfl=loss_dfl, loss_bbox=loss_bbox, reg_max=reg_max, feat_in_chan=feat_in_chan, nms=nms, nms_pre=nms_pre, cell_offset=cell_offset) self.conv_feat = conv_feat self.dgqp_module = dgqp_module self.num_classes = num_classes self.fpn_stride = fpn_stride self.prior_prob = prior_prob self.loss_vfl = loss_class self.loss_dfl = loss_dfl self.loss_bbox = loss_bbox self.reg_max = reg_max self.feat_in_chan = feat_in_chan self.nms = nms self.nms_pre = nms_pre self.cell_offset = cell_offset self.use_sigmoid = self.loss_vfl.use_sigmoid self.assigner = assigner def get_loss(self, head_outs, gt_meta): cls_scores, bbox_preds = head_outs num_level_anchors = [ featmap.shape[-2] * featmap.shape[-1] for featmap in cls_scores ] num_imgs = gt_meta['im_id'].shape[0] featmap_sizes = [[featmap.shape[-2], featmap.shape[-1]] for featmap in cls_scores] decode_bbox_preds = [] center_and_strides = [] for featmap_size, stride, bbox_pred in zip(featmap_sizes, self.fpn_stride, bbox_preds): # center in origin image yy, xx = self.get_single_level_center_point(featmap_size, stride, self.cell_offset) strides = paddle.full((len(xx), ), stride) center_and_stride = paddle.stack([xx, yy, strides, strides], -1).tile([num_imgs, 1, 1]) center_and_strides.append(center_and_stride) center_in_feature = center_and_stride.reshape( [-1, 4])[:, :-2] / stride bbox_pred = bbox_pred.transpose([0, 2, 3, 1]).reshape( [num_imgs, -1, 4 * (self.reg_max + 1)]) pred_distances = self.distribution_project(bbox_pred) decode_bbox_pred_wo_stride = distance2bbox( center_in_feature, pred_distances).reshape([num_imgs, -1, 4]) decode_bbox_preds.append(decode_bbox_pred_wo_stride * stride) flatten_cls_preds = [ cls_pred.transpose([0, 2, 3, 1]).reshape( [num_imgs, -1, self.cls_out_channels]) for cls_pred in cls_scores ] flatten_cls_preds = paddle.concat(flatten_cls_preds, axis=1) flatten_bboxes = paddle.concat(decode_bbox_preds, axis=1) flatten_center_and_strides = paddle.concat(center_and_strides, axis=1) gt_boxes, gt_labels = gt_meta['gt_bbox'], gt_meta['gt_class'] pos_num_l, label_l, label_weight_l, bbox_target_l = [], [], [], [] for flatten_cls_pred, flatten_center_and_stride, flatten_bbox,gt_box,gt_label \ in zip(flatten_cls_preds.detach(), flatten_center_and_strides.detach(), \ flatten_bboxes.detach(),gt_boxes,gt_labels): pos_num, label, label_weight, bbox_target = self._get_target_single( flatten_cls_pred, flatten_center_and_stride, flatten_bbox, gt_box, gt_label) pos_num_l.append(pos_num) label_l.append(label) label_weight_l.append(label_weight) bbox_target_l.append(bbox_target) labels = paddle.to_tensor(np.stack(label_l, axis=0)) label_weights = paddle.to_tensor(np.stack(label_weight_l, axis=0)) bbox_targets = paddle.to_tensor(np.stack(bbox_target_l, axis=0)) center_and_strides_list = self._images_to_levels( flatten_center_and_strides, num_level_anchors) labels_list = self._images_to_levels(labels, num_level_anchors) label_weights_list = self._images_to_levels(label_weights, num_level_anchors) bbox_targets_list = self._images_to_levels(bbox_targets, num_level_anchors) num_total_pos = sum(pos_num_l) try: num_total_pos = paddle.distributed.all_reduce(num_total_pos.clone( )) / paddle.distributed.get_world_size() except: num_total_pos = max(num_total_pos, 1) loss_bbox_list, loss_dfl_list, loss_vfl_list, avg_factor = [], [], [], [] for cls_score, bbox_pred, center_and_strides, labels, label_weights, bbox_targets, stride in zip( cls_scores, bbox_preds, center_and_strides_list, labels_list, label_weights_list, bbox_targets_list, self.fpn_stride): center_and_strides = center_and_strides.reshape([-1, 4]) cls_score = cls_score.transpose([0, 2, 3, 1]).reshape( [-1, self.cls_out_channels]) bbox_pred = bbox_pred.transpose([0, 2, 3, 1]).reshape( [-1, 4 * (self.reg_max + 1)]) bbox_targets = bbox_targets.reshape([-1, 4]) labels = labels.reshape([-1]) bg_class_ind = self.num_classes pos_inds = paddle.nonzero( paddle.logical_and((labels >= 0), (labels < bg_class_ind)), as_tuple=False).squeeze(1) # vfl vfl_score = np.zeros(cls_score.shape) if len(pos_inds) > 0: pos_bbox_targets = paddle.gather(bbox_targets, pos_inds, axis=0) pos_bbox_pred = paddle.gather(bbox_pred, pos_inds, axis=0) pos_centers = paddle.gather( center_and_strides[:, :-2], pos_inds, axis=0) / stride weight_targets = F.sigmoid(cls_score.detach()) weight_targets = paddle.gather( weight_targets.max(axis=1, keepdim=True), pos_inds, axis=0) pos_bbox_pred_corners = self.distribution_project(pos_bbox_pred) pos_decode_bbox_pred = distance2bbox(pos_centers, pos_bbox_pred_corners) pos_decode_bbox_targets = pos_bbox_targets / stride bbox_iou = bbox_overlaps( pos_decode_bbox_pred.detach().numpy(), pos_decode_bbox_targets.detach().numpy(), is_aligned=True) # vfl pos_labels = paddle.gather(labels, pos_inds, axis=0) vfl_score[pos_inds.numpy(), pos_labels] = bbox_iou pred_corners = pos_bbox_pred.reshape([-1, self.reg_max + 1]) target_corners = bbox2distance(pos_centers, pos_decode_bbox_targets, self.reg_max).reshape([-1]) # regression loss loss_bbox = paddle.sum( self.loss_bbox(pos_decode_bbox_pred, pos_decode_bbox_targets) * weight_targets) # dfl loss loss_dfl = self.loss_dfl( pred_corners, target_corners, weight=weight_targets.expand([-1, 4]).reshape([-1]), avg_factor=4.0) else: loss_bbox = bbox_pred.sum() * 0 loss_dfl = bbox_pred.sum() * 0 weight_targets = paddle.to_tensor([0], dtype='float32') # vfl loss num_pos_avg_per_gpu = num_total_pos vfl_score = paddle.to_tensor(vfl_score) loss_vfl = self.loss_vfl( cls_score, vfl_score, avg_factor=num_pos_avg_per_gpu) loss_bbox_list.append(loss_bbox) loss_dfl_list.append(loss_dfl) loss_vfl_list.append(loss_vfl) avg_factor.append(weight_targets.sum()) avg_factor = sum(avg_factor) try: avg_factor = paddle.distributed.all_reduce(avg_factor.clone()) avg_factor = paddle.clip( avg_factor / paddle.distributed.get_world_size(), min=1) except: avg_factor = max(avg_factor.item(), 1) if avg_factor <= 0: loss_vfl = paddle.to_tensor(0, dtype='float32', stop_gradient=False) loss_bbox = paddle.to_tensor( 0, dtype='float32', stop_gradient=False) loss_dfl = paddle.to_tensor(0, dtype='float32', stop_gradient=False) else: losses_bbox = list(map(lambda x: x / avg_factor, loss_bbox_list)) losses_dfl = list(map(lambda x: x / avg_factor, loss_dfl_list)) loss_vfl = sum(loss_vfl_list) loss_bbox = sum(losses_bbox) loss_dfl = sum(losses_dfl) loss_states = dict( loss_vfl=loss_vfl, loss_bbox=loss_bbox, loss_dfl=loss_dfl) return loss_states
43.857715
105
0.586475
2,671
21,885
4.42793
0.110071
0.027057
0.032468
0.009132
0.826921
0.82337
0.82337
0.810011
0.806967
0.806967
0
0.016049
0.325246
21,885
498
106
43.945783
0.784858
0.065159
0
0.834568
0
0
0.017919
0.002062
0
0
0
0
0
1
0.012346
false
0
0.037037
0
0.071605
0.002469
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
a1fc74720ade7c49bc0d5ff8a98f49c7e45e0c19
17,085
py
Python
ehpi_action_recognition/paper_reproduction_code/trainings/ehpi/train_ehpi_itsc_2019_ofp.py
steuwe/ehpi_action_recognition
4318e82e541c9b42bf0af7976815229ed6261c39
[ "MIT" ]
100
2019-04-16T17:18:02.000Z
2022-02-23T08:59:51.000Z
ehpi_action_recognition/paper_reproduction_code/trainings/ehpi/train_ehpi_itsc_2019_ofp.py
steuwe/ehpi_action_recognition
4318e82e541c9b42bf0af7976815229ed6261c39
[ "MIT" ]
15
2019-06-14T13:30:12.000Z
2022-02-17T12:16:07.000Z
ehpi_action_recognition/paper_reproduction_code/trainings/ehpi/train_ehpi_itsc_2019_ofp.py
steuwe/ehpi_action_recognition
4318e82e541c9b42bf0af7976815229ed6261c39
[ "MIT" ]
21
2019-05-08T03:29:12.000Z
2022-03-05T05:51:00.000Z
import os import random from typing import List import numpy as np import torch from nobos_commons.data_structures.constants.dataset_part import DatasetPart from nobos_commons.data_structures.dimension import ImageSize from nobos_torch_lib.configs.training_configs.training_config_base import TrainingConfigBase from nobos_torch_lib.datasets.action_recognition_datasets.ehpi_dataset import EhpiDataset, RemoveJointsOutsideImgEhpi, \ ScaleEhpi, TranslateEhpi, FlipEhpi, NormalizeEhpi, RemoveJointsEhpi from nobos_torch_lib.datasets.samplers.imbalanced_dataset_sampler import ImbalancedDatasetSampler from nobos_torch_lib.learning_rate_schedulers.learning_rate_scheduler_stepwise import \ LearningRateSchedulerStepwise from nobos_torch_lib.models.detection_models.shufflenet_v2 import ShuffleNetV2 from torch.utils.data import ConcatDataset, DataLoader from torchvision.transforms import transforms from ehpi_action_recognition.config import ehpi_dataset_path, models_dir from ehpi_action_recognition.trainer_ehpi import TrainerEhpi foot_indexes: List[int] = [11, 14] knee_indexes: List[int] = [10, 13] def get_sim_pose_algo_only(dataset_path: str, image_size: ImageSize): num_joints = 15 left_indexes: List[int] = [3, 4, 5, 9, 10, 11] right_indexes: List[int] = [6, 7, 8, 12, 13, 14] datasets: List[EhpiDataset] = [ EhpiDataset(os.path.join(dataset_path, "ofp_sim_pose_algo_equal_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_from_mocap_pose_algo_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), ] for dataset in datasets: dataset.print_label_statistics() return ConcatDataset(datasets) def get_sim_gt_only(dataset_path: str, image_size: ImageSize): num_joints = 15 left_indexes: List[int] = [3, 4, 5, 9, 10, 11] right_indexes: List[int] = [6, 7, 8, 12, 13, 14] datasets: List[EhpiDataset] = [ EhpiDataset(os.path.join(dataset_path, "ofp_sim_gt_equal_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_from_mocap_gt_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), ] for dataset in datasets: dataset.print_label_statistics() return ConcatDataset(datasets) def get_sim(image_size: ImageSize): num_joints = 15 left_indexes: List[int] = [3, 4, 5, 9, 10, 11] right_indexes: List[int] = [6, 7, 8, 12, 13, 14] datasets: List[EhpiDataset] = [ EhpiDataset("/media/disks/beta/datasets/ehpi/ofp_sim_pose_algo_equal_30fps", transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset("/media/disks/beta/datasets/ehpi/ofp_from_mocap_pose_algo_30fps", transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset("/media/disks/beta/datasets/ehpi/ofp_sim_gt_equal_30fps", transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset("/media/disks/beta/datasets/ehpi/ofp_from_mocap_gt_30fps", transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints) ] for dataset in datasets: dataset.print_label_statistics() return ConcatDataset(datasets) def get_full(dataset_path: str, image_size: ImageSize): num_joints = 15 left_indexes: List[int] = [3, 4, 5, 9, 10, 11] right_indexes: List[int] = [6, 7, 8, 12, 13, 14] datasets: List[EhpiDataset] = [ # Real EhpiDataset(os.path.join(dataset_path, "ofp_webcam"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_record_2019_03_11_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_record_2019_03_11_HSRT_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints, dataset_part=DatasetPart.TEST), EhpiDataset(os.path.join(dataset_path, "ofp_record_2019_03_11_HELLA_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints, dataset_part=DatasetPart.TRAIN), # Freilichtmuseum EhpiDataset(os.path.join(dataset_path, "2019_03_13_Freilichtmuseum_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints, dataset_part=DatasetPart.TRAIN), # Simulated EhpiDataset(os.path.join(dataset_path, "ofp_from_mocap_30fps/"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_sim_pose_algo_equal_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_sim_gt_equal_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_from_mocap_gt_30fps"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), RemoveJointsEhpi(indexes_to_remove=foot_indexes, indexes_to_remove_2=knee_indexes, probability=0.25), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), ] for dataset in datasets: dataset.print_label_statistics() return ConcatDataset(datasets) def get_set_wo_sim(dataset_path: str, image_size: ImageSize): num_joints = 15 left_indexes: List[int] = [3, 4, 5, 9, 10, 11] right_indexes: List[int] = [6, 7, 8, 12, 13, 14] datasets: List[EhpiDataset] = [ EhpiDataset(os.path.join(dataset_path, "ofp_webcam"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_record_2019_03_11_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints), EhpiDataset(os.path.join(dataset_path, "ofp_record_2019_03_11_HSRT_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints, dataset_part=DatasetPart.TEST), EhpiDataset(os.path.join(dataset_path, "ofp_record_2019_03_11_HELLA_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints, dataset_part=DatasetPart.TRAIN), # Freilichtmuseum EhpiDataset(os.path.join(dataset_path, "2019_03_13_Freilichtmuseum_30FPS"), transform=transforms.Compose([ RemoveJointsOutsideImgEhpi(image_size), ScaleEhpi(image_size), TranslateEhpi(image_size), FlipEhpi(left_indexes=left_indexes, right_indexes=right_indexes), NormalizeEhpi(image_size) ]), num_joints=num_joints, dataset_part=DatasetPart.TRAIN), ] for dataset in datasets: dataset.print_label_statistics() return ConcatDataset(datasets) def set_seed(seed): random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) np.random.seed(0) if __name__ == '__main__': batch_size = 128 seeds = [0, 104, 123, 142, 200] datasets = { "sim_pose_algo_only": get_sim_pose_algo_only, "sim_gt_only": get_sim_gt_only, "wo_sim": get_set_wo_sim, "sim": get_sim, "full": get_full } for seed in seeds: use_case_dataset_path = os.path.join(ehpi_dataset_path, "use_case") for dataset_name, get_dataset in datasets.items(): # Train set set_seed(seed) train_set = get_dataset(use_case_dataset_path, image_size=ImageSize(1280, 720)) sampler = ImbalancedDatasetSampler(train_set, dataset_type=EhpiDataset) train_loader = DataLoader(train_set, batch_size=batch_size, sampler=sampler, num_workers=8) # config train_config = TrainingConfigBase("itsc2019_{}_seed_{}".format(dataset_name, seed), os.path.join(models_dir, "train_use_case")) train_config.learning_rate_scheduler = LearningRateSchedulerStepwise(lr_decay=0.1, lr_decay_epoch=50) train_config.learning_rate = 0.05 train_config.weight_decay = 5e-4 train_config.num_epochs = 140 trainer = TrainerEhpi() trainer.train(train_loader, train_config, model=ShuffleNetV2(3))
51.152695
120
0.591103
1,633
17,085
5.826087
0.099816
0.088922
0.087871
0.120244
0.821211
0.806285
0.806285
0.806285
0.803553
0.798928
0
0.026279
0.331812
17,085
333
121
51.306306
0.807113
0.003687
0
0.772881
0
0
0.04643
0.039906
0
0
0
0
0
1
0.020339
false
0
0.054237
0
0.091525
0.016949
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
b8165c3a88f5bc30ec3829231a3a6d5762311eb5
816
py
Python
Dataset/Leetcode/train/7/535.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/7/535.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/7/535.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
class Solution: def XXX(self, x: int) -> int: if x==0: return 0 if x>0: st = str(x) li = list(st) li.XXX() for j in range(len(li)): if li[j]!=0: li = li[j:len(li)] break st = "".join(li) if int(st)>=2**31 or int(st)<-2**31: return 0 return int(st) elif x<0: st = str(-x) li = list(st) li.XXX() for j in range(len(li)): if li[j]!=0: li = li[j:len(li)] break st = "".join(li) if int(st)>=2**31 or int(st)<(-2**31): return 0 else : return -int(st)
25.5
50
0.317402
104
816
2.490385
0.25
0.11583
0.092664
0.123552
0.718147
0.718147
0.718147
0.718147
0.718147
0.718147
0
0.053908
0.545343
816
31
51
26.322581
0.644205
0
0
0.586207
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
7
62c47e0de9a3f1e2fb91ae1213a2894023f82628
65,455
py
Python
freegeek/models_old.py
codeforgoodconf/free-geek
645997724183c874f09008edf49a75b65976b944
[ "MIT" ]
6
2017-07-29T17:40:55.000Z
2019-12-03T16:11:46.000Z
freegeek/models_old.py
jasonleonhard/free-geek
645997724183c874f09008edf49a75b65976b944
[ "MIT" ]
72
2017-07-28T16:51:02.000Z
2018-10-20T22:05:25.000Z
freegeek/models_old.py
jasonleonhard/free-geek
645997724183c874f09008edf49a75b65976b944
[ "MIT" ]
14
2017-07-22T22:25:42.000Z
2018-10-20T21:53:10.000Z
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free to rename the models, but don't rename db_table values or field names. # # Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]' # into your database. from __future__ import unicode_literals from django.db import models class Action(models.Model): description = models.CharField(max_length=255, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) created_by = models.ForeignKey('FGUser', db_column='created_by', related_name='created_actions_set') updated_by = models.ForeignKey('FGUser', db_column='updated_by', related_name='updated_actions_set') name = models.CharField(max_length=40) class Meta: db_table = 'actions' class Assignment(models.Model): volunteer_shift = models.ForeignKey('VolunteerShift', blank=True, null=True) contact_id = models.IntegerField(blank=True, null=True) start_time = models.TimeField(blank=True, null=True) end_time = models.TimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) attendance_type_id = models.IntegerField(blank=True, null=True) notes = models.TextField(blank=True, null=True) call_status_type_id = models.IntegerField(blank=True, null=True) closed = models.BooleanField() lock_version = models.IntegerField() class Meta: db_table = 'assignments' class AttendanceType(models.Model): name = models.CharField(max_length=255, blank=True, null=True) cancelled = models.NullBooleanField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'attendance_types' class BuilderTask(models.Model): cashier_signed_off_by = models.ForeignKey('FGUser', db_column='cashier_signed_off_by', blank=True, null=True) action_id = models.IntegerField() contact_id = models.IntegerField() notes = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'builder_tasks' class CallStatusType(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'call_status_types' class CommunityServiceType(models.Model): description = models.CharField(max_length=100, blank=True, null=True) hours_multiplier = models.FloatField() lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=40) class Meta: db_table = 'community_service_types' class ContactDuplicate(models.Model): contact_id = models.IntegerField() dup_check = models.TextField() class Meta: db_table = 'contact_duplicates' class ContactMethodType(models.Model): description = models.CharField(max_length=100, blank=True, null=True) parent_id = models.IntegerField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=40) class Meta: db_table = 'contact_method_types' class ContactMethod(models.Model): contact_method_type_id = models.IntegerField() value = models.CharField(max_length=100) ok = models.NullBooleanField() contact_id = models.IntegerField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) details = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'contact_methods' class ContactType(models.Model): description = models.CharField(max_length=100, blank=True, null=True) for_who = models.CharField(max_length=3, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) instantiable = models.BooleanField() name = models.CharField(max_length=40) class Meta: db_table = 'contact_types' class ContactTypesContact(models.Model): id = models.BigIntegerField(primary_key=True) contact_id = models.IntegerField() contact_type_id = models.IntegerField() created_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'contact_types_contacts' class ContactVolunteerTaskTypeCount(models.Model): contact_id = models.IntegerField(blank=True, null=True) volunteer_task_type_id = models.IntegerField(blank=True, null=True) count = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'contact_volunteer_task_type_counts' class Contact(models.Model): is_organization = models.NullBooleanField() sort_name = models.CharField(max_length=100, blank=True, null=True) first_name = models.CharField(max_length=25, blank=True, null=True) middle_name = models.CharField(max_length=25, blank=True, null=True) surname = models.CharField(max_length=50, blank=True, null=True) organization = models.CharField(max_length=100, blank=True, null=True) extra_address = models.CharField(max_length=52, blank=True, null=True) address = models.CharField(max_length=52, blank=True, null=True) city = models.CharField(max_length=30, blank=True, null=True) state_or_province = models.CharField(max_length=15, blank=True, null=True) postal_code = models.CharField(max_length=25, blank=True, null=True) country = models.CharField(max_length=100, blank=True, null=True) notes = models.TextField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) created_by = models.ForeignKey('FGUser', db_column='created_by', related_name='created_by_contacts_set') updated_by = models.ForeignKey('FGUser', db_column='updated_by', related_name='updated_by_contacts_set', blank=True, null=True) next_milestone = models.IntegerField(blank=True, null=True) addr_certified = models.BooleanField() contract_id = models.IntegerField() cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_contacts_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_contacts_set', blank=True, null=True) fully_covered = models.NullBooleanField() birthday = models.DateField(blank=True, null=True) volunteer_intern_title = models.CharField(max_length=255, blank=True, null=True) next_monthly_milestone = models.IntegerField(blank=True, null=True) exported_to_sf = models.DateTimeField(blank=True, null=True) household = models.IntegerField(blank=True, null=True) addr_rejected = models.NullBooleanField() class Meta: db_table = 'contacts' class ContactsMailing(models.Model): contact_id = models.IntegerField(blank=True, null=True) mailing_id = models.IntegerField() bounced = models.BooleanField() response_date = models.DateTimeField(blank=True, null=True) response_amount_cents = models.IntegerField(blank=True, null=True) response_note = models.TextField(blank=True, null=True) class Meta: db_table = 'contacts_mailings' class Contract(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) label = models.CharField(max_length=255, blank=True, null=True) notes = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) instantiable = models.BooleanField() class Meta: db_table = 'contracts' class Customization(models.Model): key = models.CharField(max_length=255, blank=True, null=True) value = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'customizations' class DefaultAssignment(models.Model): contact_id = models.IntegerField(blank=True, null=True) volunteer_default_shift = models.ForeignKey('VolunteerDefaultShift', blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) start_time = models.TimeField(blank=True, null=True) end_time = models.TimeField(blank=True, null=True) slot_number = models.IntegerField(blank=True, null=True) closed = models.BooleanField() week = models.CharField(max_length=1, blank=True, null=True) week_1_of_month = models.BooleanField() week_2_of_month = models.BooleanField() week_3_of_month = models.BooleanField() week_4_of_month = models.BooleanField() week_5_of_month = models.BooleanField() lock_version = models.IntegerField() class Meta: db_table = 'default_assignments' class Default(models.Model): name = models.CharField(max_length=100, blank=True, null=True) value = models.TextField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'defaults' class DisbursementType(models.Model): description = models.CharField(max_length=100, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=40) class Meta: db_table = 'disbursement_types' class Disbursement(models.Model): comments = models.TextField(blank=True, null=True) contact_id = models.IntegerField() disbursement_type_id = models.IntegerField() lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) disbursed_at = models.DateTimeField() needs_attention = models.BooleanField() created_by = models.IntegerField() updated_by = models.IntegerField(blank=True, null=True) cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_by_disbursements_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_by_disbursements_set', blank=True, null=True) adjustment = models.BooleanField() class Meta: db_table = 'disbursements' class DisciplinaryActionArea(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'disciplinary_action_areas' class DisciplinaryActionAreasDisciplinaryAction(models.Model): disciplinary_action_id = models.IntegerField(blank=True, null=True) disciplinary_action_area_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'disciplinary_action_areas_disciplinary_actions' class DisciplinaryAction(models.Model): notes = models.TextField(blank=True, null=True) contact_id = models.IntegerField() disabled = models.BooleanField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) updated_by = models.ForeignKey('FGUser', db_column='updated_by', related_name='updated_by_diciplinaryactions_set', blank=True, null=True) created_by = models.ForeignKey('FGUser', db_column='created_by', related_name='created_by_diciplinaryactions_set', blank=True, null=True) cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_by_diciplinaryactions_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_by_diciplinaryactions_set', blank=True, null=True) class Meta: db_table = 'disciplinary_actions' class DiscountName(models.Model): description = models.CharField(max_length=255, blank=True, null=True) available = models.NullBooleanField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'discount_names' class DiscountPercentage(models.Model): percentage = models.IntegerField(blank=True, null=True) available = models.NullBooleanField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'discount_percentages' class DisktestBatchDrive(models.Model): serial_number = models.CharField(max_length=255) system_serial_number = models.CharField(max_length=255, blank=True, null=True) destroyed_at = models.DateTimeField(blank=True, null=True) user_destroyed_by = models.ForeignKey('FGUser', blank=True, null=True) disktest_run_id = models.IntegerField(blank=True, null=True) disktest_batch_id = models.IntegerField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'disktest_batch_drives' class DisktestBatch(models.Model): contact_id = models.IntegerField() name = models.CharField(max_length=255) date = models.DateField() finalized_on = models.DateField(blank=True, null=True) user_finalized_by = models.ForeignKey('FGUser', blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'disktest_batches' class DisktestRun(models.Model): vendor = models.CharField(max_length=255, blank=True, null=True) model = models.CharField(max_length=255, blank=True, null=True) serial_number = models.CharField(max_length=255, blank=True, null=True) completed_at = models.DateTimeField(blank=True, null=True) result = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) megabytes_size = models.IntegerField(blank=True, null=True) bus_type = models.CharField(max_length=255, blank=True, null=True) failure_details = models.CharField(max_length=255, blank=True, null=True) started_at = models.DateTimeField(blank=True, null=True) log = models.TextField(blank=True, null=True) form_factor = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'disktest_runs' class Donation(models.Model): contact_id = models.IntegerField(blank=True, null=True) postal_code = models.CharField(max_length=25, blank=True, null=True) comments = models.TextField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) created_by = models.ForeignKey('FGUser', related_name='created_by_donations_set', db_column='created_by') updated_by = models.ForeignKey('FGUser', related_name='updated_by_donations_set', db_column='updated_by', blank=True, null=True) reported_required_fee_cents = models.IntegerField(blank=True, null=True) reported_suggested_fee_cents = models.IntegerField(blank=True, null=True) needs_attention = models.BooleanField() invoice_resolved_at = models.DateTimeField(blank=True, null=True) contract_id = models.IntegerField() cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_by_donations_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_by_donations_set', blank=True, null=True) adjustment = models.BooleanField() occurred_at = models.DateTimeField() is_pickup = models.BooleanField() reported_resolved_invoices_cents = models.IntegerField() reported_recycling_fees_cents = models.IntegerField() reported_pickup_fees_cents = models.IntegerField() reported_education_fees_cents = models.IntegerField() reported_tech_support_fees_cents = models.IntegerField() reported_other_fees_cents = models.IntegerField() class Meta: db_table = 'donations' class EngineSchemaInfo(models.Model): engine_name = models.CharField(max_length=255, blank=True, null=True) version = models.IntegerField(blank=True, null=True) class Meta: db_table = 'engine_schema_info' class Generic(models.Model): value = models.CharField(max_length=100) only_serial = models.BooleanField() usable = models.BooleanField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'generics' class GizmoCategory(models.Model): description = models.CharField(max_length=255, blank=True, null=True) name = models.CharField(max_length=40) class Meta: db_table = 'gizmo_categories' class GizmoContext(models.Model): description = models.CharField(max_length=100, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=40) class Meta: db_table = 'gizmo_contexts' class GizmoContextsGizmoType(models.Model): gizmo_context_id = models.IntegerField() gizmo_type_id = models.IntegerField() lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'gizmo_contexts_gizmo_types' class GizmoEvent(models.Model): donation_id = models.IntegerField(blank=True, null=True) sale_id = models.IntegerField(blank=True, null=True) disbursement_id = models.IntegerField(blank=True, null=True) recycling_id = models.IntegerField(blank=True, null=True) gizmo_type_id = models.IntegerField() gizmo_context_id = models.IntegerField() gizmo_count = models.IntegerField() lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) occurred_at = models.DateTimeField(blank=True, null=True) unit_price_cents = models.IntegerField(blank=True, null=True) as_is = models.NullBooleanField() description = models.TextField(blank=True, null=True) size = models.IntegerField(blank=True, null=True) recycling_contract_id = models.IntegerField(blank=True, null=True) system = models.ForeignKey('System', blank=True, null=True) covered = models.NullBooleanField() gizmo_return_id = models.IntegerField(blank=True, null=True) reason = models.CharField(max_length=255, blank=True, null=True) tester = models.CharField(max_length=255, blank=True, null=True) return_sale_id = models.IntegerField(blank=True, null=True) return_store_credit = models.ForeignKey('StoreCredit', blank=True, null=True) return_disbursement_id = models.IntegerField(blank=True, null=True) invoice_donation_id = models.IntegerField(blank=True, null=True) discount_percentage_id = models.IntegerField(blank=True, null=True) store_pricing = models.ForeignKey('StorePricing', blank=True, null=True) class Meta: db_table = 'gizmo_events' class GizmoReturn(models.Model): contact_id = models.IntegerField(blank=True, null=True) created_by = models.IntegerField(blank=True, null=True) updated_by = models.IntegerField(blank=True, null=True) storecredit_difference_cents = models.IntegerField(blank=True, null=True) comments = models.TextField(blank=True, null=True) cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_by_gizmoreturns_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_by_gizmoreturns_set', blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) adjustment = models.BooleanField() occurred_at = models.DateTimeField() postal_code = models.CharField(max_length=25, blank=True, null=True) payment_method_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'gizmo_returns' class GizmoTypeGroup(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'gizmo_type_groups' class GizmoTypeGroupsGizmoType(models.Model): gizmo_type_id = models.IntegerField(blank=True, null=True) gizmo_type_group_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'gizmo_type_groups_gizmo_types' class GizmoType(models.Model): description = models.CharField(max_length=100, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) required_fee_cents = models.IntegerField() suggested_fee_cents = models.IntegerField() gizmo_category_id = models.IntegerField() name = models.CharField(max_length=40) covered = models.NullBooleanField() rank = models.IntegerField(blank=True, null=True) effective_on = models.DateTimeField(blank=True, null=True) ineffective_on = models.DateTimeField(blank=True, null=True) parent_name = models.CharField(max_length=255, blank=True, null=True) needs_id = models.BooleanField() return_policy_id = models.IntegerField(blank=True, null=True) not_discounted = models.BooleanField() sales_limit = models.IntegerField(blank=True, null=True) tax_value_for_2014_cents = models.IntegerField(blank=True, null=True) class Meta: db_table = 'gizmo_types' # class Holiday(models.Model): # name = models.CharField(max_length=255, blank=True, null=True) # holiday_date = models.DateField(blank=True, null=True) # is_all_day = models.NullBooleanField() # start_time = models.TimeField(blank=True, null=True) # end_time = models.TimeField(blank=True, null=True) # frequency_type_id = models.IntegerField(blank=True, null=True) # schedule_id = models.IntegerField(blank=True, null=True) # weekday = models.ForeignKey('Weekday', blank=True, null=True) # class Meta: # db_table = 'holidays' class IncomeStream(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'income_streams' class Job(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.TextField(blank=True, null=True) income_stream_id = models.IntegerField(blank=True, null=True) wc_category = models.ForeignKey('WcCategory', blank=True, null=True) program_id = models.IntegerField(blank=True, null=True) virtual = models.BooleanField() effective_on = models.DateField(blank=True, null=True) ineffective_on = models.DateField(blank=True, null=True) offsite = models.BooleanField() reason_cannot_log_hours = models.TextField(blank=True, null=True) fully_covered = models.BooleanField() class Meta: db_table = 'jobs' class Log(models.Model): table_name = models.CharField(max_length=255, blank=True, null=True) action = models.CharField(max_length=255, blank=True, null=True) user_id = models.IntegerField(blank=True, null=True) thing_id = models.IntegerField(blank=True, null=True) date = models.DateTimeField(blank=True, null=True) cashier_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'logs' class Mailing(models.Model): name = models.CharField(max_length=20, blank=True, null=True) description = models.CharField(max_length=100) created_by = models.IntegerField() updated_by = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'mailings' class MeetingMinder(models.Model): meeting_id = models.IntegerField(blank=True, null=True) days_before = models.IntegerField(blank=True, null=True) recipient = models.CharField(max_length=255, blank=True, null=True) subject = models.CharField(max_length=255, blank=True, null=True) script = models.CharField(max_length=255, blank=True, null=True) body = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) hour = models.IntegerField() class Meta: db_table = 'meeting_minders' class MeetingsWorker(models.Model): meeting_id = models.IntegerField(blank=True, null=True) worker = models.ForeignKey('Worker', blank=True, null=True) class Meta: db_table = 'meetings_workers' class NewsletterSubscriber(models.Model): email = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'newsletter_subscribers' class Note(models.Model): contact_id = models.IntegerField(blank=True, null=True) system = models.ForeignKey('System', blank=True, null=True) body = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'notes' class PayPeriod(models.Model): start_date = models.DateField(blank=True, null=True) end_date = models.DateField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'pay_periods' class PaymentMethod(models.Model): description = models.CharField(max_length=100, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=40) class Meta: db_table = 'payment_methods' class Payment(models.Model): donation_id = models.IntegerField(blank=True, null=True) sale_id = models.IntegerField(blank=True, null=True) payment_method_id = models.IntegerField() lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) amount_cents = models.IntegerField(blank=True, null=True) coupon_details = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'payments' class PluginSchemaInfo(models.Model): plugin_name = models.CharField(max_length=255, blank=True, null=True) version = models.IntegerField(blank=True, null=True) class Meta: db_table = 'plugin_schema_info' class PointsTrade(models.Model): from_contact_id = models.IntegerField(blank=True, null=True) to_contact_id = models.IntegerField(blank=True, null=True) points = models.DecimalField(max_digits=100, decimal_places=100, blank=True, null=True) created_by = models.IntegerField(blank=True, null=True) updated_by = models.IntegerField(blank=True, null=True) cashier_created_by = models.IntegerField(blank=True, null=True) cashier_updated_by = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'points_trades' class PostalCode(models.Model): postal_code = models.CharField(max_length=255, blank=True, null=True) city = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'postal_codes' class PricingData(models.Model): table_name = models.CharField(max_length=255, blank=True, null=True) printme_value = models.CharField(max_length=255, blank=True, null=True) lookup_type = models.CharField(max_length=255, blank=True, null=True) lookup_value = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'pricing_datas' class PricingTypesType(models.Model): type = models.ForeignKey('Type', blank=True, null=True) pricing_type_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'pricing_types_types' class Privilege(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) restrict = models.BooleanField() class Meta: db_table = 'privileges' class PrivilegesRole(models.Model): privilege_id = models.IntegerField(blank=True, null=True) role_id = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'privileges_roles' class Program(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) volunteer = models.BooleanField() adoption_credit = models.BooleanField() class Meta: db_table = 'programs' class RecyclingShipment(models.Model): contact_id = models.IntegerField() bill_of_lading = models.CharField(max_length=255) received_at = models.DateField() resolved_at = models.DateField(blank=True, null=True) notes = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'recycling_shipments' class Recycling(models.Model): comments = models.TextField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) recycled_at = models.DateTimeField() needs_attention = models.BooleanField() created_by = models.IntegerField() updated_by = models.IntegerField(blank=True, null=True) cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_by_recyclings_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_by_recyclings_set', blank=True, null=True) adjustment = models.BooleanField() class Meta: db_table = 'recyclings' class ReportLog(models.Model): report_name = models.CharField(max_length=255, blank=True, null=True) user_id = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'report_logs' class Resource(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'resources' class ResourcesVolunteerDefaultEvent(models.Model): volunteer_default_event = models.ForeignKey('VolunteerDefaultEvent', blank=True, null=True) resource_id = models.IntegerField(blank=True, null=True) start_time = models.TimeField(blank=True, null=True) end_time = models.TimeField(blank=True, null=True) effective_at = models.DateField(blank=True, null=True) ineffective_at = models.DateField(blank=True, null=True) roster_id = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'resources_volunteer_default_events' class ResourcesVolunteerEvent(models.Model): volunteer_event = models.ForeignKey('VolunteerEvent', blank=True, null=True) resource_id = models.IntegerField(blank=True, null=True) resources_volunteer_default_event_id = models.IntegerField(blank=True, null=True) start_time = models.TimeField(blank=True, null=True) end_time = models.TimeField(blank=True, null=True) roster_id = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'resources_volunteer_events' class ReturnPolicy(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) text = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'return_policies' # class Role(models.Model): # name = models.CharField(max_length=40, blank=True, null=True) # created_at = models.DateTimeField(blank=True, null=True) # updated_at = models.DateTimeField(blank=True, null=True) # notes = models.CharField(max_length=255, blank=True, null=True) # class Meta: # db_table = 'roles' class RolesFGUser(models.Model): user = models.ForeignKey('FGUser', blank=True, null=True) role_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'roles_fgusers' class Roster(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) enabled = models.BooleanField() limit_shift_signup_by_program = models.BooleanField() contact_type_id = models.IntegerField(blank=True, null=True) restrict_to_every_n_days = models.IntegerField(blank=True, null=True) restrict_from_sked_id = models.IntegerField(blank=True, null=True) class Meta: db_table = 'rosters' class RostersSked(models.Model): sked_id = models.IntegerField(blank=True, null=True) roster_id = models.IntegerField(blank=True, null=True) position = models.IntegerField(blank=True, null=True) class Meta: db_table = 'rosters_skeds' class RrItem(models.Model): rr_set_id = models.IntegerField(blank=True, null=True) repeats_every = models.IntegerField(blank=True, null=True) repeats_on = models.IntegerField(blank=True, null=True) weekday_0 = models.NullBooleanField() weekday_1 = models.NullBooleanField() weekday_2 = models.NullBooleanField() weekday_3 = models.NullBooleanField() weekday_4 = models.NullBooleanField() weekday_5 = models.NullBooleanField() weekday_6 = models.NullBooleanField() day_of_month_final = models.NullBooleanField() min_day_of_month = models.IntegerField(blank=True, null=True) max_day_of_month = models.IntegerField(blank=True, null=True) week_of_month_final = models.NullBooleanField() week_of_month_1 = models.NullBooleanField() week_of_month_2 = models.NullBooleanField() week_of_month_3 = models.NullBooleanField() week_of_month_4 = models.NullBooleanField() week_of_month_5 = models.NullBooleanField() month_of_year_01 = models.NullBooleanField() month_of_year_02 = models.NullBooleanField() month_of_year_03 = models.NullBooleanField() month_of_year_04 = models.NullBooleanField() month_of_year_05 = models.NullBooleanField() month_of_year_06 = models.NullBooleanField() month_of_year_07 = models.NullBooleanField() month_of_year_08 = models.NullBooleanField() month_of_year_09 = models.NullBooleanField() month_of_year_11 = models.NullBooleanField() month_of_year_10 = models.NullBooleanField() month_of_year_12 = models.NullBooleanField() class Meta: db_table = 'rr_items' class RrSet(models.Model): name = models.CharField(max_length=255, blank=True, null=True) effective_date = models.DateField(blank=True, null=True) ineffective_date = models.DateField(blank=True, null=True) match_mode = models.IntegerField(blank=True, null=True) class Meta: db_table = 'rr_sets' class SaleType(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'sale_types' class Sale(models.Model): contact_id = models.IntegerField(blank=True, null=True) postal_code = models.CharField(max_length=25, blank=True, null=True) comments = models.TextField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) created_by = models.ForeignKey('FGUser', db_column='created_by', related_name='created_by_sales_set') updated_by = models.ForeignKey('FGUser', db_column='updated_by', related_name='updated_by_sales_set', blank=True, null=True) reported_discount_amount_cents = models.IntegerField(blank=True, null=True) reported_amount_due_cents = models.IntegerField(blank=True, null=True) needs_attention = models.BooleanField() invoice_resolved_at = models.DateTimeField(blank=True, null=True) cashier_created_by = models.ForeignKey('FGUser', db_column='cashier_created_by', related_name='cashier_created_by_sales_set', blank=True, null=True) cashier_updated_by = models.ForeignKey('FGUser', db_column='cashier_updated_by', related_name='cashier_updated_by_sales_set', blank=True, null=True) adjustment = models.BooleanField() occurred_at = models.DateTimeField() sale_type_id = models.IntegerField() discount_name_id = models.IntegerField() discount_percentage_id = models.IntegerField() amount_real_money_paid_cents = models.IntegerField(blank=True, null=True) class Meta: db_table = 'sales' class Schedule(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) effective_date = models.DateField(blank=True, null=True) ineffective_date = models.DateField(blank=True, null=True) repeats_every = models.IntegerField(blank=True, null=True) repeats_on = models.IntegerField(blank=True, null=True) generate_from = models.BooleanField() reference_from = models.BooleanField() class Meta: db_table = 'schedules' class SchemaInfo(models.Model): version = models.IntegerField(blank=True, null=True) class Meta: managed = False db_table = 'schema_info' class SchemaMigration(models.Model): version = models.CharField(max_length=255) class Meta: managed = False db_table = 'schema_migrations' class Session(models.Model): session_id = models.CharField(max_length=255) data = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'sessions' # class ShiftFootnote(models.Model): # weekday = models.ForeignKey('Weekday', blank=True, null=True) # schedule_id = models.IntegerField(blank=True, null=True) # note = models.TextField(blank=True, null=True) # created_at = models.DateTimeField(blank=True, null=True) # updated_at = models.DateTimeField(blank=True, null=True) # class Meta: # db_table = 'shift_footnotes' # class Shift(models.Model): # type = models.CharField(max_length=255, blank=True, null=True) # start_time = models.TimeField(blank=True, null=True) # end_time = models.TimeField(blank=True, null=True) # meeting_name = models.CharField(max_length=255, blank=True, null=True) # shift_date = models.DateField(blank=True, null=True) # effective_date = models.DateField(blank=True, null=True) # ineffective_date = models.DateField(blank=True, null=True) # all_day = models.NullBooleanField() # repeats_every = models.IntegerField(blank=True, null=True) # repeats_on = models.IntegerField(blank=True, null=True) # frequency_type_id = models.IntegerField(blank=True, null=True) # job_id = models.IntegerField(blank=True, null=True) # meeting_id = models.IntegerField(blank=True, null=True) # schedule_id = models.IntegerField(blank=True, null=True) # weekday = models.ForeignKey('Weekday', blank=True, null=True) # worker = models.ForeignKey('Worker', blank=True, null=True) # actual = models.NullBooleanField() # training = models.NullBooleanField() # proposed = models.BooleanField() # created_by = models.ForeignKey('FGUser', db_column='created_by', # related_name='created_by_shifts_set', # blank=True, null=True) # updated_by = models.ForeignKey('FGUser', db_column='updated_by', # related_name='updated_by_shifts_set', # blank=True, null=True) # created_at = models.DateTimeField(blank=True, null=True) # updated_at = models.DateTimeField(blank=True, null=True) # week_1_of_month = models.BooleanField() # week_2_of_month = models.BooleanField() # week_3_of_month = models.BooleanField() # week_4_of_month = models.BooleanField() # week_5_of_month = models.BooleanField() # offsite = models.BooleanField() # repeats_every_months = models.IntegerField() # repeats_on_months = models.IntegerField() # week = models.CharField(max_length=1, blank=True, null=True) # class Meta: # db_table = 'shifts' class SkedjulnatorAccess(models.Model): user = models.ForeignKey('FGUser', blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'skedjulnator_accesses' class Sked(models.Model): name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) category_type = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'skeds' class SpecSheetQuestionCondition(models.Model): spec_sheet_question_id = models.IntegerField(blank=True, null=True) name = models.CharField(max_length=255, blank=True, null=True) operator = models.CharField(max_length=255, blank=True, null=True) expected_value = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'spec_sheet_question_conditions' class SpecSheetQuestion(models.Model): name = models.CharField(max_length=255, blank=True, null=True) question = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) position = models.IntegerField() class Meta: db_table = 'spec_sheet_questions' class SpecSheetValue(models.Model): spec_sheet = models.ForeignKey('SpecSheet', blank=True, null=True) spec_sheet_question_id = models.IntegerField(blank=True, null=True) value = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'spec_sheet_values' class SpecSheet(models.Model): system = models.ForeignKey('System', blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) old_id = models.IntegerField(blank=True, null=True) type = models.ForeignKey('Type') os = models.CharField(max_length=255, blank=True, null=True) flag = models.NullBooleanField() cleaned_output = models.TextField(blank=True, null=True) original_output = models.TextField(blank=True, null=True) cleaned_valid = models.NullBooleanField() original_valid = models.NullBooleanField() builder_task_id = models.IntegerField() class Meta: db_table = 'spec_sheets' # class StandardShift(models.Model): # start_time = models.TimeField(blank=True, null=True) # end_time = models.TimeField(blank=True, null=True) # job_id = models.IntegerField(blank=True, null=True) # meeting_id = models.IntegerField(blank=True, null=True) # schedule_id = models.IntegerField(blank=True, null=True) # weekday = models.ForeignKey('Weekday', blank=True, null=True) # worker = models.ForeignKey('Worker', blank=True, null=True) # shift_date = models.DateField(blank=True, null=True) # class Meta: # db_table = 'standard_shifts' class StoreCredit(models.Model): gizmo_return_id = models.IntegerField(blank=True, null=True) gizmo_event_id = models.IntegerField(blank=True, null=True) payment_id = models.IntegerField(blank=True, null=True) amount_cents = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) expire_date = models.DateField(blank=True, null=True) class Meta: db_table = 'store_credits' class StorePricing(models.Model): gizmo_type_id = models.IntegerField(blank=True, null=True) unit_price_cents = models.IntegerField(blank=True, null=True) system = models.ForeignKey('System', blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'store_pricings' class System(models.Model): system_vendor = models.CharField(max_length=255, blank=True, null=True) system_model = models.CharField(max_length=255, blank=True, null=True) system_serial_number = models.CharField(max_length=255, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) mobo_vendor = models.CharField(max_length=255, blank=True, null=True) mobo_model = models.CharField(max_length=255, blank=True, null=True) mobo_serial_number = models.CharField(max_length=255, blank=True, null=True) serial_number = models.CharField(max_length=255, blank=True, null=True) vendor = models.CharField(max_length=255, blank=True, null=True) model = models.CharField(max_length=255, blank=True, null=True) contract_id = models.IntegerField() covered = models.NullBooleanField() bug_correction = models.CharField(max_length=255, blank=True, null=True) previous = models.ForeignKey('self', blank=True, null=True) l1_cache_total = models.CharField(max_length=255, blank=True, null=True) l2_cache_total = models.CharField(max_length=255, blank=True, null=True) l3_cache_total = models.CharField(max_length=255, blank=True, null=True) processor_slot = models.CharField(max_length=255, blank=True, null=True) processor_product = models.CharField(max_length=255, blank=True, null=True) processor_speed = models.CharField(max_length=255, blank=True, null=True) north_bridge = models.CharField(max_length=255, blank=True, null=True) sixty_four_bit = models.NullBooleanField() virtualization = models.NullBooleanField() last_build = models.DateField(blank=True, null=True) class Meta: db_table = 'systems' class TechSupportNote(models.Model): contact_id = models.IntegerField() notes = models.TextField(blank=True, null=True) created_by = models.ForeignKey('FGUser', db_column='created_by', related_name='created_techsupportnotes_set', blank=True, null=True) updated_by = models.ForeignKey('FGUser', db_column='updated_by', related_name='updated_techsupportnotes_set', blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'tech_support_notes' class TillAdjustment(models.Model): till_type = models.ForeignKey('TillType', blank=True, null=True) till_date = models.DateField(blank=True, null=True) adjustment_cents = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'till_adjustments' class TillType(models.Model): name = models.CharField(unique=True, max_length=255, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'till_types' class Type(models.Model): description = models.CharField(max_length=255, blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) created_by = models.ForeignKey('FGUser', db_column='created_by', related_name='created_by_types_set') updated_by = models.ForeignKey('FGUser', db_column='updated_by', related_name='updated_by_types_set') name = models.CharField(unique=True, max_length=40) gizmo_type_id = models.IntegerField(blank=True, null=True) active = models.BooleanField() class Meta: db_table = 'types' class FGUser(models.Model): login = models.CharField(max_length=255, blank=True, null=True) email = models.CharField(max_length=255, blank=True, null=True) crypted_password = models.CharField(max_length=40, blank=True, null=True) salt = models.CharField(max_length=40, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) remember_token = models.CharField(max_length=255, blank=True, null=True) remember_token_expires_at = models.DateTimeField(blank=True, null=True) contact_id = models.IntegerField(blank=True, null=True) created_by = models.ForeignKey('self', db_column='created_by', related_name='created_by_users_set', blank=True, null=True) updated_by = models.ForeignKey('self', db_column='updated_by', related_name='updated_by_users_set', blank=True, null=True) cashier_code = models.IntegerField(blank=True, null=True) can_login = models.BooleanField() last_logged_in = models.DateField(blank=True, null=True) shared = models.BooleanField() reason_cannot_login = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'users' # class Vacation(models.Model): # effective_date = models.DateField(blank=True, null=True) # ineffective_date = models.DateField(blank=True, null=True) # is_all_day = models.NullBooleanField() # start_time = models.TimeField(blank=True, null=True) # end_time = models.TimeField(blank=True, null=True) # worker = models.ForeignKey('Worker', blank=True, null=True) # created_by = models.ForeignKey(FGUser, db_column='created_by', # related_name='created_by_vacations_set', # blank=True, null=True) # updated_by = models.ForeignKey(FGUser, db_column='updated_by', # related_name='updated_by_vacations_set', # blank=True, null=True) # created_at = models.DateTimeField(blank=True, null=True) # updated_at = models.DateTimeField(blank=True, null=True) # class Meta: # db_table = 'vacations' class VolunteerDefaultEvent(models.Model): description = models.CharField(max_length=255, blank=True, null=True) weekday_id = models.IntegerField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) notes = models.TextField(blank=True, null=True) week = models.CharField(max_length=1, blank=True, null=True) class Meta: db_table = 'volunteer_default_events' class VolunteerDefaultShift(models.Model): start_time = models.TimeField(blank=True, null=True) end_time = models.TimeField(blank=True, null=True) slot_count = models.IntegerField(blank=True, null=True) volunteer_task_type = models.ForeignKey('VolunteerTaskType', blank=True, null=True) roster_id = models.IntegerField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) volunteer_default_event = models.ForeignKey(VolunteerDefaultEvent, null=True) class_credit = models.NullBooleanField() description = models.CharField(max_length=255, blank=True, null=True) program_id = models.IntegerField(blank=True, null=True) not_numbered = models.BooleanField() stuck_to_assignment = models.BooleanField() effective_on = models.DateField(blank=True, null=True) ineffective_on = models.DateField(blank=True, null=True) class Meta: db_table = 'volunteer_default_shifts' class VolunteerEvent(models.Model): description = models.CharField(max_length=255, blank=True, null=True) volunteer_default_event = models.ForeignKey(VolunteerDefaultEvent, blank=True, null=True) date = models.DateField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) notes = models.TextField(blank=True, null=True) nowalkins = models.BooleanField() class Meta: db_table = 'volunteer_events' class VolunteerShift(models.Model): volunteer_default_shift = models.ForeignKey(VolunteerDefaultShift, blank=True, null=True) start_time = models.TimeField(blank=True, null=True) end_time = models.TimeField(blank=True, null=True) volunteer_task_type = models.ForeignKey('VolunteerTaskType', blank=True, null=True) slot_number = models.IntegerField(blank=True, null=True) roster_id = models.IntegerField() created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) volunteer_event = models.ForeignKey(VolunteerEvent) class_credit = models.NullBooleanField() description = models.CharField(max_length=255, blank=True, null=True) program_id = models.IntegerField(blank=True, null=True) not_numbered = models.BooleanField() stuck_to_assignment = models.BooleanField() class Meta: db_table = 'volunteer_shifts' class VolunteerTaskType(models.Model): description = models.CharField(max_length=100, blank=True, null=True) hours_multiplier = models.DecimalField(max_digits=10, decimal_places=3) instantiable = models.BooleanField() lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) name = models.CharField(max_length=40) effective_on = models.DateTimeField(blank=True, null=True) ineffective_on = models.DateTimeField(blank=True, null=True) program_id = models.IntegerField() adoption_credit = models.NullBooleanField() class Meta: db_table = 'volunteer_task_types' class VolunteerTask(models.Model): contact_id = models.IntegerField(blank=True, null=True) duration = models.FloatField(blank=True, null=True) lock_version = models.IntegerField() updated_at = models.DateTimeField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) community_service_type_id = models.IntegerField(blank=True, null=True) volunteer_task_type = models.ForeignKey(VolunteerTaskType, blank=True, null=True) date_performed = models.DateField(blank=True, null=True) created_by = models.ForeignKey(FGUser, db_column='created_by', related_name='created_by_volunteertasks_set') updated_by = models.ForeignKey(FGUser, db_column='updated_by', related_name='updated_by_volunteertasks_set', blank=True, null=True) cashier_created_by = models.ForeignKey(FGUser, db_column='cashier_created_by', related_name='cashier_created_by_volunteertasks_set', blank=True, null=True) cashier_updated_by = models.ForeignKey(FGUser, db_column='cashier_updated_by', related_name='cashier_updated_by_volunteertasks_set', blank=True, null=True) program_id = models.IntegerField() class Meta: db_table = 'volunteer_tasks' class WarrantyLength(models.Model): system_type = models.CharField(max_length=255) box_source = models.CharField(max_length=255) os_type = models.CharField(max_length=255, blank=True, null=True) length = models.CharField(max_length=255) effective_on = models.DateField(blank=True, null=True) ineffective_on = models.DateField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'warranty_lengths' class WcCategory(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) rate_cents = models.IntegerField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'wc_categories' # class Weekday(models.Model): # name = models.CharField(max_length=255, blank=True, null=True) # short_name = models.CharField(max_length=255, blank=True, null=True) # is_open = models.NullBooleanField() # start_time = models.TimeField(blank=True, null=True) # end_time = models.TimeField(blank=True, null=True) # open_time = models.TimeField() # close_time = models.TimeField() # class Meta: # db_table = 'weekdays' class WorkShiftFootnote(models.Model): date = models.DateTimeField(blank=True, null=True) note = models.TextField(blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) class Meta: db_table = 'work_shift_footnotes' # class WorkShift(models.Model): # kind = models.CharField(max_length=255) # start_time = models.TimeField(blank=True, null=True) # end_time = models.TimeField(blank=True, null=True) # meeting_name = models.CharField(max_length=255, blank=True, null=True) # shift_date = models.DateField(blank=True, null=True) # effective_date = models.DateField(blank=True, null=True) # ineffective_date = models.DateField(blank=True, null=True) # all_day = models.NullBooleanField() # repeats_every = models.IntegerField(blank=True, null=True) # repeats_on = models.IntegerField(blank=True, null=True) # frequency_type_id = models.IntegerField(blank=True, null=True) # job_id = models.IntegerField(blank=True, null=True) # meeting_id = models.IntegerField(blank=True, null=True) # schedule_id = models.IntegerField(blank=True, null=True) # shift_id = models.IntegerField(blank=True, null=True) # weekday = models.ForeignKey(Weekday, blank=True, null=True) # worker = models.ForeignKey('Worker', blank=True, null=True) # actual = models.NullBooleanField() # training = models.NullBooleanField() # proposed = models.NullBooleanField() # created_by = models.ForeignKey(FGUser, db_column='created_by', # related_name='created_by_workshifts_set', # blank=True, null=True) # updated_by = models.ForeignKey(FGUser, db_column='updated_by', # related_name='updated_by_workshifts_set', # blank=True, null=True) # created_at = models.DateTimeField(blank=True, null=True) # updated_at = models.DateTimeField(blank=True, null=True) # offsite = models.BooleanField() # class Meta: # db_table = 'work_shifts' class WorkedShift(models.Model): worker = models.ForeignKey('Worker', blank=True, null=True) job_id = models.IntegerField(blank=True, null=True) date_performed = models.DateField(blank=True, null=True) duration = models.DecimalField(max_digits=100, decimal_places=100, blank=True, null=True) created_at = models.DateTimeField(blank=True, null=True) updated_at = models.DateTimeField(blank=True, null=True) offsite = models.NullBooleanField() class Meta: db_table = 'worked_shifts' class WorkerType(models.Model): name = models.CharField(max_length=255, blank=True, null=True) description = models.CharField(max_length=255, blank=True, null=True) class Meta: db_table = 'worker_types' # class Worker(models.Model): # name = models.CharField(max_length=255, blank=True, null=True) # standard_weekly_hours = models.FloatField(blank=True, null=True) # weekly_admin_hours = models.FloatField(blank=True, null=True) # contact_id = models.IntegerField(blank=True, null=True) # sunday = models.FloatField(blank=True, null=True) # monday = models.FloatField(blank=True, null=True) # tuesday = models.FloatField(blank=True, null=True) # wednesday = models.FloatField(blank=True, null=True) # thursday = models.FloatField(blank=True, null=True) # friday = models.FloatField(blank=True, null=True) # saturday = models.FloatField(blank=True, null=True) # salaried = models.NullBooleanField() # pto_rate = models.FloatField(blank=True, null=True) # floor_hours = models.FloatField(blank=True, null=True) # ceiling_hours = models.FloatField(blank=True, null=True) # virtual = models.BooleanField() # class Meta: # db_table = 'workers' # class WorkersWorkerType(models.Model): # worker = models.ForeignKey(Worker) # worker_type = models.ForeignKey(WorkerType) # effective_on = models.DateField(blank=True, null=True) # ineffective_on = models.DateField(blank=True, null=True) # created_at = models.DateTimeField(blank=True, null=True) # updated_at = models.DateTimeField(blank=True, null=True) # class Meta: # db_table = 'workers_worker_types'
40.781931
141
0.732702
8,255
65,455
5.623137
0.070866
0.109783
0.178117
0.232922
0.845882
0.811349
0.777117
0.732459
0.703914
0.67188
0
0.009354
0.155603
65,455
1,604
142
40.807357
0.830505
0.131892
0
0.519126
1
0
0.059595
0.022666
0
0
0
0
0
1
0
false
0.000911
0.001821
0
0.867031
0.000911
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
9
1a2241b22ceb1fdfef86170897d134b8305f91b4
46,966
py
Python
src/python_pachyderm/proto/v2/auth/auth_pb2_grpc.py
sjezewski/pypachy
4bc022d0c73140475f9bd0acd5c0e7204609de26
[ "Apache-2.0" ]
57
2018-02-25T16:23:47.000Z
2022-02-08T08:48:12.000Z
src/python_pachyderm/proto/v2/auth/auth_pb2_grpc.py
sjezewski/pypachy
4bc022d0c73140475f9bd0acd5c0e7204609de26
[ "Apache-2.0" ]
209
2018-02-16T14:31:25.000Z
2022-03-15T15:24:19.000Z
src/python_pachyderm/proto/v2/auth/auth_pb2_grpc.py
sjezewski/pypachy
4bc022d0c73140475f9bd0acd5c0e7204609de26
[ "Apache-2.0" ]
23
2018-02-16T15:31:46.000Z
2022-03-09T20:41:31.000Z
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from python_pachyderm.proto.v2.auth import auth_pb2 as python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2 class APIStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Activate = channel.unary_unary( '/auth_v2.API/Activate', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ActivateRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ActivateResponse.FromString, ) self.Deactivate = channel.unary_unary( '/auth_v2.API/Deactivate', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeactivateRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeactivateResponse.FromString, ) self.GetConfiguration = channel.unary_unary( '/auth_v2.API/GetConfiguration', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetConfigurationRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetConfigurationResponse.FromString, ) self.SetConfiguration = channel.unary_unary( '/auth_v2.API/SetConfiguration', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetConfigurationRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetConfigurationResponse.FromString, ) self.Authenticate = channel.unary_unary( '/auth_v2.API/Authenticate', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthenticateRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthenticateResponse.FromString, ) self.Authorize = channel.unary_unary( '/auth_v2.API/Authorize', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthorizeRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthorizeResponse.FromString, ) self.GetPermissions = channel.unary_unary( '/auth_v2.API/GetPermissions', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsResponse.FromString, ) self.GetPermissionsForPrincipal = channel.unary_unary( '/auth_v2.API/GetPermissionsForPrincipal', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsForPrincipalRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsResponse.FromString, ) self.WhoAmI = channel.unary_unary( '/auth_v2.API/WhoAmI', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.WhoAmIRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.WhoAmIResponse.FromString, ) self.GetRolesForPermission = channel.unary_unary( '/auth_v2.API/GetRolesForPermission', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRolesForPermissionRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRolesForPermissionResponse.FromString, ) self.ModifyRoleBinding = channel.unary_unary( '/auth_v2.API/ModifyRoleBinding', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyRoleBindingRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyRoleBindingResponse.FromString, ) self.GetRoleBinding = channel.unary_unary( '/auth_v2.API/GetRoleBinding', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRoleBindingRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRoleBindingResponse.FromString, ) self.GetOIDCLogin = channel.unary_unary( '/auth_v2.API/GetOIDCLogin', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetOIDCLoginRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetOIDCLoginResponse.FromString, ) self.GetRobotToken = channel.unary_unary( '/auth_v2.API/GetRobotToken', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRobotTokenRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRobotTokenResponse.FromString, ) self.RevokeAuthToken = channel.unary_unary( '/auth_v2.API/RevokeAuthToken', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokenRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokenResponse.FromString, ) self.RevokeAuthTokensForUser = channel.unary_unary( '/auth_v2.API/RevokeAuthTokensForUser', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokensForUserRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokensForUserResponse.FromString, ) self.SetGroupsForUser = channel.unary_unary( '/auth_v2.API/SetGroupsForUser', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetGroupsForUserRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetGroupsForUserResponse.FromString, ) self.ModifyMembers = channel.unary_unary( '/auth_v2.API/ModifyMembers', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyMembersRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyMembersResponse.FromString, ) self.GetGroups = channel.unary_unary( '/auth_v2.API/GetGroups', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsResponse.FromString, ) self.GetGroupsForPrincipal = channel.unary_unary( '/auth_v2.API/GetGroupsForPrincipal', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsForPrincipalRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsResponse.FromString, ) self.GetUsers = channel.unary_unary( '/auth_v2.API/GetUsers', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetUsersRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetUsersResponse.FromString, ) self.ExtractAuthTokens = channel.unary_unary( '/auth_v2.API/ExtractAuthTokens', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ExtractAuthTokensRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ExtractAuthTokensResponse.FromString, ) self.RestoreAuthToken = channel.unary_unary( '/auth_v2.API/RestoreAuthToken', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RestoreAuthTokenRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RestoreAuthTokenResponse.FromString, ) self.DeleteExpiredAuthTokens = channel.unary_unary( '/auth_v2.API/DeleteExpiredAuthTokens', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeleteExpiredAuthTokensRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeleteExpiredAuthTokensResponse.FromString, ) self.RotateRootToken = channel.unary_unary( '/auth_v2.API/RotateRootToken', request_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RotateRootTokenRequest.SerializeToString, response_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RotateRootTokenResponse.FromString, ) class APIServicer(object): """Missing associated documentation comment in .proto file.""" def Activate(self, request, context): """Activate/Deactivate the auth API. 'Activate' sets an initial set of admins for the Pachyderm cluster, and 'Deactivate' removes all ACLs, tokens, and admins from the Pachyderm cluster, making all data publicly accessable """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Deactivate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetConfiguration(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetConfiguration(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Authenticate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Authorize(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetPermissions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetPermissionsForPrincipal(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def WhoAmI(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetRolesForPermission(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ModifyRoleBinding(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetRoleBinding(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetOIDCLogin(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetRobotToken(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RevokeAuthToken(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RevokeAuthTokensForUser(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetGroupsForUser(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ModifyMembers(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetGroups(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetGroupsForPrincipal(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetUsers(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExtractAuthTokens(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RestoreAuthToken(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DeleteExpiredAuthTokens(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RotateRootToken(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_APIServicer_to_server(servicer, server): rpc_method_handlers = { 'Activate': grpc.unary_unary_rpc_method_handler( servicer.Activate, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ActivateRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ActivateResponse.SerializeToString, ), 'Deactivate': grpc.unary_unary_rpc_method_handler( servicer.Deactivate, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeactivateRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeactivateResponse.SerializeToString, ), 'GetConfiguration': grpc.unary_unary_rpc_method_handler( servicer.GetConfiguration, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetConfigurationRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetConfigurationResponse.SerializeToString, ), 'SetConfiguration': grpc.unary_unary_rpc_method_handler( servicer.SetConfiguration, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetConfigurationRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetConfigurationResponse.SerializeToString, ), 'Authenticate': grpc.unary_unary_rpc_method_handler( servicer.Authenticate, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthenticateRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthenticateResponse.SerializeToString, ), 'Authorize': grpc.unary_unary_rpc_method_handler( servicer.Authorize, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthorizeRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthorizeResponse.SerializeToString, ), 'GetPermissions': grpc.unary_unary_rpc_method_handler( servicer.GetPermissions, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsResponse.SerializeToString, ), 'GetPermissionsForPrincipal': grpc.unary_unary_rpc_method_handler( servicer.GetPermissionsForPrincipal, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsForPrincipalRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsResponse.SerializeToString, ), 'WhoAmI': grpc.unary_unary_rpc_method_handler( servicer.WhoAmI, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.WhoAmIRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.WhoAmIResponse.SerializeToString, ), 'GetRolesForPermission': grpc.unary_unary_rpc_method_handler( servicer.GetRolesForPermission, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRolesForPermissionRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRolesForPermissionResponse.SerializeToString, ), 'ModifyRoleBinding': grpc.unary_unary_rpc_method_handler( servicer.ModifyRoleBinding, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyRoleBindingRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyRoleBindingResponse.SerializeToString, ), 'GetRoleBinding': grpc.unary_unary_rpc_method_handler( servicer.GetRoleBinding, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRoleBindingRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRoleBindingResponse.SerializeToString, ), 'GetOIDCLogin': grpc.unary_unary_rpc_method_handler( servicer.GetOIDCLogin, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetOIDCLoginRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetOIDCLoginResponse.SerializeToString, ), 'GetRobotToken': grpc.unary_unary_rpc_method_handler( servicer.GetRobotToken, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRobotTokenRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRobotTokenResponse.SerializeToString, ), 'RevokeAuthToken': grpc.unary_unary_rpc_method_handler( servicer.RevokeAuthToken, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokenRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokenResponse.SerializeToString, ), 'RevokeAuthTokensForUser': grpc.unary_unary_rpc_method_handler( servicer.RevokeAuthTokensForUser, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokensForUserRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokensForUserResponse.SerializeToString, ), 'SetGroupsForUser': grpc.unary_unary_rpc_method_handler( servicer.SetGroupsForUser, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetGroupsForUserRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetGroupsForUserResponse.SerializeToString, ), 'ModifyMembers': grpc.unary_unary_rpc_method_handler( servicer.ModifyMembers, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyMembersRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyMembersResponse.SerializeToString, ), 'GetGroups': grpc.unary_unary_rpc_method_handler( servicer.GetGroups, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsResponse.SerializeToString, ), 'GetGroupsForPrincipal': grpc.unary_unary_rpc_method_handler( servicer.GetGroupsForPrincipal, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsForPrincipalRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsResponse.SerializeToString, ), 'GetUsers': grpc.unary_unary_rpc_method_handler( servicer.GetUsers, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetUsersRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetUsersResponse.SerializeToString, ), 'ExtractAuthTokens': grpc.unary_unary_rpc_method_handler( servicer.ExtractAuthTokens, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ExtractAuthTokensRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ExtractAuthTokensResponse.SerializeToString, ), 'RestoreAuthToken': grpc.unary_unary_rpc_method_handler( servicer.RestoreAuthToken, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RestoreAuthTokenRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RestoreAuthTokenResponse.SerializeToString, ), 'DeleteExpiredAuthTokens': grpc.unary_unary_rpc_method_handler( servicer.DeleteExpiredAuthTokens, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeleteExpiredAuthTokensRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeleteExpiredAuthTokensResponse.SerializeToString, ), 'RotateRootToken': grpc.unary_unary_rpc_method_handler( servicer.RotateRootToken, request_deserializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RotateRootTokenRequest.FromString, response_serializer=python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RotateRootTokenResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'auth_v2.API', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class API(object): """Missing associated documentation comment in .proto file.""" @staticmethod def Activate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/Activate', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ActivateRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ActivateResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Deactivate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/Deactivate', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeactivateRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeactivateResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetConfiguration(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetConfiguration', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetConfigurationRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetConfigurationResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetConfiguration(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/SetConfiguration', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetConfigurationRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetConfigurationResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Authenticate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/Authenticate', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthenticateRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthenticateResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Authorize(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/Authorize', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthorizeRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.AuthorizeResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetPermissions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetPermissions', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetPermissionsForPrincipal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetPermissionsForPrincipal', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsForPrincipalRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetPermissionsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def WhoAmI(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/WhoAmI', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.WhoAmIRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.WhoAmIResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetRolesForPermission(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetRolesForPermission', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRolesForPermissionRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRolesForPermissionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ModifyRoleBinding(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/ModifyRoleBinding', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyRoleBindingRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyRoleBindingResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetRoleBinding(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetRoleBinding', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRoleBindingRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRoleBindingResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetOIDCLogin(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetOIDCLogin', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetOIDCLoginRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetOIDCLoginResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetRobotToken(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetRobotToken', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRobotTokenRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetRobotTokenResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RevokeAuthToken(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/RevokeAuthToken', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokenRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokenResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RevokeAuthTokensForUser(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/RevokeAuthTokensForUser', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokensForUserRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RevokeAuthTokensForUserResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetGroupsForUser(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/SetGroupsForUser', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetGroupsForUserRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.SetGroupsForUserResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ModifyMembers(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/ModifyMembers', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyMembersRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ModifyMembersResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetGroups(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetGroups', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetGroupsForPrincipal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetGroupsForPrincipal', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsForPrincipalRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetGroupsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetUsers(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/GetUsers', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetUsersRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.GetUsersResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExtractAuthTokens(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/ExtractAuthTokens', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ExtractAuthTokensRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.ExtractAuthTokensResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RestoreAuthToken(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/RestoreAuthToken', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RestoreAuthTokenRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RestoreAuthTokenResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DeleteExpiredAuthTokens(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/DeleteExpiredAuthTokens', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeleteExpiredAuthTokensRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.DeleteExpiredAuthTokensResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RotateRootToken(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/auth_v2.API/RotateRootToken', python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RotateRootTokenRequest.SerializeToString, python__pachyderm_dot_proto_dot_v2_dot_auth_dot_auth__pb2.RotateRootTokenResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
54.484919
148
0.70732
4,647
46,966
6.635679
0.037874
0.068556
0.088144
0.112628
0.880108
0.880108
0.859028
0.82822
0.826469
0.822772
0
0.009823
0.23055
46,966
861
149
54.5482
0.843461
0.04235
0
0.540682
1
0
0.065237
0.032741
0
0
0
0
0
1
0.068241
false
0
0.002625
0.032808
0.107612
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c5340cbdf2092864cf43c159593e4f507f7a3262
150
py
Python
plugins/grr/icon_grr/actions/__init__.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
46
2019-06-05T20:47:58.000Z
2022-03-29T10:18:01.000Z
plugins/grr/icon_grr/actions/__init__.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
386
2019-06-07T20:20:39.000Z
2022-03-30T17:35:01.000Z
plugins/grr/icon_grr/actions/__init__.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
43
2019-07-09T14:13:58.000Z
2022-03-28T12:04:46.000Z
# GENERATED BY KOMAND SDK - DO NOT EDIT from .hunting.action import Hunting from .labeling.action import Labeling from .listing.action import Listing
30
39
0.806667
22
150
5.5
0.590909
0.297521
0
0
0
0
0
0
0
0
0
0
0.14
150
4
40
37.5
0.937985
0.246667
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
c57566645f2f3a46b41967e520c4df6340b46eb4
5,538
py
Python
SearchAI.py
IgorPidik/EasySearchAI
76330404c779459c09ce79c7445e0a43a98c10ec
[ "Apache-2.0" ]
null
null
null
SearchAI.py
IgorPidik/EasySearchAI
76330404c779459c09ce79c7445e0a43a98c10ec
[ "Apache-2.0" ]
null
null
null
SearchAI.py
IgorPidik/EasySearchAI
76330404c779459c09ce79c7445e0a43a98c10ec
[ "Apache-2.0" ]
null
null
null
__author__ = 'igor' from abc import ABCMeta, abstractmethod from util import * class SearchProblem(object): __metaclass__ = ABCMeta @abstractmethod def __init__(self, goal=None): pass @abstractmethod def setGoal(self, goal): pass @abstractmethod def getGoal(self): pass @abstractmethod def isGoal(self, state): pass @abstractmethod def getPossibleActions(self, state): pass @abstractmethod def getActionCost(self, action): return 1 @abstractmethod def getSuccessor(self, state, action): pass @abstractmethod def heuristic(self, state): pass # # in case you need list with overridden functions(for example contains) otherwise use default list # @abstractmethod # def getNewList(self): # return [] class DFS(object): def __init__(self, problem=None): self.problem = None if problem: self.problem = problem def setProblem(self, problem): self.problem = problem def getPlan(self, initState): if not self.problem: raise ValueError("problem undefined") states = Stack() expanded = [] states.append(initState) while len(states) > 0: print("states len", len(states)) (state, actions, cost) = states.pop() print state if state not in expanded: expanded.append(state) if self.problem.isGoal(state): return actions for action in self.problem.getPossibleActions(state): newState = self.problem.getSuccessor(state, action) newActions = actions + [action] newCost = 0 #cost is irrelevant for DFS states.append((newState, newActions, newCost)) raise ValueError("failure") return [] class BFS(object): def __init__(self, problem=None): self.problem = None if problem: self.problem = problem def setProblem(self, problem): self.problem = problem def getPlan(self, initState): if not self.problem: raise ValueError("problem undefined") states = Queue() expanded = [] states.append(initState) while len(states) > 0: print("states len", len(states)) (state, actions, cost) = states.pop() print state if state not in expanded: expanded.append(state) if self.problem.isGoal(state): print "goal:" print state return actions for action in self.problem.getPossibleActions(state): newState = self.problem.getSuccessor(state, action) newActions = actions + [action] newCost = self.problem.heuristic(newState) + self.problem.getActionCost(action) states.append((newState, newActions, newCost)) raise ValueError("failure") return [] class UCS(object): def __init__(self, problem=None): self.problem = None if problem: self.problem = problem def setProblem(self, problem): self.problem = problem def getPlan(self, initState): if not self.problem: raise ValueError("problem undefined") states = PriorityQueue() expanded = [] states.append(initState) while len(states) > 0: print("states len", len(states)) (state, actions, cost) = states.pop() if state not in expanded: expanded.append(state) print state if self.problem.isGoal(state): print "goal:" print state return actions for action in self.problem.getPossibleActions(state): newState = self.problem.getSuccessor(state, action) newActions = actions + [action] newCost = self.problem.getActionCost(action) + cost states.append((newState, newActions, newCost)) raise ValueError("failure") return [] class AStar(object): def __init__(self, problem=None): self.problem = None if problem: self.problem = problem def setProblem(self, problem): self.problem = problem def getPlan(self, initState): if not self.problem: raise ValueError("problem undefined") states = PriorityQueue() expanded = [] states.append(initState) while len(states) > 0: print("states len", len(states)) (state, actions, cost) = states.pop() if state not in expanded: expanded.append(state) if self.problem.isGoal(state): print "goal:" print state return actions for action in self.problem.getPossibleActions(state): newState = self.problem.getSuccessor(state, action) newActions = actions + [action] newCost = self.problem.heuristic(newState) + self.problem.getActionCost(action) states.append((newState, newActions, newCost)) raise ValueError("failure") return []
28.111675
108
0.55056
514
5,538
5.877432
0.14786
0.149288
0.039722
0.066203
0.814962
0.795101
0.795101
0.795101
0.795101
0.795101
0
0.001702
0.363489
5,538
196
109
28.255102
0.855319
0.031419
0
0.849315
0
0
0.02894
0
0
0
0
0
0
0
null
null
0.047945
0.013699
null
null
0.089041
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
3d8406705c7536921d51216b697f3b2f05864e4c
4,570
py
Python
examples/paper_examples/posterior_estimation_HPEC2021/experiments/mnist_models.py
omriarad/mcas
f47aab12754c91ebd75b0e1881c8a7cc7aa81278
[ "Apache-2.0" ]
60
2020-04-28T08:15:07.000Z
2022-03-08T10:35:15.000Z
examples/paper_examples/posterior_estimation_HPEC2021/experiments/mnist_models.py
omriarad/mcas
f47aab12754c91ebd75b0e1881c8a7cc7aa81278
[ "Apache-2.0" ]
66
2020-09-03T23:40:48.000Z
2022-03-07T20:34:52.000Z
examples/paper_examples/posterior_estimation_HPEC2021/experiments/mnist_models.py
omriarad/mcas
f47aab12754c91ebd75b0e1881c8a7cc7aa81278
[ "Apache-2.0" ]
13
2019-11-02T06:30:36.000Z
2022-01-26T01:56:42.000Z
""" Description: Author : Andrew Wood Author_email: dewood@bu.edu License : Apache License, Version 2.0 """ # SYSTEM IMPORTS from typing import List from tqdm import tqdm import argparse import numpy as np import os import sys import torch as pt import torch.nn.functional as F class Model_2Conv2FC(pt.nn.Module): def __init__(self): super().__init__() self.conv1 = pt.nn.Conv2d(1, 10, kernel_size=5) self.conv2 = pt.nn.Conv2d(10, 20, kernel_size=5) self.conv2_drop = pt.nn.Dropout2d() self.fc1 = pt.nn.Linear(320, 50) self.fc2 = pt.nn.Linear(50, 10) def forward(self, x: pt.Tensor): x = F.relu(F.max_pool2d(self.conv1(x), 2)) x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2)) x = x.view(-1, 320) x = F.relu(self.fc1(x)) x = F.dropout(x, training=self.training) x = self.fc2(x) return F.log_softmax(x, -1) def get_params(self) -> np.ndarray: params_list: List[np.ndarray] = list() for P in self.parameters(): params_list.append(P.cpu().detach().numpy().reshape(-1)) return np.hstack(params_list).reshape(-1,1) def set_params(self, theta: np.ndarray) -> None: param_idx: int = 0 for P in self.parameters(): if len(P.size() > 0): num_params: int = np.prod(P.size()) P.copy_(theta[param_idx:param_idx+num_params] .reshape(P.size())) param_idx += num_params class Model_2FC(pt.nn.Module): def __init__(self): super().__init__() self.fc1 = pt.nn.Linear(28*28, 1000) self.fc2 = pt.nn.Linear(1000, 10) def forward(self, x: pt.Tensor): x = F.relu(self.fc1(x)) x = self.fc2(x) return F.log_softmax(x, -1) def get_params(self) -> np.ndarray: params_list: List[np.ndarray] = list() for P in self.parameters(): params_list.append(P.cpu().detach().numpy().reshape(-1)) return np.hstack(params_list).reshape(-1,1) def set_params(self, theta: np.ndarray) -> None: param_idx: int = 0 for P in self.parameters(): if len(P.size() > 0): num_params: int = np.prod(P.size()) P.copy_(theta[param_idx:param_idx+num_params] .reshape(P.size())) param_idx += num_params class Model_3FC(pt.nn.Module): def __init__(self): super().__init__() self.fc1 = pt.nn.Linear(28*28, 1000) self.fc2 = pt.nn.Linear(1000, 500) self.fc3 = pt.nn.Linear(500, 10) def forward(self, x: pt.Tensor): x = F.relu(self.fc1(x)) x = F.relu(self.fc2(x)) x = self.fc3(x) return F.log_softmax(x, -1) def get_params(self) -> np.ndarray: params_list: List[np.ndarray] = list() for P in self.parameters(): params_list.append(P.cpu().detach().numpy().reshape(-1)) return np.hstack(params_list).reshape(-1,1) def set_params(self, theta: np.ndarray) -> None: param_idx: int = 0 for P in self.parameters(): if len(P.size() > 0): num_params: int = np.prod(P.size()) P.copy_(theta[param_idx:param_idx+num_params] .reshape(P.size())) param_idx += num_params class Model_4FC(pt.nn.Module): def __init__(self): super().__init__() self.fc1 = pt.nn.Linear(28*28, 1000) self.fc2 = pt.nn.Linear(1000, 1000) self.fc3 = pt.nn.Linear(1000, 1000) self.fc4 = pt.nn.Linear(1000, 10) def forward(self, x: pt.Tensor): x = F.relu(self.fc1(x)) x = F.relu(self.fc2(x)) x = F.relu(self.fc3(x)) x = self.fc4(x) return F.log_softmax(x, -1) def get_params(self) -> np.ndarray: params_list: List[np.ndarray] = list() for P in self.parameters(): params_list.append(P.cpu().detach().numpy().reshape(-1)) return np.hstack(params_list).reshape(-1,1) def set_params(self, theta: np.ndarray) -> None: param_idx: int = 0 for P in self.parameters(): if len(P.size() > 0): num_params: int = np.prod(P.size()) P.copy_(theta[param_idx:param_idx+num_params] .reshape(P.size())) param_idx += num_params
31.517241
68
0.543982
652
4,570
3.661043
0.150307
0.030163
0.046083
0.033515
0.835777
0.792627
0.780059
0.765815
0.759112
0.744868
0
0.048315
0.311597
4,570
144
69
31.736111
0.710426
0.027352
0
0.74359
0
0
0
0
0
0
0
0
0
1
0.136752
false
0
0.068376
0
0.307692
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3dcd1ded417201b9356677350469028e0ee97abf
68,458
py
Python
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/data/opls_unict_dat.py
J-E-J-S/aaRS-Pipeline
43f59f28ab06e4b16328c3bc405cdddc6e69ac44
[ "MIT" ]
9
2021-03-06T04:24:28.000Z
2022-01-03T09:53:07.000Z
MolKit/data/opls_unict_dat.py
e-mayo/autodocktools-prepare-py3k
2dd2316837bcb7c19384294443b2855e5ccd3e01
[ "BSD-3-Clause" ]
3
2021-03-07T05:37:16.000Z
2021-09-19T15:06:54.000Z
MolKit/data/opls_unict_dat.py
e-mayo/autodocktools-prepare-py3k
2dd2316837bcb7c19384294443b2855e5ccd3e01
[ "BSD-3-Clause" ]
4
2019-08-28T23:11:39.000Z
2021-11-27T08:43:36.000Z
opls_unict_dat = { "PHU": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'CE1', 'CZ', 'CE2', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CE1":{'torsion': 180.0, 'tree': 'S', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "CD1":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CZ":{'torsion': 0.0, 'tree': 'S', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': 0.0, 'type': 'CA'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CE2":{'torsion': 0.0, 'tree': 'S', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 10, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'PHENYLALANINE, UNITED ATOM AROMATIC PARAMETERS, COO- ANION', }, "ASN": { "ND2":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 10, 'angle': 116.6, 'blen': 1.335, 'charge': -0.85, 'type': 'N'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'OD1', 'ND2', 'HND1', 'HND2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 13, 'I': 14, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "OD1":{'torsion': 0.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 120.5, 'blen': 1.229, 'charge': -0.5, 'type': 'O'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CB', 'ND2', 'CG', 'OD1'], ['CG', 'HND1', 'ND2', 'HND2'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'B', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 111.1, 'blen': 1.522, 'charge': 0.5, 'type': 'C'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HND1":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 10, 'I': 11, 'angle': 119.8, 'blen': 1.01, 'charge': 0.425, 'type': 'H'}, "HND2":{'torsion': 180.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 10, 'I': 12, 'angle': 119.8, 'blen': 1.01, 'charge': 0.425, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 13, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 13, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'ASPARAGINE COO- ANION', }, "TYU": { "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "OH":{'torsion': 180.0, 'tree': 'S', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.36, 'charge': -0.7, 'type': 'OH'}, "loopList":[['CG', 'CD2']], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 10, 'NB': 11, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "NAMRES":'TYROSINE, UNITED ATOM AROMATIC PARAMETERS, COO- ANION', "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'CE1', 'CZ', 'OH', 'HOH', 'CE2', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "HOH":{'torsion': 0.0, 'tree': 'E', 'NC': 10, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 113.0, 'blen': 0.96, 'charge': 0.435, 'type': 'HO'}, "CE1":{'torsion': 180.0, 'tree': 'S', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "CD1":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CZ":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 120.0, 'blen': 1.4, 'charge': 0.265, 'type': 'CA'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.51, 'charge': 0.0, 'type': 'CA'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CE2":{'torsion': 0.0, 'tree': 'S', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 14, 'angle': 120.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 16, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "HIP": { "NE2":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 13, 'angle': 109.0, 'blen': 1.31, 'charge': -0.54, 'type': 'NA'}, "ND1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 122.0, 'blen': 1.39, 'charge': -0.54, 'type': 'NA'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O'], ['CG', 'CE1', 'ND1', 'HND'], ['CE1', 'CD2', 'NE2', 'HNE']], "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2']], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 15, 'angle': 110.0, 'blen': 1.36, 'charge': 0.215, 'type': 'CK'}, "NAMRES":'HISTIDINE PLUS ZWITTERION, ALL ATOM AROMATIC PARAMETERS', "HE":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HD":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 13, 'NA': 15, 'I': 16, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'ND1', 'HND', 'CE1', 'HE', 'NE2', 'HNE', 'CD2', 'HD', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 108.0, 'blen': 1.32, 'charge': 0.385, 'type': 'CK'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 17, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': 0.215, 'type': 'CK'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.115, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 17, 'I': 19, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O'}, "HND":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 126.0, 'blen': 1.01, 'charge': 0.46, 'type': 'H'}, "HNE":{'torsion': 180.0, 'tree': 'E', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 125.0, 'blen': 1.01, 'charge': 0.46, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 17, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "ARG": { "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['NE', 'NH1', 'CZ', 'NH2'], ['CA', 'OXT', 'C', 'O']], "NH1":{'torsion': 0.0, 'tree': 'B', 'NC': 9, 'NB': 10, 'NA': 12, 'I': 13, 'angle': 122.0, 'blen': 1.33, 'charge': -0.8, 'type': 'N2'}, "HN12":{'torsion': 180.0, 'tree': 'E', 'NC': 10, 'NB': 12, 'NA': 13, 'I': 15, 'angle': 119.8, 'blen': 1.01, 'charge': 0.46, 'type': 'H3'}, "INTX,KFORM":['INT', '1'], "NE":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 111.0, 'blen': 1.48, 'charge': -0.7, 'type': 'N2'}, "HN11":{'torsion': 0.0, 'tree': 'E', 'NC': 10, 'NB': 12, 'NA': 13, 'I': 14, 'angle': 119.8, 'blen': 1.01, 'charge': 0.46, 'type': 'H3'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HN22":{'torsion': 180.0, 'tree': 'E', 'NC': 10, 'NB': 12, 'NA': 16, 'I': 18, 'angle': 119.8, 'blen': 1.01, 'charge': 0.46, 'type': 'H3'}, "HN21":{'torsion': 0.0, 'tree': 'E', 'NC': 10, 'NB': 12, 'NA': 16, 'I': 17, 'angle': 119.8, 'blen': 1.01, 'charge': 0.46, 'type': 'H3'}, "NAMRES":'ARGININE COO- ANION', "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD', 'NE', 'HNE', 'CZ', 'NH1', 'HN11', 'HN12', 'NH2', 'HN21', 'HN22', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "NH2":{'torsion': 180.0, 'tree': 'B', 'NC': 9, 'NB': 10, 'NA': 12, 'I': 16, 'angle': 118.0, 'blen': 1.33, 'charge': -0.8, 'type': 'N2'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CZ":{'torsion': 180.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 12, 'angle': 123.0, 'blen': 1.33, 'charge': 0.64, 'type': 'C'}, "CD":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 109.47, 'blen': 1.525, 'charge': 0.3, 'type': 'C2'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.08, 'type': 'C2'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 19, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "HNE":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 118.5, 'blen': 1.01, 'charge': 0.44, 'type': 'H3'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 19, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "LEU": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CD1', 'CG', 'CB', 'CD2'], ['CA', 'OXT', 'C', 'O']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CD2":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 10, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "CD1":{'torsion': 60.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'B', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'CZ'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 11, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'LEUCINE COO- ANION', }, "HID": { "NE2":{'torsion': 0.0, 'tree': 'S', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 13, 'angle': 109.0, 'blen': 1.31, 'charge': -0.49, 'type': 'NB'}, "ND1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 122.0, 'blen': 1.39, 'charge': -0.57, 'type': 'NA'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O'], ['CG', 'CE1', 'ND1', 'HND']], "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2']], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 110.0, 'blen': 1.36, 'charge': -0.015, 'type': 'CK'}, "NAMRES":'HISTIDINE DELTAH COO- ANION, ALL ATOM AROMATIC PARAMETERS', "HE":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HD":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 13, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'ND1', 'HND', 'CE1', 'HE', 'NE2', 'CD2', 'HD', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 108.0, 'blen': 1.32, 'charge': 0.295, 'type': 'CK'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': 0.015, 'type': 'CK'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.115, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "HND":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 126.0, 'blen': 1.01, 'charge': 0.42, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 16, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "HIE": { "NE2":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 12, 'angle': 109.0, 'blen': 1.31, 'charge': -0.57, 'type': 'NA'}, "ND1":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 122.0, 'blen': 1.39, 'charge': -0.49, 'type': 'NB'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O'], ['CE1', 'CD2', 'NE2', 'HNE']], "INTX,KFORM":['INT', '1'], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2']], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 9, 'NB': 10, 'NA': 12, 'I': 14, 'angle': 110.0, 'blen': 1.36, 'charge': 0.015, 'type': 'CK'}, "NAMRES":'HISTIDINE EPSILONH COO- ANION, ALL ATOM AROMATIC PARAMETERS', "HE":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HD":{'torsion': 180.0, 'tree': 'E', 'NC': 10, 'NB': 12, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'ND1', 'CE1', 'HE', 'NE2', 'HNE', 'CD2', 'HD', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 108.0, 'blen': 1.32, 'charge': 0.295, 'type': 'CK'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': -0.015, 'type': 'CK'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.115, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 16, 'I': 18, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "HNE":{'torsion': 180.0, 'tree': 'E', 'NC': 9, 'NB': 10, 'NA': 12, 'I': 13, 'angle': 125.0, 'blen': 1.01, 'charge': 0.42, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 16, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "MET": { "SD":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 110.0, 'blen': 1.81, 'charge': -0.47, 'type': 'S'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'SD', 'CE', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.235, 'type': 'CQ'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CE":{'torsion': 180.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 100.0, 'blen': 1.78, 'charge': 0.235, 'type': 'CW'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 11, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'METHIONINE COO- ANION', }, "IDBGEN,IREST,ITYPF":['1', '1', '301'], "ALA": { "atNameList":['N', 'HN', 'CA', 'CB', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 9, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'E', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 8, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 8, 'I': 10, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'ALANINE COO- ANION', }, "PHE": { "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "INTX,KFORM":['INT', '1'], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 11, 'NB': 13, 'NA': 15, 'I': 17, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 13, 'NB': 15, 'NA': 17, 'I': 18, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 13, 'NA': 15, 'I': 16, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "NAMRES":'PHENYLALANINE, ALL ATOM AROMATIC PARAMETERS, COO- ANION', "CD1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'HD1', 'CE1', 'HE1', 'CZ', 'HZ', 'CE2', 'HE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "CE2":{'torsion': 0.0, 'tree': 'B', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 15, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CZ":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 13, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': -0.115, 'type': 'CK'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.115, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "HZ":{'torsion': 180.0, 'tree': 'E', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, }, "AME": { "CT":{'torsion': 180.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.2, 'type': 'CW'}, "INTX,KFORM":['INT', '1'], "atNameList":['NT', 'HN', 'CT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CUT":['0.00000'], "NT":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "NAMRES":'TERMINAL METHYL AMIDE, OPLS MODEL', }, "CYX": { "atNameList":['N', 'HN', 'CA', 'CB', 'SG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "SG":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 116.0, 'blen': 1.81, 'charge': -0.3, 'type': 'S'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 9, 'I': 10, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.3, 'type': 'CQ'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 9, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 9, 'I': 11, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'CYSTINE(S-S BRIDGE) COO- ANION', }, "PRO": { "atNameList":['N', 'CD', 'CG', 'CB', 'CA', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CUT":['0.00000'], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['CB', 'CA', 'N', 'C'], ['-M', 'CA', 'N', 'CD'], ['CA', 'OXT', 'C', 'O']], "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 117.0, 'blen': 1.337, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 200.1, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 5, 'I': 6, 'angle': 103.2, 'blen': 1.5, 'charge': 0.0, 'type': 'C2'}, "CA":{'torsion': 175.2, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 8, 'angle': 120.6, 'blen': 1.451, 'charge': 0.185, 'type': 'CH'}, "CB":{'torsion': 338.3, 'tree': 'E', 'NC': 4, 'NB': 5, 'NA': 6, 'I': 7, 'angle': 106.0, 'blen': 1.51, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CB', 'CA']], "CD":{'torsion': 356.1, 'tree': 'S', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 126.1, 'blen': 1.458, 'charge': 0.285, 'type': 'CQ'}, "C":{'torsion': 0.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 8, 'I': 9, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'PROLINE COO- ANION', }, "LYS": { "HNZ3":{'torsion': 300.0, 'tree': 'E', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 14, 'angle': 109.47, 'blen': 1.01, 'charge': 0.33, 'type': 'H3'}, "HNZ2":{'torsion': 180.0, 'tree': 'E', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 13, 'angle': 109.47, 'blen': 1.01, 'charge': 0.33, 'type': 'H3'}, "HNZ1":{'torsion': 60.0, 'tree': 'E', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 12, 'angle': 109.47, 'blen': 1.01, 'charge': 0.33, 'type': 'H3'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD', 'CE', 'NZ', 'HNZ1', 'HNZ2', 'HNZ3', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 15, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CD":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "NZ":{'torsion': 180.0, 'tree': '3', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 109.47, 'blen': 1.47, 'charge': -0.3, 'type': 'N3'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CE":{'torsion': 180.0, 'tree': 'S', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 109.47, 'blen': 1.525, 'charge': 0.31, 'type': 'C2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 15, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 15, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'LYSINE COO- ANION', }, "NAMDBF":'db4.dat', "SER": { "OG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.43, 'charge': -0.7, 'type': 'OH'}, "atNameList":['N', 'HN', 'CA', 'CB', 'OG', 'HOG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 10, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 10, 'I': 11, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.265, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 10, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "HOG":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 109.47, 'blen': 0.96, 'charge': 0.435, 'type': 'HO'}, "NAMRES":'SERINE COO- ANION', }, "ASP": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'OD1', 'OD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "OD1":{'torsion': 90.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 117.2, 'blen': 1.26, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CB', 'OD1', 'CG', 'OD2'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'B', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.527, 'charge': 0.7, 'type': 'C'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': -0.1, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "OD2":{'torsion': 270.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 10, 'angle': 117.2, 'blen': 1.26, 'charge': -0.8, 'type': 'O2'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 11, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'ASPARTIC ACID COO- ANION', }, "GLN": { "OE1":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.5, 'blen': 1.229, 'charge': -0.5, 'type': 'O'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD', 'OE1', 'NE2', 'HNE1', 'HNE2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "NE2":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 116.6, 'blen': 1.335, 'charge': -0.85, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CD":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 111.1, 'blen': 1.522, 'charge': 0.5, 'type': 'C'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CG', 'NE2', 'CD', 'OE1'], ['CD', 'HNE1', 'NE2', 'HNE2'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "HNE2":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 13, 'angle': 119.8, 'blen': 1.01, 'charge': 0.425, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HNE1":{'torsion': 0.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 119.8, 'blen': 1.01, 'charge': 0.425, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'GLUTAMINE COO- ANION', }, "GLU": { "OE1":{'torsion': 90.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 117.2, 'blen': 1.26, 'charge': -0.8, 'type': 'O2'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD', 'OE1', 'OE2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 12, 'I': 14, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 12, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CD":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 109.47, 'blen': 1.527, 'charge': 0.7, 'type': 'C'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CG', 'OE1', 'CD', 'OE2'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.51, 'charge': -0.1, 'type': 'C2'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 12, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OE2":{'torsion': 270.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 117.2, 'blen': 1.26, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'GLUTAMIC ACID COO- ANION', }, "TRU": { "NE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 107.0, 'blen': 1.43, 'charge': -0.57, 'type': 'NA'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 18, 'I': 20, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "CH2":{'torsion': 180.0, 'tree': 'S', 'NC': 10, 'NB': 12, 'NA': 13, 'I': 14, 'angle': 116.0, 'blen': 1.39, 'charge': 0.0, 'type': 'CD'}, "CZ2":{'torsion': 180.0, 'tree': 'S', 'NC': 9, 'NB': 10, 'NA': 12, 'I': 13, 'angle': 128.0, 'blen': 1.4, 'charge': 0.0, 'type': 'CD'}, "INTX,KFORM":['INT', '1'], "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2'], ['CE2', 'CD2']], "NAMRES":'TRYPTOPHAN COO- ANION, UNITED ATOM AROMATIC PARAMETERS', "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'NE1', 'HNE', 'CE2', 'CZ2', 'CH2', 'CZ3', 'CE3', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 14, 'NB': 15, 'NA': 16, 'I': 17, 'angle': 117.0, 'blen': 1.4, 'charge': -0.055, 'type': 'CB'}, "CD1":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 127.0, 'blen': 1.34, 'charge': 0.13, 'type': 'CG'}, "CE3":{'torsion': 0.0, 'tree': 'S', 'NC': 13, 'NB': 14, 'NA': 15, 'I': 16, 'angle': 122.0, 'blen': 1.41, 'charge': 0.0, 'type': 'CD'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 18, 'I': 19, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': -0.055, 'type': 'C*'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CZ3":{'torsion': 0.0, 'tree': 'S', 'NC': 12, 'NB': 13, 'NA': 14, 'I': 15, 'angle': 121.0, 'blen': 1.35, 'charge': 0.0, 'type': 'CD'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CE2":{'torsion': 0.0, 'tree': 'S', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 12, 'angle': 109.0, 'blen': 1.31, 'charge': 0.13, 'type': 'CN'}, "HNE":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 125.5, 'blen': 1.01, 'charge': 0.42, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 18, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "TRP": { "NE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 107.0, 'blen': 1.43, 'charge': -0.57, 'type': 'NA'}, "CE3":{'torsion': 0.0, 'tree': 'B', 'NC': 14, 'NB': 16, 'NA': 18, 'I': 20, 'angle': 122.0, 'blen': 1.41, 'charge': -0.115, 'type': 'CK'}, "HZ2":{'torsion': 180.0, 'tree': 'E', 'NC': 14, 'NB': 16, 'NA': 18, 'I': 19, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O'], ['CD1', 'CE2', 'NE1', 'HNE'], ['CE2', 'CH2', 'CZ2', 'HZ1'], ['CZ2', 'CZ3', 'CH2', 'HH'], ['CH2', 'CE3', 'CZ3', 'HZ2'], ['CZ3', 'CD2', 'CE3', 'HE']], "HZ1":{'torsion': 0.0, 'tree': 'E', 'NC': 11, 'NB': 13, 'NA': 14, 'I': 15, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "CH2":{'torsion': 180.0, 'tree': 'B', 'NC': 11, 'NB': 13, 'NA': 14, 'I': 16, 'angle': 116.0, 'blen': 1.39, 'charge': -0.115, 'type': 'CK'}, "INTX,KFORM":['INT', '1'], "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.115, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 23, 'I': 25, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'TRYPTOPHAN COO- ANION, ALL ATOM AROMATIC PARAMETERS', "HE":{'torsion': 180.0, 'tree': 'E', 'NC': 16, 'NB': 18, 'NA': 20, 'I': 21, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HD":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'HD', 'NE1', 'HNE', 'CE2', 'CZ2', 'HZ1', 'CH2', 'HH', 'CZ3', 'HZ2', 'CE3', 'HE', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "loopList":[['CG', 'CD2'], ['CE2', 'CD2']], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 16, 'NB': 18, 'NA': 20, 'I': 22, 'angle': 117.0, 'blen': 1.4, 'charge': -0.055, 'type': 'CB'}, "CD1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 127.0, 'blen': 1.34, 'charge': 0.015, 'type': 'CK'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "HH":{'torsion': 180.0, 'tree': 'E', 'NC': 13, 'NB': 14, 'NA': 16, 'I': 17, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 23, 'I': 24, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': -0.17, 'type': 'CK'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CZ3":{'torsion': 0.0, 'tree': 'B', 'NC': 13, 'NB': 14, 'NA': 16, 'I': 18, 'angle': 121.0, 'blen': 1.35, 'charge': -0.115, 'type': 'CK'}, "CZ2":{'torsion': 180.0, 'tree': 'B', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 128.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "CE2":{'torsion': 0.0, 'tree': 'S', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 13, 'angle': 109.0, 'blen': 1.31, 'charge': 0.13, 'type': 'CN'}, "HNE":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 125.5, 'blen': 1.01, 'charge': 0.42, 'type': 'H'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 23, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "filename":'opls_unict.in', "GLY": { "atNameList":['N', 'HN', 'CA', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CQ'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 110.4, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 9, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'GLYCINE COO- ANION', }, "HPU": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'ND1', 'HND', 'CE1', 'NE2', 'HNE', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "NE2":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 109.0, 'blen': 1.31, 'charge': -0.54, 'type': 'NA'}, "ND1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 122.0, 'blen': 1.39, 'charge': -0.54, 'type': 'NA'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 15, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O'}, "CE1":{'torsion': 180.0, 'tree': 'S', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 108.0, 'blen': 1.32, 'charge': 0.5, 'type': 'CP'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 15, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': 0.33, 'type': 'CC'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2']], "HND":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 126.0, 'blen': 1.01, 'charge': 0.46, 'type': 'H'}, "HNE":{'torsion': 180.0, 'tree': 'E', 'NC': 9, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 125.0, 'blen': 1.01, 'charge': 0.46, 'type': 'H'}, "CUT":['0.00000'], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 9, 'NB': 11, 'NA': 12, 'I': 14, 'angle': 110.0, 'blen': 1.36, 'charge': 0.33, 'type': 'CG'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 15, 'I': 17, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O'}, "NAMRES":'HISTIDINE PLUS ZWITTERION, UNITED ATOM AROMATIC PARAMETERS', }, "TYR": { "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 20, 'I': 21, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "INTX,KFORM":['INT', '1'], "CD2":{'torsion': 0.0, 'tree': 'S', 'NC': 11, 'NB': 13, 'NA': 16, 'I': 18, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "OH":{'torsion': 180.0, 'tree': 'S', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 14, 'angle': 120.0, 'blen': 1.36, 'charge': -0.585, 'type': 'OH'}, "HD1":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HD2":{'torsion': 180.0, 'tree': 'E', 'NC': 13, 'NB': 16, 'NA': 18, 'I': 19, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HE1":{'torsion': 180.0, 'tree': 'E', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "HE2":{'torsion': 180.0, 'tree': 'E', 'NC': 11, 'NB': 13, 'NA': 16, 'I': 17, 'angle': 120.0, 'blen': 1.09, 'charge': 0.115, 'type': 'HK'}, "NAMRES":'TYROSINE, ALL ATOM AROMATIC PARAMETERS, COO- ANION', "CD1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'CD1', 'HD1', 'CE1', 'HE1', 'CZ', 'OH', 'HOH', 'CE2', 'HE2', 'CD2', 'HD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CE1":{'torsion': 180.0, 'tree': 'B', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "CE2":{'torsion': 0.0, 'tree': 'B', 'NC': 9, 'NB': 11, 'NA': 13, 'I': 16, 'angle': 120.0, 'blen': 1.4, 'charge': -0.115, 'type': 'CK'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "CZ":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 13, 'angle': 120.0, 'blen': 1.4, 'charge': 0.15, 'type': 'CK'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "HOH":{'torsion': 0.0, 'tree': 'E', 'NC': 11, 'NB': 13, 'NA': 14, 'I': 15, 'angle': 113.0, 'blen': 0.96, 'charge': 0.435, 'type': 'HO'}, "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.51, 'charge': -0.115, 'type': 'CK'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.115, 'type': 'C2'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 20, 'I': 22, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "loopList":[['CG', 'CD2']], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 20, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, }, "CYS": { "atNameList":['N', 'HN', 'CA', 'CB', 'SG', 'HSG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "SG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 116.0, 'blen': 1.81, 'charge': -0.45, 'type': 'SH'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 10, 'I': 11, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.18, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "HSG":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 96.0, 'blen': 1.33, 'charge': 0.27, 'type': 'HS'}, "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 10, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 10, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'CYSTEINE COO- ANION', }, "THR": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG2', 'OG1', 'HOG', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CG2', 'CB', 'CA', 'OG1'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "OG1":{'torsion': 60.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 9, 'angle': 109.47, 'blen': 1.43, 'charge': -0.7, 'type': 'OH'}, "CG2":{'torsion': 300.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'B', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.265, 'type': 'CZ'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 11, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "HOG":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 9, 'I': 10, 'angle': 109.47, 'blen': 0.96, 'charge': 0.435, 'type': 'HO'}, "NAMRES":'THREONINE COO- ANION', }, "VAL": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG1', 'CG2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "CG1":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 10, 'I': 11, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CG1', 'CB', 'CA', 'CG2'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG2":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 9, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'B', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'CZ'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 10, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 10, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'VALINE', }, "ILE": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG2', 'CG1', 'CD1', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CG2', 'CB', 'CA', 'CG1'], ['CA', 'OXT', 'C', 'O']], "CG1":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 9, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 12, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CD1":{'torsion': 180.0, 'tree': 'E', 'NC': 6, 'NB': 7, 'NA': 9, 'I': 10, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'CV'}, "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG2":{'torsion': 60.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'C3'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'B', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 109.47, 'blen': 1.525, 'charge': 0.0, 'type': 'CZ'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "CUT":['0.00000'], "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 11, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 11, 'I': 13, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'ISOLEUCINE COO- ANION', }, "HDU": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'ND1', 'HND', 'CE1', 'NE2', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "NE2":{'torsion': 0.0, 'tree': 'S', 'NC': 8, 'NB': 9, 'NA': 11, 'I': 12, 'angle': 109.0, 'blen': 1.31, 'charge': -0.49, 'type': 'NB'}, "ND1":{'torsion': 180.0, 'tree': 'B', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 122.0, 'blen': 1.39, 'charge': -0.57, 'type': 'NA'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CE1":{'torsion': 180.0, 'tree': 'S', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 11, 'angle': 108.0, 'blen': 1.32, 'charge': 0.41, 'type': 'CP'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': 0.13, 'type': 'CC'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2']], "HND":{'torsion': 0.0, 'tree': 'E', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 126.0, 'blen': 1.01, 'charge': 0.42, 'type': 'H'}, "CUT":['0.00000'], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 9, 'NB': 11, 'NA': 12, 'I': 13, 'angle': 110.0, 'blen': 1.36, 'charge': 0.1, 'type': 'CF'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'HISTIDINE DELTAH COO- ANION, UNITED ATOM AROMATIC PARAMETERS', }, "HEU": { "atNameList":['N', 'HN', 'CA', 'CB', 'CG', 'ND1', 'CE1', 'NE2', 'HNE', 'CD2', 'C', 'O', 'OXT'], "DUMM":[['1', 'DUMM', 'DU', 'M', '0', '-1', '-2', '0.000', '0.000', '0.000', '0.00000'], ['2', 'DUMM', 'DU', 'M', '1', '0', '-1', '1.449', '0.000', '0.000', '0.00000'], ['3', 'DUMM', 'DU', 'M', '2', '1', '0', '1.522', '111.100', '0.000', '0.00000']], "NE2":{'torsion': 0.0, 'tree': 'B', 'NC': 8, 'NB': 9, 'NA': 10, 'I': 11, 'angle': 109.0, 'blen': 1.31, 'charge': -0.57, 'type': 'NA'}, "ND1":{'torsion': 180.0, 'tree': 'S', 'NC': 6, 'NB': 7, 'NA': 8, 'I': 9, 'angle': 122.0, 'blen': 1.39, 'charge': -0.49, 'type': 'NB'}, "O":{'torsion': 0.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 15, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "CE1":{'torsion': 180.0, 'tree': 'S', 'NC': 7, 'NB': 8, 'NA': 9, 'I': 10, 'angle': 108.0, 'blen': 1.32, 'charge': 0.41, 'type': 'CP'}, "impropTors":[['-M', 'CA', 'N', 'HN'], ['CB', 'CA', 'N', 'C'], ['CA', 'OXT', 'C', 'O']], "HN":{'torsion': 0.0, 'tree': 'E', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 5, 'angle': 119.8, 'blen': 1.01, 'charge': 0.37, 'type': 'H'}, "C":{'torsion': 180.0, 'tree': 'M', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 14, 'angle': 111.1, 'blen': 1.522, 'charge': 0.7, 'type': 'C'}, "N":{'torsion': 180.0, 'tree': 'M', 'NC': 1, 'NB': 2, 'NA': 3, 'I': 4, 'angle': 116.6, 'blen': 1.335, 'charge': -0.57, 'type': 'N'}, "INTX,KFORM":['INT', '1'], "CG":{'torsion': 180.0, 'tree': 'S', 'NC': 4, 'NB': 6, 'NA': 7, 'I': 8, 'angle': 115.0, 'blen': 1.51, 'charge': 0.1, 'type': 'CC'}, "CA":{'torsion': 180.0, 'tree': 'M', 'NC': 2, 'NB': 3, 'NA': 4, 'I': 6, 'angle': 121.9, 'blen': 1.449, 'charge': 0.1, 'type': 'CH'}, "CB":{'torsion': 60.0, 'tree': 'S', 'NC': 3, 'NB': 4, 'NA': 6, 'I': 7, 'angle': 111.1, 'blen': 1.525, 'charge': 0.0, 'type': 'C2'}, "IFIXC,IOMIT,ISYMDU,IPOS":['CORR', 'OMIT', 'DU', 'BEG'], "loopList":[['CG', 'CD2']], "HNE":{'torsion': 180.0, 'tree': 'E', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 12, 'angle': 125.0, 'blen': 1.01, 'charge': 0.42, 'type': 'H'}, "CUT":['0.00000'], "CD2":{'torsion': 0.0, 'tree': 'E', 'NC': 9, 'NB': 10, 'NA': 11, 'I': 13, 'angle': 110.0, 'blen': 1.36, 'charge': 0.13, 'type': 'CG'}, "OXT":{'torsion': 180.0, 'tree': 'E', 'NC': 4, 'NB': 6, 'NA': 14, 'I': 16, 'angle': 120.5, 'blen': 1.229, 'charge': -0.8, 'type': 'O2'}, "NAMRES":'HISTIDINE EPSILONH COO- ANION, UNITED ATOM AROMATIC PARAMETERS', }, }
109.708333
251
0.440942
12,121
68,458
2.490141
0.025328
0.085114
0.07872
0.107345
0.948945
0.939734
0.922075
0.914422
0.900142
0.891561
0
0.162484
0.148456
68,458
624
252
109.708333
0.355279
0
0
0.516026
0
0
0.352401
0.010079
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
3dd38752ee78ab6dab99bf9e76045d00d7fbebf3
164
py
Python
roles/monitoring/files/output_tds_measurements.py
CrazySerGo/sv-manager
5374afcab3566189d55966b6c677372af8ea62ca
[ "Apache-2.0" ]
null
null
null
roles/monitoring/files/output_tds_measurements.py
CrazySerGo/sv-manager
5374afcab3566189d55966b6c677372af8ea62ca
[ "Apache-2.0" ]
null
null
null
roles/monitoring/files/output_tds_measurements.py
CrazySerGo/sv-manager
5374afcab3566189d55966b6c677372af8ea62ca
[ "Apache-2.0" ]
null
null
null
from monitoring_config import config from measurement_tds_info import calculate_output_data from common import print_json print_json(calculate_output_data(config))
32.8
54
0.896341
24
164
5.75
0.541667
0.217391
0.275362
0
0
0
0
0
0
0
0
0
0.079268
164
5
55
32.8
0.913907
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
0.5
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
1
0
8
9a71ad4a189e97ad0bf9feeae8056c869e38813b
410
py
Python
test/mock/scheduler_socket_mock.py
SW511e19/card-sorter-ci
6233adeebf274aa453238ac6c6a2012a57d85e07
[ "MIT" ]
null
null
null
test/mock/scheduler_socket_mock.py
SW511e19/card-sorter-ci
6233adeebf274aa453238ac6c6a2012a57d85e07
[ "MIT" ]
null
null
null
test/mock/scheduler_socket_mock.py
SW511e19/card-sorter-ci
6233adeebf274aa453238ac6c6a2012a57d85e07
[ "MIT" ]
null
null
null
class SchedulerSocket(): def __init__(self): pass def socket_if_card_request(self): return def socket_if_card_receive(self): return True def socket_get_placement_request(self): return def socket_get_placement_receive(self): return "1" def socket_place_cc_request(self): return def socket_place_cc_receive(self): return
17.826087
43
0.653659
50
410
4.92
0.36
0.219512
0.207317
0.243902
0.317073
0
0
0
0
0
0
0.003401
0.282927
410
22
44
18.636364
0.833333
0
0
0.266667
0
0
0.002445
0
0
0
0
0
0
1
0.466667
false
0.066667
0
0.4
0.933333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
7
b100bd77374d16856901fe9f31cc3983acf6b4bd
14,738
py
Python
sdk/python/pulumi_snowflake/network_policy.py
Hacker0x01/pulumi-snowflake
f6ebcf2c3f73b103a7c2001fae231998ce1323b2
[ "ECL-2.0", "Apache-2.0" ]
3
2021-07-01T17:03:33.000Z
2022-03-01T19:29:04.000Z
sdk/python/pulumi_snowflake/network_policy.py
Hacker0x01/pulumi-snowflake
f6ebcf2c3f73b103a7c2001fae231998ce1323b2
[ "ECL-2.0", "Apache-2.0" ]
102
2021-07-14T13:12:58.000Z
2022-03-31T18:34:04.000Z
sdk/python/pulumi_snowflake/network_policy.py
Hacker0x01/pulumi-snowflake
f6ebcf2c3f73b103a7c2001fae231998ce1323b2
[ "ECL-2.0", "Apache-2.0" ]
1
2022-03-25T07:24:45.000Z
2022-03-25T07:24:45.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities __all__ = ['NetworkPolicyArgs', 'NetworkPolicy'] @pulumi.input_type class NetworkPolicyArgs: def __init__(__self__, *, allowed_ip_lists: pulumi.Input[Sequence[pulumi.Input[str]]], blocked_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, comment: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a NetworkPolicy resource. :param pulumi.Input[Sequence[pulumi.Input[str]]] allowed_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account :param pulumi.Input[Sequence[pulumi.Input[str]]] blocked_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` :param pulumi.Input[str] comment: Specifies a comment for the network policy. :param pulumi.Input[str] name: Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ pulumi.set(__self__, "allowed_ip_lists", allowed_ip_lists) if blocked_ip_lists is not None: pulumi.set(__self__, "blocked_ip_lists", blocked_ip_lists) if comment is not None: pulumi.set(__self__, "comment", comment) if name is not None: pulumi.set(__self__, "name", name) @property @pulumi.getter(name="allowedIpLists") def allowed_ip_lists(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: """ Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account """ return pulumi.get(self, "allowed_ip_lists") @allowed_ip_lists.setter def allowed_ip_lists(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): pulumi.set(self, "allowed_ip_lists", value) @property @pulumi.getter(name="blockedIpLists") def blocked_ip_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` """ return pulumi.get(self, "blocked_ip_lists") @blocked_ip_lists.setter def blocked_ip_lists(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "blocked_ip_lists", value) @property @pulumi.getter def comment(self) -> Optional[pulumi.Input[str]]: """ Specifies a comment for the network policy. """ return pulumi.get(self, "comment") @comment.setter def comment(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "comment", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @pulumi.input_type class _NetworkPolicyState: def __init__(__self__, *, allowed_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, blocked_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, comment: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering NetworkPolicy resources. :param pulumi.Input[Sequence[pulumi.Input[str]]] allowed_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account :param pulumi.Input[Sequence[pulumi.Input[str]]] blocked_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` :param pulumi.Input[str] comment: Specifies a comment for the network policy. :param pulumi.Input[str] name: Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ if allowed_ip_lists is not None: pulumi.set(__self__, "allowed_ip_lists", allowed_ip_lists) if blocked_ip_lists is not None: pulumi.set(__self__, "blocked_ip_lists", blocked_ip_lists) if comment is not None: pulumi.set(__self__, "comment", comment) if name is not None: pulumi.set(__self__, "name", name) @property @pulumi.getter(name="allowedIpLists") def allowed_ip_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account """ return pulumi.get(self, "allowed_ip_lists") @allowed_ip_lists.setter def allowed_ip_lists(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "allowed_ip_lists", value) @property @pulumi.getter(name="blockedIpLists") def blocked_ip_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` """ return pulumi.get(self, "blocked_ip_lists") @blocked_ip_lists.setter def blocked_ip_lists(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "blocked_ip_lists", value) @property @pulumi.getter def comment(self) -> Optional[pulumi.Input[str]]: """ Specifies a comment for the network policy. """ return pulumi.get(self, "comment") @comment.setter def comment(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "comment", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) class NetworkPolicy(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, allowed_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, blocked_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, comment: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, __props__=None): """ ## Example Usage ```python import pulumi import pulumi_snowflake as snowflake policy = snowflake.NetworkPolicy("policy", allowed_ip_lists=["192.168.0.100/24"], blocked_ip_lists=["192.168.0.101"], comment="A policy.") ``` ## Import ```sh $ pulumi import snowflake:index/networkPolicy:NetworkPolicy example policyname ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[Sequence[pulumi.Input[str]]] allowed_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account :param pulumi.Input[Sequence[pulumi.Input[str]]] blocked_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` :param pulumi.Input[str] comment: Specifies a comment for the network policy. :param pulumi.Input[str] name: Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ ... @overload def __init__(__self__, resource_name: str, args: NetworkPolicyArgs, opts: Optional[pulumi.ResourceOptions] = None): """ ## Example Usage ```python import pulumi import pulumi_snowflake as snowflake policy = snowflake.NetworkPolicy("policy", allowed_ip_lists=["192.168.0.100/24"], blocked_ip_lists=["192.168.0.101"], comment="A policy.") ``` ## Import ```sh $ pulumi import snowflake:index/networkPolicy:NetworkPolicy example policyname ``` :param str resource_name: The name of the resource. :param NetworkPolicyArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(NetworkPolicyArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, allowed_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, blocked_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, comment: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = NetworkPolicyArgs.__new__(NetworkPolicyArgs) if allowed_ip_lists is None and not opts.urn: raise TypeError("Missing required property 'allowed_ip_lists'") __props__.__dict__["allowed_ip_lists"] = allowed_ip_lists __props__.__dict__["blocked_ip_lists"] = blocked_ip_lists __props__.__dict__["comment"] = comment __props__.__dict__["name"] = name super(NetworkPolicy, __self__).__init__( 'snowflake:index/networkPolicy:NetworkPolicy', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, allowed_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, blocked_ip_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, comment: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None) -> 'NetworkPolicy': """ Get an existing NetworkPolicy resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[Sequence[pulumi.Input[str]]] allowed_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account :param pulumi.Input[Sequence[pulumi.Input[str]]] blocked_ip_lists: Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` :param pulumi.Input[str] comment: Specifies a comment for the network policy. :param pulumi.Input[str] name: Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _NetworkPolicyState.__new__(_NetworkPolicyState) __props__.__dict__["allowed_ip_lists"] = allowed_ip_lists __props__.__dict__["blocked_ip_lists"] = blocked_ip_lists __props__.__dict__["comment"] = comment __props__.__dict__["name"] = name return NetworkPolicy(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="allowedIpLists") def allowed_ip_lists(self) -> pulumi.Output[Sequence[str]]: """ Specifies one or more IPv4 addresses (CIDR notation) that are allowed access to your Snowflake account """ return pulumi.get(self, "allowed_ip_lists") @property @pulumi.getter(name="blockedIpLists") def blocked_ip_lists(self) -> pulumi.Output[Optional[Sequence[str]]]: """ Specifies one or more IPv4 addresses (CIDR notation) that are denied access to your Snowflake account\n\n\n\n**Do not** add `0.0.0.0/0` to `blocked_ip_list` """ return pulumi.get(self, "blocked_ip_lists") @property @pulumi.getter def comment(self) -> pulumi.Output[Optional[str]]: """ Specifies a comment for the network policy. """ return pulumi.get(self, "comment") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ Specifies the identifier for the network policy; must be unique for the account in which the network policy is created. """ return pulumi.get(self, "name")
45.770186
231
0.656534
1,836
14,738
5.05719
0.089869
0.097146
0.081422
0.070005
0.816586
0.798169
0.787291
0.778783
0.771567
0.768013
0
0.008393
0.24006
14,738
321
232
45.912773
0.820625
0.391776
0
0.701149
1
0
0.088842
0.00504
0
0
0
0
0
1
0.155172
false
0.005747
0.028736
0
0.275862
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
b11e979bfd9e44d929183433170b1cca37b4bdd4
64,634
py
Python
azure-mgmt-web/azure/mgmt/web/operations/server_farms_operations.py
Berryliao84/Python-Azure
a96ed6e8bbf4290372980a2919b31110da90b164
[ "MIT" ]
1
2017-10-29T15:14:35.000Z
2017-10-29T15:14:35.000Z
azure-mgmt-web/azure/mgmt/web/operations/server_farms_operations.py
Berryliao84/Python-Azure
a96ed6e8bbf4290372980a2919b31110da90b164
[ "MIT" ]
null
null
null
azure-mgmt-web/azure/mgmt/web/operations/server_farms_operations.py
Berryliao84/Python-Azure
a96ed6e8bbf4290372980a2919b31110da90b164
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class ServerFarmsOperations(object): """ServerFarmsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. """ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.config = config def get_server_farms( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets collection of App Service Plans in a resource group for a given subscription. :param resource_group_name: Name of resource group :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ServerFarmWithRichSkuPaged <azure.mgmt.web.models.ServerFarmWithRichSkuPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def get_server_farm( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Gets specified App Service Plan in a resource group. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ServerFarmWithRichSku <azure.mgmt.web.models.ServerFarmWithRichSku>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('ServerFarmWithRichSku', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def create_or_update_server_farm( self, resource_group_name, name, server_farm_envelope, allow_pending_state=None, custom_headers=None, raw=False, **operation_config): """Creates or updates an App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param server_farm_envelope: Details of App Service Plan :type server_farm_envelope: :class:`ServerFarmWithRichSku <azure.mgmt.web.models.ServerFarmWithRichSku>` :param allow_pending_state: OBSOLETE: If true, allow pending state for App Service Plan :type allow_pending_state: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :rtype: :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>` instance that returns :class:`ServerFarmWithRichSku <azure.mgmt.web.models.ServerFarmWithRichSku>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if allow_pending_state is not None: query_parameters['allowPendingState'] = self._serialize.query("allow_pending_state", allow_pending_state, 'bool') query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(server_farm_envelope, 'ServerFarmWithRichSku') # Construct and send request def long_running_send(): request = self._client.put(url, query_parameters) return self._client.send( request, header_parameters, body_content, **operation_config) def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) return self._client.send( request, header_parameters, **operation_config) def get_long_running_output(response): if response.status_code not in [200, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('ServerFarmWithRichSku', response) if response.status_code == 202: deserialized = self._deserialize('ServerFarmWithRichSku', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized if raw: response = long_running_send() return get_long_running_output(response) long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) def delete_server_farm( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Deletes a App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: object :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_server_farm_metrics( self, resource_group_name, name, details=None, filter=None, custom_headers=None, raw=False, **operation_config): """Queries for App Serice Plan metrics. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param details: If true, metrics are broken down per App Service Plan instance :type details: bool :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ResourceMetricPaged <azure.mgmt.web.models.ResourceMetricPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if details is not None: query_parameters['details'] = self._serialize.query("details", details, 'bool') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def get_server_farm_metric_defintions( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """List of metrics that can be queried for an App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`MetricDefinitionPaged <azure.mgmt.web.models.MetricDefinitionPaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def get_vnets_for_server_farm( self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): """Gets list of vnets associated with App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: list of :class:`VnetInfo <azure.mgmt.web.models.VnetInfo>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('[VnetInfo]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_vnet_from_server_farm( self, resource_group_name, name, vnet_name, custom_headers=None, raw=False, **operation_config): """Gets a vnet associated with an App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param vnet_name: Name of virtual network :type vnet_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`VnetInfo <azure.mgmt.web.models.VnetInfo>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('VnetInfo', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_routes_for_vnet( self, resource_group_name, name, vnet_name, custom_headers=None, raw=False, **operation_config): """Gets a list of all routes associated with a vnet, in an app service plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param vnet_name: Name of virtual network :type vnet_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: list of :class:`VnetRoute <azure.mgmt.web.models.VnetRoute>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('[VnetRoute]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_route_for_vnet( self, resource_group_name, name, vnet_name, route_name, custom_headers=None, raw=False, **operation_config): """Gets a specific route associated with a vnet, in an app service plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param vnet_name: Name of virtual network :type vnet_name: str :param route_name: Name of the virtual network route :type route_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: list of :class:`VnetRoute <azure.mgmt.web.models.VnetRoute>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'routeName': self._serialize.url("route_name", route_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('[VnetRoute]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def create_or_update_vnet_route( self, resource_group_name, name, vnet_name, route_name, route, custom_headers=None, raw=False, **operation_config): """Creates a new route or updates an existing route for a vnet in an app service plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param vnet_name: Name of virtual network :type vnet_name: str :param route_name: Name of the virtual network route :type route_name: str :param route: The route object :type route: :class:`VnetRoute <azure.mgmt.web.models.VnetRoute>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`VnetRoute <azure.mgmt.web.models.VnetRoute>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'routeName': self._serialize.url("route_name", route_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(route, 'VnetRoute') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, **operation_config) if response.status_code not in [200, 400, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('VnetRoute', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def delete_vnet_route( self, resource_group_name, name, vnet_name, route_name, custom_headers=None, raw=False, **operation_config): """Deletes an existing route for a vnet in an app service plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param vnet_name: Name of virtual network :type vnet_name: str :param route_name: Name of the virtual network route :type route_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: object :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'routeName': self._serialize.url("route_name", route_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def update_vnet_route( self, resource_group_name, name, vnet_name, route_name, route, custom_headers=None, raw=False, **operation_config): """Creates a new route or updates an existing route for a vnet in an app service plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param vnet_name: Name of virtual network :type vnet_name: str :param route_name: Name of the virtual network route :type route_name: str :param route: The route object :type route: :class:`VnetRoute <azure.mgmt.web.models.VnetRoute>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`VnetRoute <azure.mgmt.web.models.VnetRoute>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'routeName': self._serialize.url("route_name", route_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(route, 'VnetRoute') # Construct and send request request = self._client.patch(url, query_parameters) response = self._client.send( request, header_parameters, body_content, **operation_config) if response.status_code not in [200, 400, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('VnetRoute', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_server_farm_vnet_gateway( self, resource_group_name, name, vnet_name, gateway_name, custom_headers=None, raw=False, **operation_config): """Gets the vnet gateway. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of the App Service Plan :type name: str :param vnet_name: Name of the virtual network :type vnet_name: str :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. :type gateway_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`VnetGateway <azure.mgmt.web.models.VnetGateway>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('VnetGateway', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def update_server_farm_vnet_gateway( self, resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers=None, raw=False, **operation_config): """Updates the vnet gateway. :param resource_group_name: The resource group :type resource_group_name: str :param name: The name of the App Service Plan :type name: str :param vnet_name: The name of the virtual network :type vnet_name: str :param gateway_name: The name of the gateway. Only 'primary' is supported. :type gateway_name: str :param connection_envelope: The gateway entity. :type connection_envelope: :class:`VnetGateway <azure.mgmt.web.models.VnetGateway>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`VnetGateway <azure.mgmt.web.models.VnetGateway>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body body_content = self._serialize.body(connection_envelope, 'VnetGateway') # Construct and send request request = self._client.put(url, query_parameters) response = self._client.send( request, header_parameters, body_content, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('VnetGateway', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_server_farm_sites( self, resource_group_name, name, skip_token=None, filter=None, top=None, custom_headers=None, raw=False, **operation_config): """Gets list of Apps associated with an App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param skip_token: Skip to of web apps in a list. If specified, the resulting list will contain web apps starting from (including) the skipToken. Else, the resulting list contains web apps from the start of the list :type skip_token: str :param filter: Supported filter: $filter=state eq running. Returns only web apps that are currently running :type filter: str :param top: List page size. If specified, results are paged. :type top: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`SitePaged <azure.mgmt.web.models.SitePaged>` :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'str') query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') else: url = next_link query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp return response # Deserialize response deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} client_raw_response = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized def reboot_worker_for_server_farm( self, resource_group_name, name, worker_name, custom_headers=None, raw=False, **operation_config): """Submit a reboot request for a worker machine in the specified server farm. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of server farm :type name: str :param worker_name: Name of worker machine, typically starts with RD :type worker_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: object :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'workerName': self._serialize.url("worker_name", worker_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def restart_sites_for_server_farm( self, resource_group_name, name, soft_restart=None, custom_headers=None, raw=False, **operation_config): """Restarts web apps in a specified App Service Plan. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of App Service Plan :type name: str :param soft_restart: Soft restart applies the configuration settings and restarts the apps if necessary. Hard restart always restarts and reprovisions the apps :type soft_restart: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: object :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} if soft_restart is not None: query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized def get_server_farm_operation( self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config): """Gets a server farm operation. :param resource_group_name: Name of resource group :type resource_group_name: str :param name: Name of server farm :type name: str :param operation_id: Id of Server farm operation"&gt; :type operation_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: :class:`ServerFarmWithRichSku <azure.mgmt.web.models.ServerFarmWithRichSku>` :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>` """ # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}' path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str'), 'operationId': self._serialize.url("operation_id", operation_id, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: deserialized = self._deserialize('ServerFarmWithRichSku', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized
47.109329
185
0.659622
7,021
64,634
5.871813
0.04159
0.037355
0.039174
0.033183
0.909329
0.90147
0.900645
0.887814
0.8801
0.874982
0
0.004043
0.24238
64,634
1,371
186
47.143691
0.837853
0.266872
0
0.841202
0
0.014306
0.185356
0.104263
0
0
0
0
0
1
0.038627
false
0
0.007153
0
0.113019
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4947760af730d0ea13b56a707a22287f4b315e3e
2,236
py
Python
connect/data.py
dondon486/outlook_hack
244d710ea178ae1765a48d77b8c6ba2b80be27af
[ "MIT" ]
null
null
null
connect/data.py
dondon486/outlook_hack
244d710ea178ae1765a48d77b8c6ba2b80be27af
[ "MIT" ]
null
null
null
connect/data.py
dondon486/outlook_hack
244d710ea178ae1765a48d77b8c6ba2b80be27af
[ "MIT" ]
1
2021-01-05T00:21:18.000Z
2021-01-05T00:21:18.000Z
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. # See LICENSE in the project root for license information. # Stock email (customized to signed in user's alias) to # send. Separated out for to not clutter up graph_service.py. def get_email_text(alias): return "<html><head><meta http-equiv='Content-Type' content='text/html; charset=us-ascii'> <title></title></head><body style='font-family:calibri'><p>Congratulations " + alias + ",</p><p>This is a message from the Office 365 Connect sample. You are well on your way to incorporating Office 365 services in your apps.</p><h3>What&#8217;s next?</h3><ul><li>Check out <a href='http://graph.microsoft.io' target='_blank'>graph.microsoft.io</a> to start building apps with Microsoft Graph today with all the latest tools, templates, and guidance to get started quickly.</li><li>Head over to the <a href='https://graph.microsoft.io/en-us/docs' target='blank'>Microsoft Graph API documentation</a> to explore the rest of the APIs.</li><li>Browse other <a href='https://github.com/MicrosoftGraph/' target='_blank'>samples on GitHub</a> to see more of the APIs in action.</li></ul><h3>Give us feedback</h3> <ul><li>If you have any trouble running this sample, please <a href='http://github.com/OfficeDev/O365-Python-Microsoft-Graph-Connect/issues' target='_blank'>log an issue</a>.</li><li>For general questions about the Office 365 APIs, post to <a href='http://stackoverflow.com/' target='blank'>Stack Overflow</a>. Make sure that your questions or comments are tagged with [office365].</li></ul><p>Thanks and happy coding!<br>Your Office 365 Development team </p> <div style='text-align:center; font-family:calibri'> <table style='width:100%; font-family:calibri'> <tbody> <tr> <td><a href='http://github.com/OfficeDev/O365-Python-Microsoft-Graph-Connect'>See on GitHub</a> </td> <td><a href='http://officespdev.uservoice.com/'>Suggest on UserVoice</a> </td> <td><a href='http://twitter.com/share?text=I%20just%20started%20developing%20Python%20apps%20using%20the%20%23Office365%20Connect%20app!%20%40OfficeDev&url=http://github.com/OfficeDev/O365-Python-Microsoft-Graph-Connect'>Share on Twitter</a> </td> </tr> </tbody></table></div></body></html>"
223.6
1,945
0.742397
365
2,236
4.531507
0.484932
0.024184
0.032648
0.039903
0.119105
0.119105
0.102177
0.102177
0.102177
0.070133
0
0.031652
0.095707
2,236
10
1,946
223.6
0.78635
0.11136
0
0
0
1
0.969239
0.218356
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
1
1
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
7
496c90b9d3862f392dbdcf8af69df747256055d7
127,504
py
Python
validate/validate_pb2.py
samkim/authzed-py
a74642e126ca84a4ef93d9c7fc64941cab79a204
[ "Apache-2.0" ]
13
2021-02-17T02:05:51.000Z
2022-02-10T01:52:32.000Z
validate/validate_pb2.py
samkim/authzed-py
a74642e126ca84a4ef93d9c7fc64941cab79a204
[ "Apache-2.0" ]
6
2021-07-17T15:49:10.000Z
2022-03-04T13:01:11.000Z
validate/validate_pb2.py
samkim/authzed-py
a74642e126ca84a4ef93d9c7fc64941cab79a204
[ "Apache-2.0" ]
6
2021-03-15T04:35:03.000Z
2022-03-04T11:12:10.000Z
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: validate/validate.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='validate/validate.proto', package='validate', syntax='proto2', serialized_options=b'\n\032io.envoyproxy.pgv.validateZ2github.com/envoyproxy/protoc-gen-validate/validate', create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x17validate/validate.proto\x12\x08validate\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc8\x08\n\nFieldRules\x12\x30\n\x07message\x18\x11 \x01(\x0b\x32\x16.validate.MessageRulesR\x07message\x12,\n\x05\x66loat\x18\x01 \x01(\x0b\x32\x14.validate.FloatRulesH\x00R\x05\x66loat\x12/\n\x06\x64ouble\x18\x02 \x01(\x0b\x32\x15.validate.DoubleRulesH\x00R\x06\x64ouble\x12,\n\x05int32\x18\x03 \x01(\x0b\x32\x14.validate.Int32RulesH\x00R\x05int32\x12,\n\x05int64\x18\x04 \x01(\x0b\x32\x14.validate.Int64RulesH\x00R\x05int64\x12/\n\x06uint32\x18\x05 \x01(\x0b\x32\x15.validate.UInt32RulesH\x00R\x06uint32\x12/\n\x06uint64\x18\x06 \x01(\x0b\x32\x15.validate.UInt64RulesH\x00R\x06uint64\x12/\n\x06sint32\x18\x07 \x01(\x0b\x32\x15.validate.SInt32RulesH\x00R\x06sint32\x12/\n\x06sint64\x18\x08 \x01(\x0b\x32\x15.validate.SInt64RulesH\x00R\x06sint64\x12\x32\n\x07\x66ixed32\x18\t \x01(\x0b\x32\x16.validate.Fixed32RulesH\x00R\x07\x66ixed32\x12\x32\n\x07\x66ixed64\x18\n \x01(\x0b\x32\x16.validate.Fixed64RulesH\x00R\x07\x66ixed64\x12\x35\n\x08sfixed32\x18\x0b \x01(\x0b\x32\x17.validate.SFixed32RulesH\x00R\x08sfixed32\x12\x35\n\x08sfixed64\x18\x0c \x01(\x0b\x32\x17.validate.SFixed64RulesH\x00R\x08sfixed64\x12)\n\x04\x62ool\x18\r \x01(\x0b\x32\x13.validate.BoolRulesH\x00R\x04\x62ool\x12/\n\x06string\x18\x0e \x01(\x0b\x32\x15.validate.StringRulesH\x00R\x06string\x12,\n\x05\x62ytes\x18\x0f \x01(\x0b\x32\x14.validate.BytesRulesH\x00R\x05\x62ytes\x12)\n\x04\x65num\x18\x10 \x01(\x0b\x32\x13.validate.EnumRulesH\x00R\x04\x65num\x12\x35\n\x08repeated\x18\x12 \x01(\x0b\x32\x17.validate.RepeatedRulesH\x00R\x08repeated\x12&\n\x03map\x18\x13 \x01(\x0b\x32\x12.validate.MapRulesH\x00R\x03map\x12&\n\x03\x61ny\x18\x14 \x01(\x0b\x32\x12.validate.AnyRulesH\x00R\x03\x61ny\x12\x35\n\x08\x64uration\x18\x15 \x01(\x0b\x32\x17.validate.DurationRulesH\x00R\x08\x64uration\x12\x38\n\ttimestamp\x18\x16 \x01(\x0b\x32\x18.validate.TimestampRulesH\x00R\ttimestampB\x06\n\x04type\"\xb0\x01\n\nFloatRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x02R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x02R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x02R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x02R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x02R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x02R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x02R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0b\x44oubleRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x01R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x01R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x01R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x01R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x01R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x01R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x01R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb0\x01\n\nInt32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x05R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x05R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x05R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x05R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x05R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x05R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x05R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb0\x01\n\nInt64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x03R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x03R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x03R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x03R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x03R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x03R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x03R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bUInt32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\rR\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\rR\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\rR\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\rR\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\rR\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\rR\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\rR\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bUInt64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x04R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x04R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x04R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x04R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x04R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x04R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x04R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bSInt32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x11R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x11R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x11R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x11R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x11R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x11R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x11R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb1\x01\n\x0bSInt64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x12R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x12R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x12R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x12R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x12R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x12R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x12R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb2\x01\n\x0c\x46ixed32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x07R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x07R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x07R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x07R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x07R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x07R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x07R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb2\x01\n\x0c\x46ixed64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x06R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x06R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x06R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x06R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x06R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x06R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x06R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb3\x01\n\rSFixed32Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x0fR\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x0fR\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x0fR\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x0fR\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x0fR\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x0fR\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x0fR\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"\xb3\x01\n\rSFixed64Rules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x10R\x05\x63onst\x12\x0e\n\x02lt\x18\x02 \x01(\x10R\x02lt\x12\x10\n\x03lte\x18\x03 \x01(\x10R\x03lte\x12\x0e\n\x02gt\x18\x04 \x01(\x10R\x02gt\x12\x10\n\x03gte\x18\x05 \x01(\x10R\x03gte\x12\x0e\n\x02in\x18\x06 \x03(\x10R\x02in\x12\x15\n\x06not_in\x18\x07 \x03(\x10R\x05notIn\x12!\n\x0cignore_empty\x18\x08 \x01(\x08R\x0bignoreEmpty\"!\n\tBoolRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x08R\x05\x63onst\"\xd4\x05\n\x0bStringRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\tR\x05\x63onst\x12\x10\n\x03len\x18\x13 \x01(\x04R\x03len\x12\x17\n\x07min_len\x18\x02 \x01(\x04R\x06minLen\x12\x17\n\x07max_len\x18\x03 \x01(\x04R\x06maxLen\x12\x1b\n\tlen_bytes\x18\x14 \x01(\x04R\x08lenBytes\x12\x1b\n\tmin_bytes\x18\x04 \x01(\x04R\x08minBytes\x12\x1b\n\tmax_bytes\x18\x05 \x01(\x04R\x08maxBytes\x12\x18\n\x07pattern\x18\x06 \x01(\tR\x07pattern\x12\x16\n\x06prefix\x18\x07 \x01(\tR\x06prefix\x12\x16\n\x06suffix\x18\x08 \x01(\tR\x06suffix\x12\x1a\n\x08\x63ontains\x18\t \x01(\tR\x08\x63ontains\x12!\n\x0cnot_contains\x18\x17 \x01(\tR\x0bnotContains\x12\x0e\n\x02in\x18\n \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x0b \x03(\tR\x05notIn\x12\x16\n\x05\x65mail\x18\x0c \x01(\x08H\x00R\x05\x65mail\x12\x1c\n\x08hostname\x18\r \x01(\x08H\x00R\x08hostname\x12\x10\n\x02ip\x18\x0e \x01(\x08H\x00R\x02ip\x12\x14\n\x04ipv4\x18\x0f \x01(\x08H\x00R\x04ipv4\x12\x14\n\x04ipv6\x18\x10 \x01(\x08H\x00R\x04ipv6\x12\x12\n\x03uri\x18\x11 \x01(\x08H\x00R\x03uri\x12\x19\n\x07uri_ref\x18\x12 \x01(\x08H\x00R\x06uriRef\x12\x1a\n\x07\x61\x64\x64ress\x18\x15 \x01(\x08H\x00R\x07\x61\x64\x64ress\x12\x14\n\x04uuid\x18\x16 \x01(\x08H\x00R\x04uuid\x12@\n\x10well_known_regex\x18\x18 \x01(\x0e\x32\x14.validate.KnownRegexH\x00R\x0ewellKnownRegex\x12\x1c\n\x06strict\x18\x19 \x01(\x08:\x04trueR\x06strict\x12!\n\x0cignore_empty\x18\x1a \x01(\x08R\x0bignoreEmptyB\x0c\n\nwell_known\"\xe2\x02\n\nBytesRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x0cR\x05\x63onst\x12\x10\n\x03len\x18\r \x01(\x04R\x03len\x12\x17\n\x07min_len\x18\x02 \x01(\x04R\x06minLen\x12\x17\n\x07max_len\x18\x03 \x01(\x04R\x06maxLen\x12\x18\n\x07pattern\x18\x04 \x01(\tR\x07pattern\x12\x16\n\x06prefix\x18\x05 \x01(\x0cR\x06prefix\x12\x16\n\x06suffix\x18\x06 \x01(\x0cR\x06suffix\x12\x1a\n\x08\x63ontains\x18\x07 \x01(\x0cR\x08\x63ontains\x12\x0e\n\x02in\x18\x08 \x03(\x0cR\x02in\x12\x15\n\x06not_in\x18\t \x03(\x0cR\x05notIn\x12\x10\n\x02ip\x18\n \x01(\x08H\x00R\x02ip\x12\x14\n\x04ipv4\x18\x0b \x01(\x08H\x00R\x04ipv4\x12\x14\n\x04ipv6\x18\x0c \x01(\x08H\x00R\x04ipv6\x12!\n\x0cignore_empty\x18\x0e \x01(\x08R\x0bignoreEmptyB\x0c\n\nwell_known\"k\n\tEnumRules\x12\x14\n\x05\x63onst\x18\x01 \x01(\x05R\x05\x63onst\x12!\n\x0c\x64\x65\x66ined_only\x18\x02 \x01(\x08R\x0b\x64\x65\x66inedOnly\x12\x0e\n\x02in\x18\x03 \x03(\x05R\x02in\x12\x15\n\x06not_in\x18\x04 \x03(\x05R\x05notIn\">\n\x0cMessageRules\x12\x12\n\x04skip\x18\x01 \x01(\x08R\x04skip\x12\x1a\n\x08required\x18\x02 \x01(\x08R\x08required\"\xb0\x01\n\rRepeatedRules\x12\x1b\n\tmin_items\x18\x01 \x01(\x04R\x08minItems\x12\x1b\n\tmax_items\x18\x02 \x01(\x04R\x08maxItems\x12\x16\n\x06unique\x18\x03 \x01(\x08R\x06unique\x12*\n\x05items\x18\x04 \x01(\x0b\x32\x14.validate.FieldRulesR\x05items\x12!\n\x0cignore_empty\x18\x05 \x01(\x08R\x0bignoreEmpty\"\xdc\x01\n\x08MapRules\x12\x1b\n\tmin_pairs\x18\x01 \x01(\x04R\x08minPairs\x12\x1b\n\tmax_pairs\x18\x02 \x01(\x04R\x08maxPairs\x12\x1b\n\tno_sparse\x18\x03 \x01(\x08R\x08noSparse\x12(\n\x04keys\x18\x04 \x01(\x0b\x32\x14.validate.FieldRulesR\x04keys\x12,\n\x06values\x18\x05 \x01(\x0b\x32\x14.validate.FieldRulesR\x06values\x12!\n\x0cignore_empty\x18\x06 \x01(\x08R\x0bignoreEmpty\"M\n\x08\x41nyRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\x12\x0e\n\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x03 \x03(\tR\x05notIn\"\xe9\x02\n\rDurationRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\x12/\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x05\x63onst\x12)\n\x02lt\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x02lt\x12+\n\x03lte\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationR\x03lte\x12)\n\x02gt\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationR\x02gt\x12+\n\x03gte\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationR\x03gte\x12)\n\x02in\x18\x07 \x03(\x0b\x32\x19.google.protobuf.DurationR\x02in\x12\x30\n\x06not_in\x18\x08 \x03(\x0b\x32\x19.google.protobuf.DurationR\x05notIn\"\xf3\x02\n\x0eTimestampRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\x12\x30\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x05\x63onst\x12*\n\x02lt\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x02lt\x12,\n\x03lte\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03lte\x12*\n\x02gt\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x02gt\x12,\n\x03gte\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x03gte\x12\x15\n\x06lt_now\x18\x07 \x01(\x08R\x05ltNow\x12\x15\n\x06gt_now\x18\x08 \x01(\x08R\x05gtNow\x12\x31\n\x06within\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationR\x06within*F\n\nKnownRegex\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x14\n\x10HTTP_HEADER_NAME\x10\x01\x12\x15\n\x11HTTP_HEADER_VALUE\x10\x02:<\n\x08\x64isabled\x12\x1f.google.protobuf.MessageOptions\x18\xaf\x08 \x01(\x08R\x08\x64isabled::\n\x07ignored\x12\x1f.google.protobuf.MessageOptions\x18\xb0\x08 \x01(\x08R\x07ignored::\n\x08required\x12\x1d.google.protobuf.OneofOptions\x18\xaf\x08 \x01(\x08R\x08required:J\n\x05rules\x12\x1d.google.protobuf.FieldOptions\x18\xaf\x08 \x01(\x0b\x32\x14.validate.FieldRulesR\x05rulesBP\n\x1aio.envoyproxy.pgv.validateZ2github.com/envoyproxy/protoc-gen-validate/validate' , dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,google_dot_protobuf_dot_duration__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) _KNOWNREGEX = _descriptor.EnumDescriptor( name='KnownRegex', full_name='validate.KnownRegex', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNKNOWN', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='HTTP_HEADER_NAME', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='HTTP_HEADER_VALUE', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=5909, serialized_end=5979, ) _sym_db.RegisterEnumDescriptor(_KNOWNREGEX) KnownRegex = enum_type_wrapper.EnumTypeWrapper(_KNOWNREGEX) UNKNOWN = 0 HTTP_HEADER_NAME = 1 HTTP_HEADER_VALUE = 2 DISABLED_FIELD_NUMBER = 1071 disabled = _descriptor.FieldDescriptor( name='disabled', full_name='validate.disabled', index=0, number=1071, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, json_name='disabled', file=DESCRIPTOR, create_key=_descriptor._internal_create_key) IGNORED_FIELD_NUMBER = 1072 ignored = _descriptor.FieldDescriptor( name='ignored', full_name='validate.ignored', index=1, number=1072, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, json_name='ignored', file=DESCRIPTOR, create_key=_descriptor._internal_create_key) REQUIRED_FIELD_NUMBER = 1071 required = _descriptor.FieldDescriptor( name='required', full_name='validate.required', index=2, number=1071, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, json_name='required', file=DESCRIPTOR, create_key=_descriptor._internal_create_key) RULES_FIELD_NUMBER = 1071 rules = _descriptor.FieldDescriptor( name='rules', full_name='validate.rules', index=3, number=1071, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, json_name='rules', file=DESCRIPTOR, create_key=_descriptor._internal_create_key) _FIELDRULES = _descriptor.Descriptor( name='FieldRules', full_name='validate.FieldRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='message', full_name='validate.FieldRules.message', index=0, number=17, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='message', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='float', full_name='validate.FieldRules.float', index=1, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='float', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='double', full_name='validate.FieldRules.double', index=2, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='double', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='int32', full_name='validate.FieldRules.int32', index=3, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='int32', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='int64', full_name='validate.FieldRules.int64', index=4, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='int64', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='uint32', full_name='validate.FieldRules.uint32', index=5, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='uint32', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='uint64', full_name='validate.FieldRules.uint64', index=6, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='uint64', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='sint32', full_name='validate.FieldRules.sint32', index=7, number=7, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='sint32', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='sint64', full_name='validate.FieldRules.sint64', index=8, number=8, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='sint64', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='fixed32', full_name='validate.FieldRules.fixed32', index=9, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='fixed32', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='fixed64', full_name='validate.FieldRules.fixed64', index=10, number=10, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='fixed64', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='sfixed32', full_name='validate.FieldRules.sfixed32', index=11, number=11, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='sfixed32', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='sfixed64', full_name='validate.FieldRules.sfixed64', index=12, number=12, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='sfixed64', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bool', full_name='validate.FieldRules.bool', index=13, number=13, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='bool', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='string', full_name='validate.FieldRules.string', index=14, number=14, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='string', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bytes', full_name='validate.FieldRules.bytes', index=15, number=15, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='bytes', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='enum', full_name='validate.FieldRules.enum', index=16, number=16, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='enum', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='repeated', full_name='validate.FieldRules.repeated', index=17, number=18, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='repeated', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='map', full_name='validate.FieldRules.map', index=18, number=19, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='map', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='any', full_name='validate.FieldRules.any', index=19, number=20, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='any', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='duration', full_name='validate.FieldRules.duration', index=20, number=21, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='duration', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='timestamp', full_name='validate.FieldRules.timestamp', index=21, number=22, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='timestamp', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='type', full_name='validate.FieldRules.type', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], serialized_start=137, serialized_end=1233, ) _FLOATRULES = _descriptor.Descriptor( name='FloatRules', full_name='validate.FloatRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.FloatRules.const', index=0, number=1, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.FloatRules.lt', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.FloatRules.lte', index=2, number=3, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.FloatRules.gt', index=3, number=4, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.FloatRules.gte', index=4, number=5, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.FloatRules.in', index=5, number=6, type=2, cpp_type=6, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.FloatRules.not_in', index=6, number=7, type=2, cpp_type=6, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.FloatRules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1236, serialized_end=1412, ) _DOUBLERULES = _descriptor.Descriptor( name='DoubleRules', full_name='validate.DoubleRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.DoubleRules.const', index=0, number=1, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.DoubleRules.lt', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.DoubleRules.lte', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.DoubleRules.gt', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.DoubleRules.gte', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.DoubleRules.in', index=5, number=6, type=1, cpp_type=5, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.DoubleRules.not_in', index=6, number=7, type=1, cpp_type=5, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.DoubleRules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1415, serialized_end=1592, ) _INT32RULES = _descriptor.Descriptor( name='Int32Rules', full_name='validate.Int32Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.Int32Rules.const', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.Int32Rules.lt', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.Int32Rules.lte', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.Int32Rules.gt', index=3, number=4, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.Int32Rules.gte', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.Int32Rules.in', index=5, number=6, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.Int32Rules.not_in', index=6, number=7, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.Int32Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1595, serialized_end=1771, ) _INT64RULES = _descriptor.Descriptor( name='Int64Rules', full_name='validate.Int64Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.Int64Rules.const', index=0, number=1, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.Int64Rules.lt', index=1, number=2, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.Int64Rules.lte', index=2, number=3, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.Int64Rules.gt', index=3, number=4, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.Int64Rules.gte', index=4, number=5, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.Int64Rules.in', index=5, number=6, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.Int64Rules.not_in', index=6, number=7, type=3, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.Int64Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1774, serialized_end=1950, ) _UINT32RULES = _descriptor.Descriptor( name='UInt32Rules', full_name='validate.UInt32Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.UInt32Rules.const', index=0, number=1, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.UInt32Rules.lt', index=1, number=2, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.UInt32Rules.lte', index=2, number=3, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.UInt32Rules.gt', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.UInt32Rules.gte', index=4, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.UInt32Rules.in', index=5, number=6, type=13, cpp_type=3, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.UInt32Rules.not_in', index=6, number=7, type=13, cpp_type=3, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.UInt32Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=1953, serialized_end=2130, ) _UINT64RULES = _descriptor.Descriptor( name='UInt64Rules', full_name='validate.UInt64Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.UInt64Rules.const', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.UInt64Rules.lt', index=1, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.UInt64Rules.lte', index=2, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.UInt64Rules.gt', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.UInt64Rules.gte', index=4, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.UInt64Rules.in', index=5, number=6, type=4, cpp_type=4, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.UInt64Rules.not_in', index=6, number=7, type=4, cpp_type=4, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.UInt64Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2133, serialized_end=2310, ) _SINT32RULES = _descriptor.Descriptor( name='SInt32Rules', full_name='validate.SInt32Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.SInt32Rules.const', index=0, number=1, type=17, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.SInt32Rules.lt', index=1, number=2, type=17, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.SInt32Rules.lte', index=2, number=3, type=17, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.SInt32Rules.gt', index=3, number=4, type=17, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.SInt32Rules.gte', index=4, number=5, type=17, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.SInt32Rules.in', index=5, number=6, type=17, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.SInt32Rules.not_in', index=6, number=7, type=17, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.SInt32Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2313, serialized_end=2490, ) _SINT64RULES = _descriptor.Descriptor( name='SInt64Rules', full_name='validate.SInt64Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.SInt64Rules.const', index=0, number=1, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.SInt64Rules.lt', index=1, number=2, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.SInt64Rules.lte', index=2, number=3, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.SInt64Rules.gt', index=3, number=4, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.SInt64Rules.gte', index=4, number=5, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.SInt64Rules.in', index=5, number=6, type=18, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.SInt64Rules.not_in', index=6, number=7, type=18, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.SInt64Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2493, serialized_end=2670, ) _FIXED32RULES = _descriptor.Descriptor( name='Fixed32Rules', full_name='validate.Fixed32Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.Fixed32Rules.const', index=0, number=1, type=7, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.Fixed32Rules.lt', index=1, number=2, type=7, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.Fixed32Rules.lte', index=2, number=3, type=7, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.Fixed32Rules.gt', index=3, number=4, type=7, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.Fixed32Rules.gte', index=4, number=5, type=7, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.Fixed32Rules.in', index=5, number=6, type=7, cpp_type=3, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.Fixed32Rules.not_in', index=6, number=7, type=7, cpp_type=3, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.Fixed32Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2673, serialized_end=2851, ) _FIXED64RULES = _descriptor.Descriptor( name='Fixed64Rules', full_name='validate.Fixed64Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.Fixed64Rules.const', index=0, number=1, type=6, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.Fixed64Rules.lt', index=1, number=2, type=6, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.Fixed64Rules.lte', index=2, number=3, type=6, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.Fixed64Rules.gt', index=3, number=4, type=6, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.Fixed64Rules.gte', index=4, number=5, type=6, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.Fixed64Rules.in', index=5, number=6, type=6, cpp_type=4, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.Fixed64Rules.not_in', index=6, number=7, type=6, cpp_type=4, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.Fixed64Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=2854, serialized_end=3032, ) _SFIXED32RULES = _descriptor.Descriptor( name='SFixed32Rules', full_name='validate.SFixed32Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.SFixed32Rules.const', index=0, number=1, type=15, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.SFixed32Rules.lt', index=1, number=2, type=15, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.SFixed32Rules.lte', index=2, number=3, type=15, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.SFixed32Rules.gt', index=3, number=4, type=15, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.SFixed32Rules.gte', index=4, number=5, type=15, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.SFixed32Rules.in', index=5, number=6, type=15, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.SFixed32Rules.not_in', index=6, number=7, type=15, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.SFixed32Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3035, serialized_end=3214, ) _SFIXED64RULES = _descriptor.Descriptor( name='SFixed64Rules', full_name='validate.SFixed64Rules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.SFixed64Rules.const', index=0, number=1, type=16, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.SFixed64Rules.lt', index=1, number=2, type=16, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.SFixed64Rules.lte', index=2, number=3, type=16, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.SFixed64Rules.gt', index=3, number=4, type=16, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.SFixed64Rules.gte', index=4, number=5, type=16, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.SFixed64Rules.in', index=5, number=6, type=16, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.SFixed64Rules.not_in', index=6, number=7, type=16, cpp_type=2, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.SFixed64Rules.ignore_empty', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3217, serialized_end=3396, ) _BOOLRULES = _descriptor.Descriptor( name='BoolRules', full_name='validate.BoolRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.BoolRules.const', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=3398, serialized_end=3431, ) _STRINGRULES = _descriptor.Descriptor( name='StringRules', full_name='validate.StringRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.StringRules.const', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='len', full_name='validate.StringRules.len', index=1, number=19, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='len', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='min_len', full_name='validate.StringRules.min_len', index=2, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='minLen', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='max_len', full_name='validate.StringRules.max_len', index=3, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='maxLen', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='len_bytes', full_name='validate.StringRules.len_bytes', index=4, number=20, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lenBytes', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='min_bytes', full_name='validate.StringRules.min_bytes', index=5, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='minBytes', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='max_bytes', full_name='validate.StringRules.max_bytes', index=6, number=5, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='maxBytes', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='pattern', full_name='validate.StringRules.pattern', index=7, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='pattern', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='prefix', full_name='validate.StringRules.prefix', index=8, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='prefix', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='suffix', full_name='validate.StringRules.suffix', index=9, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='suffix', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='contains', full_name='validate.StringRules.contains', index=10, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='contains', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_contains', full_name='validate.StringRules.not_contains', index=11, number=23, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notContains', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.StringRules.in', index=12, number=10, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.StringRules.not_in', index=13, number=11, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='email', full_name='validate.StringRules.email', index=14, number=12, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='email', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='hostname', full_name='validate.StringRules.hostname', index=15, number=13, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='hostname', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ip', full_name='validate.StringRules.ip', index=16, number=14, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ip', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ipv4', full_name='validate.StringRules.ipv4', index=17, number=15, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ipv4', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ipv6', full_name='validate.StringRules.ipv6', index=18, number=16, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ipv6', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='uri', full_name='validate.StringRules.uri', index=19, number=17, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='uri', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='uri_ref', full_name='validate.StringRules.uri_ref', index=20, number=18, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='uriRef', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='address', full_name='validate.StringRules.address', index=21, number=21, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='address', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='uuid', full_name='validate.StringRules.uuid', index=22, number=22, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='uuid', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='well_known_regex', full_name='validate.StringRules.well_known_regex', index=23, number=24, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='wellKnownRegex', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='strict', full_name='validate.StringRules.strict', index=24, number=25, type=8, cpp_type=7, label=1, has_default_value=True, default_value=True, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='strict', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.StringRules.ignore_empty', index=25, number=26, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='well_known', full_name='validate.StringRules.well_known', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], serialized_start=3434, serialized_end=4158, ) _BYTESRULES = _descriptor.Descriptor( name='BytesRules', full_name='validate.BytesRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.BytesRules.const', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='len', full_name='validate.BytesRules.len', index=1, number=13, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='len', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='min_len', full_name='validate.BytesRules.min_len', index=2, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='minLen', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='max_len', full_name='validate.BytesRules.max_len', index=3, number=3, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='maxLen', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='pattern', full_name='validate.BytesRules.pattern', index=4, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='pattern', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='prefix', full_name='validate.BytesRules.prefix', index=5, number=5, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='prefix', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='suffix', full_name='validate.BytesRules.suffix', index=6, number=6, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='suffix', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='contains', full_name='validate.BytesRules.contains', index=7, number=7, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='contains', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.BytesRules.in', index=8, number=8, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.BytesRules.not_in', index=9, number=9, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ip', full_name='validate.BytesRules.ip', index=10, number=10, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ip', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ipv4', full_name='validate.BytesRules.ipv4', index=11, number=11, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ipv4', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ipv6', full_name='validate.BytesRules.ipv6', index=12, number=12, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ipv6', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.BytesRules.ignore_empty', index=13, number=14, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='well_known', full_name='validate.BytesRules.well_known', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], serialized_start=4161, serialized_end=4515, ) _ENUMRULES = _descriptor.Descriptor( name='EnumRules', full_name='validate.EnumRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='const', full_name='validate.EnumRules.const', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='defined_only', full_name='validate.EnumRules.defined_only', index=1, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='definedOnly', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.EnumRules.in', index=2, number=3, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.EnumRules.not_in', index=3, number=4, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4517, serialized_end=4624, ) _MESSAGERULES = _descriptor.Descriptor( name='MessageRules', full_name='validate.MessageRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='skip', full_name='validate.MessageRules.skip', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='skip', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='required', full_name='validate.MessageRules.required', index=1, number=2, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='required', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4626, serialized_end=4688, ) _REPEATEDRULES = _descriptor.Descriptor( name='RepeatedRules', full_name='validate.RepeatedRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='min_items', full_name='validate.RepeatedRules.min_items', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='minItems', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='max_items', full_name='validate.RepeatedRules.max_items', index=1, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='maxItems', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='unique', full_name='validate.RepeatedRules.unique', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='unique', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='items', full_name='validate.RepeatedRules.items', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='items', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.RepeatedRules.ignore_empty', index=4, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4691, serialized_end=4867, ) _MAPRULES = _descriptor.Descriptor( name='MapRules', full_name='validate.MapRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='min_pairs', full_name='validate.MapRules.min_pairs', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='minPairs', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='max_pairs', full_name='validate.MapRules.max_pairs', index=1, number=2, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='maxPairs', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='no_sparse', full_name='validate.MapRules.no_sparse', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='noSparse', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='keys', full_name='validate.MapRules.keys', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='keys', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='values', full_name='validate.MapRules.values', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='values', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ignore_empty', full_name='validate.MapRules.ignore_empty', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ignoreEmpty', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=4870, serialized_end=5090, ) _ANYRULES = _descriptor.Descriptor( name='AnyRules', full_name='validate.AnyRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='required', full_name='validate.AnyRules.required', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='required', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.AnyRules.in', index=1, number=2, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.AnyRules.not_in', index=2, number=3, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5092, serialized_end=5169, ) _DURATIONRULES = _descriptor.Descriptor( name='DurationRules', full_name='validate.DurationRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='required', full_name='validate.DurationRules.required', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='required', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='const', full_name='validate.DurationRules.const', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.DurationRules.lt', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.DurationRules.lte', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.DurationRules.gt', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.DurationRules.gte', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='in', full_name='validate.DurationRules.in', index=6, number=7, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='in', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='not_in', full_name='validate.DurationRules.not_in', index=7, number=8, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='notIn', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5172, serialized_end=5533, ) _TIMESTAMPRULES = _descriptor.Descriptor( name='TimestampRules', full_name='validate.TimestampRules', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='required', full_name='validate.TimestampRules.required', index=0, number=1, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='required', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='const', full_name='validate.TimestampRules.const', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='const', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt', full_name='validate.TimestampRules.lt', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lte', full_name='validate.TimestampRules.lte', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='lte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt', full_name='validate.TimestampRules.gt', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gt', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gte', full_name='validate.TimestampRules.gte', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gte', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='lt_now', full_name='validate.TimestampRules.lt_now', index=6, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='ltNow', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='gt_now', full_name='validate.TimestampRules.gt_now', index=7, number=8, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='gtNow', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='within', full_name='validate.TimestampRules.within', index=8, number=9, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='within', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto2', extension_ranges=[], oneofs=[ ], serialized_start=5536, serialized_end=5907, ) _FIELDRULES.fields_by_name['message'].message_type = _MESSAGERULES _FIELDRULES.fields_by_name['float'].message_type = _FLOATRULES _FIELDRULES.fields_by_name['double'].message_type = _DOUBLERULES _FIELDRULES.fields_by_name['int32'].message_type = _INT32RULES _FIELDRULES.fields_by_name['int64'].message_type = _INT64RULES _FIELDRULES.fields_by_name['uint32'].message_type = _UINT32RULES _FIELDRULES.fields_by_name['uint64'].message_type = _UINT64RULES _FIELDRULES.fields_by_name['sint32'].message_type = _SINT32RULES _FIELDRULES.fields_by_name['sint64'].message_type = _SINT64RULES _FIELDRULES.fields_by_name['fixed32'].message_type = _FIXED32RULES _FIELDRULES.fields_by_name['fixed64'].message_type = _FIXED64RULES _FIELDRULES.fields_by_name['sfixed32'].message_type = _SFIXED32RULES _FIELDRULES.fields_by_name['sfixed64'].message_type = _SFIXED64RULES _FIELDRULES.fields_by_name['bool'].message_type = _BOOLRULES _FIELDRULES.fields_by_name['string'].message_type = _STRINGRULES _FIELDRULES.fields_by_name['bytes'].message_type = _BYTESRULES _FIELDRULES.fields_by_name['enum'].message_type = _ENUMRULES _FIELDRULES.fields_by_name['repeated'].message_type = _REPEATEDRULES _FIELDRULES.fields_by_name['map'].message_type = _MAPRULES _FIELDRULES.fields_by_name['any'].message_type = _ANYRULES _FIELDRULES.fields_by_name['duration'].message_type = _DURATIONRULES _FIELDRULES.fields_by_name['timestamp'].message_type = _TIMESTAMPRULES _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['float']) _FIELDRULES.fields_by_name['float'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['double']) _FIELDRULES.fields_by_name['double'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['int32']) _FIELDRULES.fields_by_name['int32'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['int64']) _FIELDRULES.fields_by_name['int64'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['uint32']) _FIELDRULES.fields_by_name['uint32'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['uint64']) _FIELDRULES.fields_by_name['uint64'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['sint32']) _FIELDRULES.fields_by_name['sint32'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['sint64']) _FIELDRULES.fields_by_name['sint64'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['fixed32']) _FIELDRULES.fields_by_name['fixed32'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['fixed64']) _FIELDRULES.fields_by_name['fixed64'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['sfixed32']) _FIELDRULES.fields_by_name['sfixed32'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['sfixed64']) _FIELDRULES.fields_by_name['sfixed64'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['bool']) _FIELDRULES.fields_by_name['bool'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['string']) _FIELDRULES.fields_by_name['string'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['bytes']) _FIELDRULES.fields_by_name['bytes'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['enum']) _FIELDRULES.fields_by_name['enum'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['repeated']) _FIELDRULES.fields_by_name['repeated'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['map']) _FIELDRULES.fields_by_name['map'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['any']) _FIELDRULES.fields_by_name['any'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['duration']) _FIELDRULES.fields_by_name['duration'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _FIELDRULES.oneofs_by_name['type'].fields.append( _FIELDRULES.fields_by_name['timestamp']) _FIELDRULES.fields_by_name['timestamp'].containing_oneof = _FIELDRULES.oneofs_by_name['type'] _STRINGRULES.fields_by_name['well_known_regex'].enum_type = _KNOWNREGEX _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['email']) _STRINGRULES.fields_by_name['email'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['hostname']) _STRINGRULES.fields_by_name['hostname'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['ip']) _STRINGRULES.fields_by_name['ip'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['ipv4']) _STRINGRULES.fields_by_name['ipv4'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['ipv6']) _STRINGRULES.fields_by_name['ipv6'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['uri']) _STRINGRULES.fields_by_name['uri'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['uri_ref']) _STRINGRULES.fields_by_name['uri_ref'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['address']) _STRINGRULES.fields_by_name['address'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['uuid']) _STRINGRULES.fields_by_name['uuid'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _STRINGRULES.oneofs_by_name['well_known'].fields.append( _STRINGRULES.fields_by_name['well_known_regex']) _STRINGRULES.fields_by_name['well_known_regex'].containing_oneof = _STRINGRULES.oneofs_by_name['well_known'] _BYTESRULES.oneofs_by_name['well_known'].fields.append( _BYTESRULES.fields_by_name['ip']) _BYTESRULES.fields_by_name['ip'].containing_oneof = _BYTESRULES.oneofs_by_name['well_known'] _BYTESRULES.oneofs_by_name['well_known'].fields.append( _BYTESRULES.fields_by_name['ipv4']) _BYTESRULES.fields_by_name['ipv4'].containing_oneof = _BYTESRULES.oneofs_by_name['well_known'] _BYTESRULES.oneofs_by_name['well_known'].fields.append( _BYTESRULES.fields_by_name['ipv6']) _BYTESRULES.fields_by_name['ipv6'].containing_oneof = _BYTESRULES.oneofs_by_name['well_known'] _REPEATEDRULES.fields_by_name['items'].message_type = _FIELDRULES _MAPRULES.fields_by_name['keys'].message_type = _FIELDRULES _MAPRULES.fields_by_name['values'].message_type = _FIELDRULES _DURATIONRULES.fields_by_name['const'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _DURATIONRULES.fields_by_name['lt'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _DURATIONRULES.fields_by_name['lte'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _DURATIONRULES.fields_by_name['gt'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _DURATIONRULES.fields_by_name['gte'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _DURATIONRULES.fields_by_name['in'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _DURATIONRULES.fields_by_name['not_in'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION _TIMESTAMPRULES.fields_by_name['const'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _TIMESTAMPRULES.fields_by_name['lt'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _TIMESTAMPRULES.fields_by_name['lte'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _TIMESTAMPRULES.fields_by_name['gt'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _TIMESTAMPRULES.fields_by_name['gte'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP _TIMESTAMPRULES.fields_by_name['within'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION DESCRIPTOR.message_types_by_name['FieldRules'] = _FIELDRULES DESCRIPTOR.message_types_by_name['FloatRules'] = _FLOATRULES DESCRIPTOR.message_types_by_name['DoubleRules'] = _DOUBLERULES DESCRIPTOR.message_types_by_name['Int32Rules'] = _INT32RULES DESCRIPTOR.message_types_by_name['Int64Rules'] = _INT64RULES DESCRIPTOR.message_types_by_name['UInt32Rules'] = _UINT32RULES DESCRIPTOR.message_types_by_name['UInt64Rules'] = _UINT64RULES DESCRIPTOR.message_types_by_name['SInt32Rules'] = _SINT32RULES DESCRIPTOR.message_types_by_name['SInt64Rules'] = _SINT64RULES DESCRIPTOR.message_types_by_name['Fixed32Rules'] = _FIXED32RULES DESCRIPTOR.message_types_by_name['Fixed64Rules'] = _FIXED64RULES DESCRIPTOR.message_types_by_name['SFixed32Rules'] = _SFIXED32RULES DESCRIPTOR.message_types_by_name['SFixed64Rules'] = _SFIXED64RULES DESCRIPTOR.message_types_by_name['BoolRules'] = _BOOLRULES DESCRIPTOR.message_types_by_name['StringRules'] = _STRINGRULES DESCRIPTOR.message_types_by_name['BytesRules'] = _BYTESRULES DESCRIPTOR.message_types_by_name['EnumRules'] = _ENUMRULES DESCRIPTOR.message_types_by_name['MessageRules'] = _MESSAGERULES DESCRIPTOR.message_types_by_name['RepeatedRules'] = _REPEATEDRULES DESCRIPTOR.message_types_by_name['MapRules'] = _MAPRULES DESCRIPTOR.message_types_by_name['AnyRules'] = _ANYRULES DESCRIPTOR.message_types_by_name['DurationRules'] = _DURATIONRULES DESCRIPTOR.message_types_by_name['TimestampRules'] = _TIMESTAMPRULES DESCRIPTOR.enum_types_by_name['KnownRegex'] = _KNOWNREGEX DESCRIPTOR.extensions_by_name['disabled'] = disabled DESCRIPTOR.extensions_by_name['ignored'] = ignored DESCRIPTOR.extensions_by_name['required'] = required DESCRIPTOR.extensions_by_name['rules'] = rules _sym_db.RegisterFileDescriptor(DESCRIPTOR) FieldRules = _reflection.GeneratedProtocolMessageType('FieldRules', (_message.Message,), { 'DESCRIPTOR' : _FIELDRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.FieldRules) }) _sym_db.RegisterMessage(FieldRules) FloatRules = _reflection.GeneratedProtocolMessageType('FloatRules', (_message.Message,), { 'DESCRIPTOR' : _FLOATRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.FloatRules) }) _sym_db.RegisterMessage(FloatRules) DoubleRules = _reflection.GeneratedProtocolMessageType('DoubleRules', (_message.Message,), { 'DESCRIPTOR' : _DOUBLERULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.DoubleRules) }) _sym_db.RegisterMessage(DoubleRules) Int32Rules = _reflection.GeneratedProtocolMessageType('Int32Rules', (_message.Message,), { 'DESCRIPTOR' : _INT32RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.Int32Rules) }) _sym_db.RegisterMessage(Int32Rules) Int64Rules = _reflection.GeneratedProtocolMessageType('Int64Rules', (_message.Message,), { 'DESCRIPTOR' : _INT64RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.Int64Rules) }) _sym_db.RegisterMessage(Int64Rules) UInt32Rules = _reflection.GeneratedProtocolMessageType('UInt32Rules', (_message.Message,), { 'DESCRIPTOR' : _UINT32RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.UInt32Rules) }) _sym_db.RegisterMessage(UInt32Rules) UInt64Rules = _reflection.GeneratedProtocolMessageType('UInt64Rules', (_message.Message,), { 'DESCRIPTOR' : _UINT64RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.UInt64Rules) }) _sym_db.RegisterMessage(UInt64Rules) SInt32Rules = _reflection.GeneratedProtocolMessageType('SInt32Rules', (_message.Message,), { 'DESCRIPTOR' : _SINT32RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.SInt32Rules) }) _sym_db.RegisterMessage(SInt32Rules) SInt64Rules = _reflection.GeneratedProtocolMessageType('SInt64Rules', (_message.Message,), { 'DESCRIPTOR' : _SINT64RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.SInt64Rules) }) _sym_db.RegisterMessage(SInt64Rules) Fixed32Rules = _reflection.GeneratedProtocolMessageType('Fixed32Rules', (_message.Message,), { 'DESCRIPTOR' : _FIXED32RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.Fixed32Rules) }) _sym_db.RegisterMessage(Fixed32Rules) Fixed64Rules = _reflection.GeneratedProtocolMessageType('Fixed64Rules', (_message.Message,), { 'DESCRIPTOR' : _FIXED64RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.Fixed64Rules) }) _sym_db.RegisterMessage(Fixed64Rules) SFixed32Rules = _reflection.GeneratedProtocolMessageType('SFixed32Rules', (_message.Message,), { 'DESCRIPTOR' : _SFIXED32RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.SFixed32Rules) }) _sym_db.RegisterMessage(SFixed32Rules) SFixed64Rules = _reflection.GeneratedProtocolMessageType('SFixed64Rules', (_message.Message,), { 'DESCRIPTOR' : _SFIXED64RULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.SFixed64Rules) }) _sym_db.RegisterMessage(SFixed64Rules) BoolRules = _reflection.GeneratedProtocolMessageType('BoolRules', (_message.Message,), { 'DESCRIPTOR' : _BOOLRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.BoolRules) }) _sym_db.RegisterMessage(BoolRules) StringRules = _reflection.GeneratedProtocolMessageType('StringRules', (_message.Message,), { 'DESCRIPTOR' : _STRINGRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.StringRules) }) _sym_db.RegisterMessage(StringRules) BytesRules = _reflection.GeneratedProtocolMessageType('BytesRules', (_message.Message,), { 'DESCRIPTOR' : _BYTESRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.BytesRules) }) _sym_db.RegisterMessage(BytesRules) EnumRules = _reflection.GeneratedProtocolMessageType('EnumRules', (_message.Message,), { 'DESCRIPTOR' : _ENUMRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.EnumRules) }) _sym_db.RegisterMessage(EnumRules) MessageRules = _reflection.GeneratedProtocolMessageType('MessageRules', (_message.Message,), { 'DESCRIPTOR' : _MESSAGERULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.MessageRules) }) _sym_db.RegisterMessage(MessageRules) RepeatedRules = _reflection.GeneratedProtocolMessageType('RepeatedRules', (_message.Message,), { 'DESCRIPTOR' : _REPEATEDRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.RepeatedRules) }) _sym_db.RegisterMessage(RepeatedRules) MapRules = _reflection.GeneratedProtocolMessageType('MapRules', (_message.Message,), { 'DESCRIPTOR' : _MAPRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.MapRules) }) _sym_db.RegisterMessage(MapRules) AnyRules = _reflection.GeneratedProtocolMessageType('AnyRules', (_message.Message,), { 'DESCRIPTOR' : _ANYRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.AnyRules) }) _sym_db.RegisterMessage(AnyRules) DurationRules = _reflection.GeneratedProtocolMessageType('DurationRules', (_message.Message,), { 'DESCRIPTOR' : _DURATIONRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.DurationRules) }) _sym_db.RegisterMessage(DurationRules) TimestampRules = _reflection.GeneratedProtocolMessageType('TimestampRules', (_message.Message,), { 'DESCRIPTOR' : _TIMESTAMPRULES, '__module__' : 'validate.validate_pb2' # @@protoc_insertion_point(class_scope:validate.TimestampRules) }) _sym_db.RegisterMessage(TimestampRules) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(disabled) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(ignored) google_dot_protobuf_dot_descriptor__pb2.OneofOptions.RegisterExtension(required) rules.message_type = _FIELDRULES google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(rules) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope)
53.126667
12,018
0.756392
16,971
127,504
5.361145
0.029816
0.055394
0.084784
0.068551
0.833388
0.786765
0.767607
0.754473
0.729425
0.715137
0
0.049405
0.118161
127,504
2,399
12,019
53.148812
0.759788
0.012329
0
0.659825
1
0.000873
0.182345
0.141177
0
0
0
0
0
1
0
false
0
0.003493
0
0.003493
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
6225292c26cd8cfc17654d2bc5868c3ff18f6439
1,262
py
Python
script.py
sdc17/NaivePinYin
30301de4289d022160e121338c1b9e337f6ed5af
[ "MIT" ]
null
null
null
script.py
sdc17/NaivePinYin
30301de4289d022160e121338c1b9e337f6ed5af
[ "MIT" ]
null
null
null
script.py
sdc17/NaivePinYin
30301de4289d022160e121338c1b9e337f6ed5af
[ "MIT" ]
null
null
null
import os # 2 char # command = 'python predict.py -i=./data/input.txt -o=./data/output.txt --model_type=2c' # 3 char for 20% model # command = 'python predict.py -i=./data/input.txt -o=./data/output.txt --model_type=3c --full_model=False' # 3 char for full model command = 'python predict.py -i=./data/input.txt -o=./data/output.txt --model_type=3c --full_model=True' # 2 word for 20% model # command = 'python predict.py -i=./data/input.txt -o=./data/output.txt --model_type=2w --full_model=False' # 2 word for full model # command = 'python predict.py -i=./data/input.txt -o=./data/output.txt --model_type=2w --full_model=True' # TEST 2 char # command = 'python eval.py -i=./eval/eval.txt --record=False --model_type=2c' # TEST 3 char for 20% model # command = 'python eval.py -i=./eval/eval.txt --record=False --model_type=3c --full_model=False' # TEST 3 char for full model # command = 'python eval.py -i=./eval/eval.txt --record=False --model_type=3c --full_model=True' # TEST 2 word for 20% model # command = 'python eval.py -i=./eval/eval.txt --record=False --model_type=2w --full_model=False' # TEST 2 word for 100% model # command = 'python eval.py -i=./eval/eval.txt --record=False --model_type=2w --full_model=True' os.system(command)
32.358974
107
0.690174
218
1,262
3.912844
0.142202
0.116061
0.168816
0.128957
0.924971
0.91442
0.872216
0.828839
0.828839
0.828839
0
0.028259
0.130745
1,262
38
108
33.210526
0.749316
0.850238
0
0
0
0.333333
0.547619
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
9
624a6587a7043b122eae641878fe4c16180971e6
100
py
Python
src/momentchi2/__init__.py
deanbodenham/momentchi2py
b429cd8ac39fa9d55310e10bbbfbda8f9bb77169
[ "MIT" ]
3
2021-08-24T18:08:07.000Z
2022-03-18T13:01:21.000Z
src/momentchi2/__init__.py
deanbodenham/momentchi2py
b429cd8ac39fa9d55310e10bbbfbda8f9bb77169
[ "MIT" ]
null
null
null
src/momentchi2/__init__.py
deanbodenham/momentchi2py
b429cd8ac39fa9d55310e10bbbfbda8f9bb77169
[ "MIT" ]
1
2022-03-19T22:34:10.000Z
2022-03-19T22:34:10.000Z
from .methods import hbe from .methods import sw from .methods import wf from .methods import lpb4
20
25
0.79
16
100
4.9375
0.4375
0.556962
0.860759
0
0
0
0
0
0
0
0
0.012048
0.17
100
4
26
25
0.939759
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
6582c0b31d25e7ed98617d2a6891cf51cf7b2fbf
888
py
Python
temboo/core/Library/Zendesk/Groups/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
7
2016-03-07T02:07:21.000Z
2022-01-21T02:22:41.000Z
temboo/core/Library/Zendesk/Groups/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
null
null
null
temboo/core/Library/Zendesk/Groups/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
8
2016-06-14T06:01:11.000Z
2020-04-22T09:21:44.000Z
from temboo.Library.Zendesk.Groups.CreateGroup import CreateGroup, CreateGroupInputSet, CreateGroupResultSet, CreateGroupChoreographyExecution from temboo.Library.Zendesk.Groups.DeleteGroup import DeleteGroup, DeleteGroupInputSet, DeleteGroupResultSet, DeleteGroupChoreographyExecution from temboo.Library.Zendesk.Groups.ListGroups import ListGroups, ListGroupsInputSet, ListGroupsResultSet, ListGroupsChoreographyExecution from temboo.Library.Zendesk.Groups.ShowAssignableGroups import ShowAssignableGroups, ShowAssignableGroupsInputSet, ShowAssignableGroupsResultSet, ShowAssignableGroupsChoreographyExecution from temboo.Library.Zendesk.Groups.ShowGroup import ShowGroup, ShowGroupInputSet, ShowGroupResultSet, ShowGroupChoreographyExecution from temboo.Library.Zendesk.Groups.UpdateGroup import UpdateGroup, UpdateGroupInputSet, UpdateGroupResultSet, UpdateGroupChoreographyExecution
126.857143
187
0.905405
66
888
12.181818
0.454545
0.074627
0.126866
0.179104
0.223881
0
0
0
0
0
0
0
0.047297
888
6
188
148
0.950355
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
1
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
659598fd09710012a0d5082e9e06fabfde2b7925
139
py
Python
xnas/search_algorithm/TENAS/__init__.py
MAC-AutoML/XNAS
2c54ceb09b255cbcabd67f3c39fc777c4b2403f4
[ "MIT" ]
9
2021-04-21T08:14:03.000Z
2021-11-26T11:52:40.000Z
xnas/search_algorithm/TENAS/__init__.py
MAC-AutoML/XNAS
2c54ceb09b255cbcabd67f3c39fc777c4b2403f4
[ "MIT" ]
null
null
null
xnas/search_algorithm/TENAS/__init__.py
MAC-AutoML/XNAS
2c54ceb09b255cbcabd67f3c39fc777c4b2403f4
[ "MIT" ]
6
2021-05-19T02:36:43.000Z
2021-12-03T07:21:37.000Z
from xnas.search_algorithm.TENAS.linear_region_counter import Linear_Region_Collector from xnas.search_algorithm.TENAS.ntk import get_ntk_n
69.5
85
0.906475
22
139
5.363636
0.590909
0.135593
0.237288
0.389831
0.474576
0
0
0
0
0
0
0
0.05036
139
2
86
69.5
0.893939
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
65b4ccfe69f9c93e3a820c9be861445ebfbee6ba
48,338
py
Python
to_review/-tutorial_3.py
jdvelasq/smart-choice
152b13ddae682622e61a1dfb5b0a920c632480ab
[ "MIT" ]
1
2017-05-15T09:51:14.000Z
2017-05-15T09:51:14.000Z
to_review/-tutorial_3.py
jdvelasq/smart-choice
152b13ddae682622e61a1dfb5b0a920c632480ab
[ "MIT" ]
null
null
null
to_review/-tutorial_3.py
jdvelasq/smart-choice
152b13ddae682622e61a1dfb5b0a920c632480ab
[ "MIT" ]
1
2017-09-23T18:56:28.000Z
2017-09-23T18:56:28.000Z
# precision-tree # r""" # >>> from hardDecisions.decisiontree import * # >>> tree = DecisionTree() # #0 # >>> tree.decision_node(name='TEST', # ... branches=[(-55, 1), # ... ( 0, 14)], # ... max=True) # #1 # >>> tree.chance_node(name='STRUCT', # ... branches=[(38.0, 0, 2), # ... (39.0, 0, 6), # ... (23.0, 0, 10)]) # #2 # >>> tree.decision_node(name='DRILL1', # ... branches=[(-600, 3), # ... ( 0, 5)], # ... max=True) # #3 # >>> tree.chance_node(name='OILFOUND1', # ... branches=[(78.95, 0, 4), # ... (15.79, 1500, 4), # ... ( 5.26, 3400, 4)]) # #4 # >>> tree.terminal_node(expr='TEST+DRILL1+OILFOUND1') # #5 # >>> tree.terminal_node(expr='TEST+DRILL1') # #6 # >>> tree.decision_node(name='DRILL2', # ... branches=[(-600, 7), # ... ( 0, 9)], # ... max=True) # #7 # >>> tree.chance_node(name='OILFOUND2', # ... branches=[(38.46, 0, 8), # ... (46.15, 1500, 8), # ... (15.38, 3400, 8)]) # #8 # >>> tree.terminal_node(expr='TEST+DRILL2+OILFOUND2') # #9 # >>> tree.terminal_node(expr='TEST+DRILL2') # #10 # >>> tree.decision_node(name='DRILL3', # ... branches=[(-600, 11), # ... ( 0, 13)], # ... max=True) # #11 # >>> tree.chance_node(name='OILFOUND3', # ... branches=[(21.74, 0, 12), # ... (26.09, 1500, 12), # ... (52.17, 3400, 12)]) # #12 # >>> tree.terminal_node(expr='TEST+DRILL3+OILFOUND3') # #13 # >>> tree.terminal_node(expr='TEST+DRILL3') # #14 # >>> tree.decision_node(name='DRILL4', # ... branches=[(-600, 15), # ... ( 0, 17)], # ... max=True) # #15 # >>> tree.chance_node(name='OILFOUND4', # ... branches=[(50.0, 0, 16), # ... (30.0, 1500, 16), # ... (20.0, 3400, 16)]) # #16 # >>> tree.terminal_node(expr='TEST+DRILL4+OILFOUND4') # #17 # >>> tree.terminal_node(expr='TEST+DRILL4') # >>> tree.display_nodes() # doctest: +NORMALIZE_WHITESPACE # Node 0 # Type: DECISION - Maximum Payoff # Name: TEST # Branches: # Value Next Node # -55.000 1 # 0.000 14 # <BLANKLINE> # Node 1 # Type: CHANCE # Name: STRUCT # Branches: # Chance Value Next Node # 38.00 0.000 2 # 39.00 0.000 6 # 23.00 0.000 10 # <BLANKLINE> # Node 2 # Type: DECISION - Maximum Payoff # Name: DRILL1 # Branches: # Value Next Node # -600.000 3 # 0.000 5 # <BLANKLINE> # Node 3 # Type: CHANCE # Name: OILFOUND1 # Branches: # Chance Value Next Node # 78.95 0.000 4 # 15.79 1500.000 4 # 5.26 3400.000 4 # <BLANKLINE> # Node 4 # Type: TERMINAL # Expr: TEST+DRILL1+OILFOUND1 # <BLANKLINE> # Node 5 # Type: TERMINAL # Expr: TEST+DRILL1 # <BLANKLINE> # Node 6 # Type: DECISION - Maximum Payoff # Name: DRILL2 # Branches: # Value Next Node # -600.000 7 # 0.000 9 # <BLANKLINE> # Node 7 # Type: CHANCE # Name: OILFOUND2 # Branches: # Chance Value Next Node # 38.46 0.000 8 # 46.15 1500.000 8 # 15.38 3400.000 8 # <BLANKLINE> # Node 8 # Type: TERMINAL # Expr: TEST+DRILL2+OILFOUND2 # <BLANKLINE> # Node 9 # Type: TERMINAL # Expr: TEST+DRILL2 # <BLANKLINE> # Node 10 # Type: DECISION - Maximum Payoff # Name: DRILL3 # Branches: # Value Next Node # -600.000 11 # 0.000 13 # <BLANKLINE> # Node 11 # Type: CHANCE # Name: OILFOUND3 # Branches: # Chance Value Next Node # 21.74 0.000 12 # 26.09 1500.000 12 # 52.17 3400.000 12 # <BLANKLINE> # Node 12 # Type: TERMINAL # Expr: TEST+DRILL3+OILFOUND3 # <BLANKLINE> # Node 13 # Type: TERMINAL # Expr: TEST+DRILL3 # <BLANKLINE> # Node 14 # Type: DECISION - Maximum Payoff # Name: DRILL4 # Branches: # Value Next Node # -600.000 15 # 0.000 17 # <BLANKLINE> # Node 15 # Type: CHANCE # Name: OILFOUND4 # Branches: # Chance Value Next Node # 50.00 0.000 16 # 30.00 1500.000 16 # 20.00 3400.000 16 # <BLANKLINE> # Node 16 # Type: TERMINAL # Expr: TEST+DRILL4+OILFOUND4 # <BLANKLINE> # Node 17 # Type: TERMINAL # Expr: TEST+DRILL4 # <BLANKLINE> # >>> tree.build_tree() # >>> tree.display_tree() # doctest: +NORMALIZE_WHITESPACE # | # | #0 # \-------[D] # | # | #1 # | TEST=-55 # +-------[C] # | | # | | #2 # | | STRUCT=0 # | | Prob=38.00 # | +-------[D] # | | | # | | | #3 # | | | DRILL1=-600 # | | +-------[C] # | | | | # | | | | #4 # | | | | OILFOUND1=0 # | | | | Prob=78.95 # | | | +-------[T] TEST+DRILL1+OILFOUND1 # | | | | # | | | | #5 # | | | | OILFOUND1=1500 # | | | | Prob=15.79 # | | | +-------[T] TEST+DRILL1+OILFOUND1 # | | | | # | | | | #6 # | | | | OILFOUND1=3400 # | | | | Prob=5.26 # | | | \-------[T] TEST+DRILL1+OILFOUND1 # | | | # | | | #7 # | | | DRILL1=0 # | | \-------[T] TEST+DRILL1 # | | # | | #8 # | | STRUCT=0 # | | Prob=39.00 # | +-------[D] # | | | # | | | #9 # | | | DRILL2=-600 # | | +-------[C] # | | | | # | | | | #10 # | | | | OILFOUND2=0 # | | | | Prob=38.46 # | | | +-------[T] TEST+DRILL2+OILFOUND2 # | | | | # | | | | #11 # | | | | OILFOUND2=1500 # | | | | Prob=46.15 # | | | +-------[T] TEST+DRILL2+OILFOUND2 # | | | | # | | | | #12 # | | | | OILFOUND2=3400 # | | | | Prob=15.38 # | | | \-------[T] TEST+DRILL2+OILFOUND2 # | | | # | | | #13 # | | | DRILL2=0 # | | \-------[T] TEST+DRILL2 # | | # | | #14 # | | STRUCT=0 # | | Prob=23.00 # | \-------[D] # | | # | | #15 # | | DRILL3=-600 # | +-------[C] # | | | # | | | #16 # | | | OILFOUND3=0 # | | | Prob=21.74 # | | +-------[T] TEST+DRILL3+OILFOUND3 # | | | # | | | #17 # | | | OILFOUND3=1500 # | | | Prob=26.09 # | | +-------[T] TEST+DRILL3+OILFOUND3 # | | | # | | | #18 # | | | OILFOUND3=3400 # | | | Prob=52.17 # | | \-------[T] TEST+DRILL3+OILFOUND3 # | | # | | #19 # | | DRILL3=0 # | \-------[T] TEST+DRILL3 # | # | #20 # | TEST=0 # \-------[D] # | # | #21 # | DRILL4=-600 # +-------[C] # | | # | | #22 # | | OILFOUND4=0 # | | Prob=50.00 # | +-------[T] TEST+DRILL4+OILFOUND4 # | | # | | #23 # | | OILFOUND4=1500 # | | Prob=30.00 # | +-------[T] TEST+DRILL4+OILFOUND4 # | | # | | #24 # | | OILFOUND4=3400 # | | Prob=20.00 # | \-------[T] TEST+DRILL4+OILFOUND4 # | # | #25 # | DRILL4=0 # \-------[T] TEST+DRILL4 # >>> tree.evaluate() # >>> tree.display_tree() # doctest: +NORMALIZE_WHITESPACE # | # | #0 # | ExpVal=544.92 # | (selected strategy) # \-------[D] # | # | #1 # | TEST=-55 # | ExpVal=544.92 # | (selected strategy) # +-------[C] # | | # | | #2 # | | STRUCT=0 # | | Prob=38.00 # | | ExpVal=-55.00 # | | (selected strategy) # | +-------[D] # | | | # | | | #3 # | | | DRILL1=-600 # | | | ExpVal=-239.31 # | | +-------[C] # | | | | # | | | | #4 # | | | | OILFOUND1=0 # | | | | Prob=78.95 # | | | | PathProb=0.00 # | | | | ExpVal=-655.00 # | | | +-------[T] TEST+DRILL1+OILFOUND1 # | | | | # | | | | #5 # | | | | OILFOUND1=1500 # | | | | Prob=15.79 # | | | | PathProb=0.00 # | | | | ExpVal=845.00 # | | | +-------[T] TEST+DRILL1+OILFOUND1 # | | | | # | | | | #6 # | | | | OILFOUND1=3400 # | | | | Prob=5.26 # | | | | PathProb=0.00 # | | | | ExpVal=2745.00 # | | | \-------[T] TEST+DRILL1+OILFOUND1 # | | | # | | | #7 # | | | DRILL1=0 # | | | PathProb=38.00 # | | | ExpVal=-55.00 # | | | (selected strategy) # | | \-------[T] TEST+DRILL1 # | | # | | #8 # | | STRUCT=0 # | | Prob=39.00 # | | ExpVal=560.24 # | | (selected strategy) # | +-------[D] # | | | # | | | #9 # | | | DRILL2=-600 # | | | ExpVal=560.24 # | | | (selected strategy) # | | +-------[C] # | | | | # | | | | #10 # | | | | OILFOUND2=0 # | | | | Prob=38.46 # | | | | PathProb=15.00 # | | | | ExpVal=-655.00 # | | | | (selected strategy) # | | | +-------[T] TEST+DRILL2+OILFOUND2 # | | | | # | | | | #11 # | | | | OILFOUND2=1500 # | | | | Prob=46.15 # | | | | PathProb=18.00 # | | | | ExpVal=845.00 # | | | | (selected strategy) # | | | +-------[T] TEST+DRILL2+OILFOUND2 # | | | | # | | | | #12 # | | | | OILFOUND2=3400 # | | | | Prob=15.38 # | | | | PathProb=6.00 # | | | | ExpVal=2745.00 # | | | | (selected strategy) # | | | \-------[T] TEST+DRILL2+OILFOUND2 # | | | # | | | #13 # | | | DRILL2=0 # | | | PathProb=0.00 # | | | ExpVal=-55.00 # | | \-------[T] TEST+DRILL2 # | | # | | #14 # | | STRUCT=0 # | | Prob=23.00 # | | ExpVal=1510.13 # | | (selected strategy) # | \-------[D] # | | # | | #15 # | | DRILL3=-600 # | | ExpVal=1510.13 # | | (selected strategy) # | +-------[C] # | | | # | | | #16 # | | | OILFOUND3=0 # | | | Prob=21.74 # | | | PathProb=5.00 # | | | ExpVal=-655.00 # | | | (selected strategy) # | | +-------[T] TEST+DRILL3+OILFOUND3 # | | | # | | | #17 # | | | OILFOUND3=1500 # | | | Prob=26.09 # | | | PathProb=6.00 # | | | ExpVal=845.00 # | | | (selected strategy) # | | +-------[T] TEST+DRILL3+OILFOUND3 # | | | # | | | #18 # | | | OILFOUND3=3400 # | | | Prob=52.17 # | | | PathProb=12.00 # | | | ExpVal=2745.00 # | | | (selected strategy) # | | \-------[T] TEST+DRILL3+OILFOUND3 # | | # | | #19 # | | DRILL3=0 # | | PathProb=0.00 # | | ExpVal=-55.00 # | \-------[T] TEST+DRILL3 # | # | #20 # | TEST=0 # | ExpVal=530.00 # \-------[D] # | # | #21 # | DRILL4=-600 # | ExpVal=530.00 # +-------[C] # | | # | | #22 # | | OILFOUND4=0 # | | Prob=50.00 # | | PathProb=0.00 # | | ExpVal=-600.00 # | +-------[T] TEST+DRILL4+OILFOUND4 # | | # | | #23 # | | OILFOUND4=1500 # | | Prob=30.00 # | | PathProb=0.00 # | | ExpVal=900.00 # | +-------[T] TEST+DRILL4+OILFOUND4 # | | # | | #24 # | | OILFOUND4=3400 # | | Prob=20.00 # | | PathProb=0.00 # | | ExpVal=2800.00 # | \-------[T] TEST+DRILL4+OILFOUND4 # | # | #25 # | DRILL4=0 # | PathProb=0.00 # | ExpVal=0.00 # \-------[T] TEST+DRILL4 # >>> tree.compute_risk_profile() # >>> tree.display_tree(selected_strategy=True) # doctest: +NORMALIZE_WHITESPACE # | # | #0 # | ExpVal=544.92 # | Risk Profile: # | Value Prob # | -655.00 20.00 # | -55.00 38.00 # | 845.00 24.00 # | 2745.00 18.00 # | (selected strategy) # \-------[D] # | # | #1 # | TEST=-55 # | ExpVal=544.92 # | Risk Profile: # | Value Prob # | -655.00 20.00 # | -55.00 38.00 # | 845.00 24.00 # | 2745.00 18.00 # | (selected strategy) # \-------[C] # | # | #2 # | STRUCT=0 # | Prob=38.00 # | ExpVal=-55.00 # | Risk Profile: # | Value Prob # | -55.00 38.00 # | (selected strategy) # +-------[D] # | | # | | #7 # | | DRILL1=0 # | | PathProb=38.00 # | | ExpVal=-55.00 # | | (selected strategy) # | \-------[T] TEST+DRILL1 # | # | #8 # | STRUCT=0 # | Prob=39.00 # | ExpVal=560.24 # | Risk Profile: # | Value Prob # | -655.00 15.00 # | 845.00 18.00 # | 2745.00 6.00 # | (selected strategy) # +-------[D] # | | # | | #9 # | | DRILL2=-600 # | | ExpVal=560.24 # | | Risk Profile: # | | Value Prob # | | -655.00 15.00 # | | 845.00 18.00 # | | 2745.00 6.00 # | | (selected strategy) # | \-------[C] # | | # | | #10 # | | OILFOUND2=0 # | | Prob=38.46 # | | PathProb=15.00 # | | ExpVal=-655.00 # | | (selected strategy) # | +-------[T] TEST+DRILL2+OILFOUND2 # | | # | | #11 # | | OILFOUND2=1500 # | | Prob=46.15 # | | PathProb=18.00 # | | ExpVal=845.00 # | | (selected strategy) # | +-------[T] TEST+DRILL2+OILFOUND2 # | | # | | #12 # | | OILFOUND2=3400 # | | Prob=15.38 # | | PathProb=6.00 # | | ExpVal=2745.00 # | | (selected strategy) # | \-------[T] TEST+DRILL2+OILFOUND2 # | # | #14 # | STRUCT=0 # | Prob=23.00 # | ExpVal=1510.13 # | Risk Profile: # | Value Prob # | -655.00 5.00 # | 845.00 6.00 # | 2745.00 12.00 # | (selected strategy) # \-------[D] # | # | #15 # | DRILL3=-600 # | ExpVal=1510.13 # | Risk Profile: # | Value Prob # | -655.00 5.00 # | 845.00 6.00 # | 2745.00 12.00 # | (selected strategy) # \-------[C] # | # | #16 # | OILFOUND3=0 # | Prob=21.74 # | PathProb=5.00 # | ExpVal=-655.00 # | (selected strategy) # +-------[T] TEST+DRILL3+OILFOUND3 # | # | #17 # | OILFOUND3=1500 # | Prob=26.09 # | PathProb=6.00 # | ExpVal=845.00 # | (selected strategy) # +-------[T] TEST+DRILL3+OILFOUND3 # | # | #18 # | OILFOUND3=3400 # | Prob=52.17 # | PathProb=12.00 # | ExpVal=2745.00 # | (selected strategy) # \-------[T] TEST+DRILL3+OILFOUND3 # >>> tree = DecisionTree() # #0 # >>> tree.decision_node(name='TEST', # ... branches=[(-55, 1), # ... ( 0, 9)], # ... max=True) # #1 # >>> tree.chance_node(name='STRUCT', # ... branches=[(38.0, 0, 2), # ... (39.0, 0, 5), # ... (23.0, 0, 7)]) # #2 # >>> tree.decision_node(name='DRILL', # ... branches=[(-600, 3), # ... ( 0, 4)], # ... max=True) # #3 # >>> tree.chance_node(name='OILFOUND', # ... branches=[(78.95, 0, 4), # ... (15.79, 1500, 4), # ... (05.26, 3400, 4)]) # #4 # >>> tree.terminal_node() # #5 # >>> tree.decision_node(name='DRILL', # ... branches=[(-600, 6), # ... ( 0, 4)], # ... max=True) # #6 # >>> tree.chance_node(name='OILFOUND', # ... branches=[(38.46, 0, 4), # ... (46.15, 1500, 4), # ... (15.38, 3400, 4)]) # #7 # >>> tree.decision_node(name='DRILL', # ... branches=[(-600, 8), # ... ( 0, 4)], # ... max=True) # #8 # >>> tree.chance_node(name='OILFOUND', # ... branches=[(21.74, 0, 4), # ... (26.09, 1500, 4), # ... (52.17, 3400, 4)]) # #9 # >>> tree.decision_node(name='DRILL', # ... branches=[(-600, 10), # ... ( 0, 4)], # ... max=True) # #10 # >>> tree.chance_node(name='OILFOUND', # ... branches=[(50.0, 0, 4), # ... (30.0, 1500, 4), # ... (20.0, 3400, 4)]) # >>> tree.display_nodes() # doctest: +NORMALIZE_WHITESPACE # Node 0 # Type: DECISION - Maximum Payoff # Name: TEST # Branches: # Value Next Node # -55.000 1 # 0.000 9 # <BLANKLINE> # Node 1 # Type: CHANCE # Name: STRUCT # Branches: # Chance Value Next Node # 38.00 0.000 2 # 39.00 0.000 5 # 23.00 0.000 7 # <BLANKLINE> # Node 2 # Type: DECISION - Maximum Payoff # Name: DRILL # Branches: # Value Next Node # -600.000 3 # 0.000 4 # <BLANKLINE> # Node 3 # Type: CHANCE # Name: OILFOUND # Branches: # Chance Value Next Node # 78.95 0.000 4 # 15.79 1500.000 4 # 5.26 3400.000 4 # <BLANKLINE> # Node 4 # Type: TERMINAL # Expr: (cumulative) # <BLANKLINE> # Node 5 # Type: DECISION - Maximum Payoff # Name: DRILL # Branches: # Value Next Node # -600.000 6 # 0.000 4 # <BLANKLINE> # Node 6 # Type: CHANCE # Name: OILFOUND # Branches: # Chance Value Next Node # 38.46 0.000 4 # 46.15 1500.000 4 # 15.38 3400.000 4 # <BLANKLINE> # Node 7 # Type: DECISION - Maximum Payoff # Name: DRILL # Branches: # Value Next Node # -600.000 8 # 0.000 4 # <BLANKLINE> # Node 8 # Type: CHANCE # Name: OILFOUND # Branches: # Chance Value Next Node # 21.74 0.000 4 # 26.09 1500.000 4 # 52.17 3400.000 4 # <BLANKLINE> # Node 9 # Type: DECISION - Maximum Payoff # Name: DRILL # Branches: # Value Next Node # -600.000 10 # 0.000 4 # <BLANKLINE> # Node 10 # Type: CHANCE # Name: OILFOUND # Branches: # Chance Value Next Node # 50.00 0.000 4 # 30.00 1500.000 4 # 20.00 3400.000 4 # <BLANKLINE> # >>> tree.build_tree() # >>> tree.display_tree() # doctest: +NORMALIZE_WHITESPACE # | # | #0 # \-------[D] # | # | #1 # | TEST=-55 # +-------[C] # | | # | | #2 # | | STRUCT=0 # | | Prob=38.00 # | +-------[D] # | | | # | | | #3 # | | | DRILL=-600 # | | +-------[C] # | | | | # | | | | #4 # | | | | OILFOUND=0 # | | | | Prob=78.95 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #5 # | | | | OILFOUND=1500 # | | | | Prob=15.79 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #6 # | | | | OILFOUND=3400 # | | | | Prob=5.26 # | | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #7 # | | | DRILL=0 # | | \-------[T] TEST+STRUCT+DRILL # | | # | | #8 # | | STRUCT=0 # | | Prob=39.00 # | +-------[D] # | | | # | | | #9 # | | | DRILL=-600 # | | +-------[C] # | | | | # | | | | #10 # | | | | OILFOUND=0 # | | | | Prob=38.46 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #11 # | | | | OILFOUND=1500 # | | | | Prob=46.15 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #12 # | | | | OILFOUND=3400 # | | | | Prob=15.38 # | | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #13 # | | | DRILL=0 # | | \-------[T] TEST+STRUCT+DRILL # | | # | | #14 # | | STRUCT=0 # | | Prob=23.00 # | \-------[D] # | | # | | #15 # | | DRILL=-600 # | +-------[C] # | | | # | | | #16 # | | | OILFOUND=0 # | | | Prob=21.74 # | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #17 # | | | OILFOUND=1500 # | | | Prob=26.09 # | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #18 # | | | OILFOUND=3400 # | | | Prob=52.17 # | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | # | | #19 # | | DRILL=0 # | \-------[T] TEST+STRUCT+DRILL # | # | #20 # | TEST=0 # \-------[D] # | # | #21 # | DRILL=-600 # +-------[C] # | | # | | #22 # | | OILFOUND=0 # | | Prob=50.00 # | +-------[T] TEST+DRILL+OILFOUND # | | # | | #23 # | | OILFOUND=1500 # | | Prob=30.00 # | +-------[T] TEST+DRILL+OILFOUND # | | # | | #24 # | | OILFOUND=3400 # | | Prob=20.00 # | \-------[T] TEST+DRILL+OILFOUND # | # | #25 # | DRILL=0 # \-------[T] TEST+DRILL # >>> tree.evaluate() # >>> tree.display_tree() # doctest: +NORMALIZE_WHITESPACE # | # | #0 # | ExpVal=544.92 # | (selected strategy) # \-------[D] # | # | #1 # | TEST=-55 # | ExpVal=544.92 # | (selected strategy) # +-------[C] # | | # | | #2 # | | STRUCT=0 # | | Prob=38.00 # | | ExpVal=-55.00 # | | (selected strategy) # | +-------[D] # | | | # | | | #3 # | | | DRILL=-600 # | | | ExpVal=-239.31 # | | +-------[C] # | | | | # | | | | #4 # | | | | OILFOUND=0 # | | | | Prob=78.95 # | | | | PathProb=0.00 # | | | | ExpVal=-655.00 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #5 # | | | | OILFOUND=1500 # | | | | Prob=15.79 # | | | | PathProb=0.00 # | | | | ExpVal=845.00 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #6 # | | | | OILFOUND=3400 # | | | | Prob=5.26 # | | | | PathProb=0.00 # | | | | ExpVal=2745.00 # | | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #7 # | | | DRILL=0 # | | | PathProb=38.00 # | | | ExpVal=-55.00 # | | | (selected strategy) # | | \-------[T] TEST+STRUCT+DRILL # | | # | | #8 # | | STRUCT=0 # | | Prob=39.00 # | | ExpVal=560.24 # | | (selected strategy) # | +-------[D] # | | | # | | | #9 # | | | DRILL=-600 # | | | ExpVal=560.24 # | | | (selected strategy) # | | +-------[C] # | | | | # | | | | #10 # | | | | OILFOUND=0 # | | | | Prob=38.46 # | | | | PathProb=15.00 # | | | | ExpVal=-655.00 # | | | | (selected strategy) # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #11 # | | | | OILFOUND=1500 # | | | | Prob=46.15 # | | | | PathProb=18.00 # | | | | ExpVal=845.00 # | | | | (selected strategy) # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #12 # | | | | OILFOUND=3400 # | | | | Prob=15.38 # | | | | PathProb=6.00 # | | | | ExpVal=2745.00 # | | | | (selected strategy) # | | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #13 # | | | DRILL=0 # | | | PathProb=0.00 # | | | ExpVal=-55.00 # | | \-------[T] TEST+STRUCT+DRILL # | | # | | #14 # | | STRUCT=0 # | | Prob=23.00 # | | ExpVal=1510.13 # | | (selected strategy) # | \-------[D] # | | # | | #15 # | | DRILL=-600 # | | ExpVal=1510.13 # | | (selected strategy) # | +-------[C] # | | | # | | | #16 # | | | OILFOUND=0 # | | | Prob=21.74 # | | | PathProb=5.00 # | | | ExpVal=-655.00 # | | | (selected strategy) # | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #17 # | | | OILFOUND=1500 # | | | Prob=26.09 # | | | PathProb=6.00 # | | | ExpVal=845.00 # | | | (selected strategy) # | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #18 # | | | OILFOUND=3400 # | | | Prob=52.17 # | | | PathProb=12.00 # | | | ExpVal=2745.00 # | | | (selected strategy) # | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | # | | #19 # | | DRILL=0 # | | PathProb=0.00 # | | ExpVal=-55.00 # | \-------[T] TEST+STRUCT+DRILL # | # | #20 # | TEST=0 # | ExpVal=530.00 # \-------[D] # | # | #21 # | DRILL=-600 # | ExpVal=530.00 # +-------[C] # | | # | | #22 # | | OILFOUND=0 # | | Prob=50.00 # | | PathProb=0.00 # | | ExpVal=-600.00 # | +-------[T] TEST+DRILL+OILFOUND # | | # | | #23 # | | OILFOUND=1500 # | | Prob=30.00 # | | PathProb=0.00 # | | ExpVal=900.00 # | +-------[T] TEST+DRILL+OILFOUND # | | # | | #24 # | | OILFOUND=3400 # | | Prob=20.00 # | | PathProb=0.00 # | | ExpVal=2800.00 # | \-------[T] TEST+DRILL+OILFOUND # | # | #25 # | DRILL=0 # | PathProb=0.00 # | ExpVal=0.00 # \-------[T] TEST+DRILL # >>> tree = DecisionTree() # #0 # >>> tree.decision_node(name='TEST', # ... branches=[(-55, 1), # ... ( 0, 2)], # ... max=True) # #1 # >>> tree.chance_node(name='STRUCT', # ... branches=[(38.0, 0, 2), # ... (39.0, 0, 2), # ... (23.0, 0, 2)]) # #2 # >>> tree.decision_node(name='DRILL', # ... branches=[(-600, 3), # ... ( 0, 4)], # ... max=True) # #3 # >>> prob_branch_1 = (0, [(1, [78.95, 38.46, 21.74]), 50.00]) # >>> prob_branch_2 = (0, [(1, [15.79, 46.15, 26.09]), 30.00]) # >>> prob_branch_3 = (0, [(1, [05.26, 15.38, 52.17]), 20.00]) # >>> tree.chance_node(name='OILFOUND', # ... branches=[(prob_branch_1, 0, 4), # ... (prob_branch_2, 1500, 4), # ... (prob_branch_3, 3400, 4)]) # #4 # >>> tree.terminal_node() # >>> tree.build_tree() # >>> tree.evaluate() # >>> tree.display_tree() # doctest: +NORMALIZE_WHITESPACE # | # | #0 # | ExpVal=544.92 # | (selected strategy) # \-------[D] # | # | #1 # | TEST=-55 # | ExpVal=544.92 # | (selected strategy) # +-------[C] # | | # | | #2 # | | STRUCT=0 # | | Prob=38.00 # | | ExpVal=-55.00 # | | (selected strategy) # | +-------[D] # | | | # | | | #3 # | | | DRILL=-600 # | | | ExpVal=-239.31 # | | +-------[C] # | | | | # | | | | #4 # | | | | OILFOUND=0 # | | | | Prob=78.95 # | | | | PathProb=0.00 # | | | | ExpVal=-655.00 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #5 # | | | | OILFOUND=1500 # | | | | Prob=15.79 # | | | | PathProb=0.00 # | | | | ExpVal=845.00 # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #6 # | | | | OILFOUND=3400 # | | | | Prob=5.26 # | | | | PathProb=0.00 # | | | | ExpVal=2745.00 # | | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #7 # | | | DRILL=0 # | | | PathProb=38.00 # | | | ExpVal=-55.00 # | | | (selected strategy) # | | \-------[T] TEST+STRUCT+DRILL # | | # | | #8 # | | STRUCT=0 # | | Prob=39.00 # | | ExpVal=560.24 # | | (selected strategy) # | +-------[D] # | | | # | | | #9 # | | | DRILL=-600 # | | | ExpVal=560.24 # | | | (selected strategy) # | | +-------[C] # | | | | # | | | | #10 # | | | | OILFOUND=0 # | | | | Prob=38.46 # | | | | PathProb=15.00 # | | | | ExpVal=-655.00 # | | | | (selected strategy) # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #11 # | | | | OILFOUND=1500 # | | | | Prob=46.15 # | | | | PathProb=18.00 # | | | | ExpVal=845.00 # | | | | (selected strategy) # | | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | | # | | | | #12 # | | | | OILFOUND=3400 # | | | | Prob=15.38 # | | | | PathProb=6.00 # | | | | ExpVal=2745.00 # | | | | (selected strategy) # | | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #13 # | | | DRILL=0 # | | | PathProb=0.00 # | | | ExpVal=-55.00 # | | \-------[T] TEST+STRUCT+DRILL # | | # | | #14 # | | STRUCT=0 # | | Prob=23.00 # | | ExpVal=1510.13 # | | (selected strategy) # | \-------[D] # | | # | | #15 # | | DRILL=-600 # | | ExpVal=1510.13 # | | (selected strategy) # | +-------[C] # | | | # | | | #16 # | | | OILFOUND=0 # | | | Prob=21.74 # | | | PathProb=5.00 # | | | ExpVal=-655.00 # | | | (selected strategy) # | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #17 # | | | OILFOUND=1500 # | | | Prob=26.09 # | | | PathProb=6.00 # | | | ExpVal=845.00 # | | | (selected strategy) # | | +-------[T] TEST+STRUCT+DRILL+OILFOUND # | | | # | | | #18 # | | | OILFOUND=3400 # | | | Prob=52.17 # | | | PathProb=12.00 # | | | ExpVal=2745.00 # | | | (selected strategy) # | | \-------[T] TEST+STRUCT+DRILL+OILFOUND # | | # | | #19 # | | DRILL=0 # | | PathProb=0.00 # | | ExpVal=-55.00 # | \-------[T] TEST+STRUCT+DRILL # | # | #20 # | TEST=0 # | ExpVal=530.00 # \-------[D] # | # | #21 # | DRILL=-600 # | ExpVal=530.00 # +-------[C] # | | # | | #22 # | | OILFOUND=0 # | | Prob=50.00 # | | PathProb=0.00 # | | ExpVal=-600.00 # | +-------[T] TEST+DRILL+OILFOUND # | | # | | #23 # | | OILFOUND=1500 # | | Prob=30.00 # | | PathProb=0.00 # | | ExpVal=900.00 # | +-------[T] TEST+DRILL+OILFOUND # | | # | | #24 # | | OILFOUND=3400 # | | Prob=20.00 # | | PathProb=0.00 # | | ExpVal=2800.00 # | \-------[T] TEST+DRILL+OILFOUND # | # | #25 # | DRILL=0 # | PathProb=0.00 # | ExpVal=0.00 # \-------[T] TEST+DRILL # """ # if __name__ == "__main__": # import doctest # doctest.testmod()
36.262566
80
0.233212
2,876
48,338
3.893255
0.039638
0.03885
0.061088
0.051442
0.865232
0.827543
0.777083
0.728141
0.704832
0.650263
0
0.149481
0.614982
48,338
1,332
81
36.28979
0.452152
0.942385
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
0
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
10
65e9eb07ea3e03d1b900c9d2d68d8703e4cc422e
15,712
py
Python
tests/test_ithil.py
Ithil-protocol/palantir
48dcfd05a04890c6e49cff16b26e854c026b104b
[ "MIT" ]
null
null
null
tests/test_ithil.py
Ithil-protocol/palantir
48dcfd05a04890c6e49cff16b26e854c026b104b
[ "MIT" ]
null
null
null
tests/test_ithil.py
Ithil-protocol/palantir
48dcfd05a04890c6e49cff16b26e854c026b104b
[ "MIT" ]
1
2022-03-03T17:32:03.000Z
2022-03-03T17:32:03.000Z
from typing import List from palantir.clock import Clock from palantir.constants import ( GAUSS_RANDOM_SLIPPAGE, ) from palantir.db import Quote from palantir.ithil import Ithil from palantir.metrics import MetricsLogger from palantir.oracle import PriceOracle from palantir.types import ( Account, Currency, Price, ) from palantir.util import Percent NO_FEES = lambda _: 0.0 NO_INTEREST = lambda _src_token, _dst_token, _collateral, _principal: 0.0 NO_SLIPPAGE = lambda price: price def make_test_quotes_from_prices(prices: List[Price]) -> List[Quote]: return [ Quote(id=0, coin='', vs_currency='usd', timestamp=0, price=price) for price in prices ] def test_trade_zero_fees_zero_interest_with_profit(): """ Trader invests in DAI/WETH with a profit of 10%. Collateral of 100.0, leverage of x10. No fees and no interest. Position in closed with a profit. """ DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 COLLATERAL = 100.0 PRINCIPAL = 1000.0 quotes = { Currency('dai'): make_test_quotes_from_prices( [1.0, 1.0] ), Currency('ethereum'): make_test_quotes_from_prices( [4000, 4000 + Percent(10).of(4000)] ), } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=NO_FEES, calculate_interest_rate=NO_INTEREST, calculate_liquidation_fee=lambda _: 0.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (0.0, fees), vaults={ Currency('dai'): DAI_LIQUIDITY, }, ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10, ) assert position_id is not None assert position_id in ithil.positions, metrics_logger.metrics clock.step() assert ithil.can_liquidate_position(position_id) == False trader_pl, liquidation_pl = ithil.close_position(position_id) assert trader_pl == Percent(10).of(PRINCIPAL) assert liquidation_pl == 0.0 assert ithil.vaults[Currency("dai")] == DAI_LIQUIDITY assert ithil.insurance_pool[Currency("dai")] == DAI_INSURANCE_LIQUIDITY def test_trade_zero_fees_zero_interest_with_partial_loss(): """ Trader invests in DAI/WETH with a loss of 5%. Collateral of 100.0, leverage of x10. No fees and no interest. Position in closed with a loss fully covered by the collateral. """ COLLATERAL = 100.0 PRINCIPAL = 1000.0 DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 quotes = { Currency("ethereum"): make_test_quotes_from_prices( [4400, 4400 - Percent(5).of(4400)] ), Currency("dai"): make_test_quotes_from_prices( [1.0, 1.0] ) } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=NO_FEES, calculate_interest_rate=NO_INTEREST, calculate_liquidation_fee=lambda _: 0.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (0.0, fees), vaults={ Currency("dai"): DAI_LIQUIDITY, }, ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10, ) assert position_id is not None assert position_id in ithil.active_positions clock.step() assert ithil.can_liquidate_position(position_id) == False trader_pl, liquidation_pl = ithil.close_position(position_id) assert trader_pl == -Percent(5).of(PRINCIPAL) assert liquidation_pl == 0.0 assert ithil.vaults[Currency("dai")] == DAI_LIQUIDITY assert ithil.insurance_pool[Currency("dai")] == DAI_INSURANCE_LIQUIDITY def test_trade_zero_fees_zero_interest_with_total_loss(): """ Trader invests in DAI/WETH with a loss of 120% of collateral. Collateral of 100.0, leverage of x10. No fees and no interest. Position in closed with a loss not fully covered by the collateral. LPs are compensated by the insurance pool. """ DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 COLLATERAL = 100.0 PRINCIPAL = 1000.0 quotes = { Currency("dai"): make_test_quotes_from_prices([1.0, 1.0]), Currency("ethereum"): make_test_quotes_from_prices([4400, 4400 - Percent(12).of(4400)]) } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=NO_FEES, calculate_interest_rate=NO_INTEREST, calculate_liquidation_fee=lambda _: 0.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (0.0, fees), vaults={ Currency("dai"): DAI_LIQUIDITY, }, ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10, ) assert position_id is not None assert position_id in ithil.active_positions clock.step() assert ithil.can_liquidate_position(position_id) == True trader_pl, liquidation_pl = ithil.close_position(position_id) assert trader_pl == -COLLATERAL assert liquidation_pl == 0.0 assert ithil.vaults[Currency("dai")] == DAI_LIQUIDITY loss = Percent(12).of(PRINCIPAL) assert ithil.insurance_pool[Currency("dai")] == DAI_INSURANCE_LIQUIDITY - (loss - COLLATERAL) def test_trade_fees_zero_interest_with_profit(): """ Trader invests in DAI/WETH with a profit of 10%. Collateral of 100.0, leverage of x10. 1% fees on collateral and no interest. Fees are split 50/50 between governance and insurance pool. Position in closed with a profit. """ DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 COLLATERAL = 100.0 PRINCIPAL = 1000.0 quotes = { Currency('dai'): make_test_quotes_from_prices( [1.0, 1.0] ), Currency('ethereum'): make_test_quotes_from_prices( [4000, 4000 + Percent(10).of(4000)] ), } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=lambda position: position.collateral / 100.0, calculate_interest_rate=NO_INTEREST, calculate_liquidation_fee=lambda _: 0.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (fees / 2.0, fees / 2.0), vaults={ Currency('dai'): DAI_LIQUIDITY, }, ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10, ) assert position_id is not None assert position_id in ithil.positions, metrics_logger.metrics position = ithil.active_positions[position_id] FEES = ithil.calculate_fees(position) GOVERNANCE_FEES, INSURANCE_FEES = ithil.split_fees(FEES) clock.step() assert ithil.can_liquidate_position(position_id) == False trader_pl, liquidation_pl = ithil.close_position(position_id) assert trader_pl == Percent(10).of(PRINCIPAL) - FEES assert liquidation_pl == 0.0 assert ithil.vaults[Currency("dai")] == DAI_LIQUIDITY assert ithil.insurance_pool[Currency("dai")] == DAI_INSURANCE_LIQUIDITY + INSURANCE_FEES assert ithil.governance_pool[Currency("dai")] == GOVERNANCE_FEES def test_trade_fees_zero_interest_with_total_loss_with_insurance_liquidity(): """ Trader invests in DAI/WETH with a loss of 120%. Collateral of 100.0, leverage of x10. Fees are split 50/50 between governance and insurance pool. Position is closed with a total loss, repaid by insurance. """ DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 COLLATERAL = 100.0 PRINCIPAL = 1000.0 quotes = { Currency("dai"): make_test_quotes_from_prices([1.0, 1.0]), Currency("ethereum"): make_test_quotes_from_prices([4400, 4400 - Percent(12).of(4400)]) } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=lambda position: position.collateral / 100.0, calculate_interest_rate=NO_INTEREST, calculate_liquidation_fee=lambda _: 0.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (fees / 2.0, fees / 2.0), vaults={ Currency("dai"): DAI_LIQUIDITY, }, ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10.0, ) assert position_id is not None assert position_id in ithil.positions, metrics_logger.metrics clock.step() assert ithil.can_liquidate_position(position_id) == True trader_pl, liquidation_pl = ithil.close_position(position_id) assert trader_pl == -COLLATERAL assert liquidation_pl == 0.0 assert ithil.vaults[Currency("dai")] == DAI_LIQUIDITY assert ithil.insurance_pool[Currency("dai")] == DAI_INSURANCE_LIQUIDITY - Percent(20).of(COLLATERAL) assert ithil.governance_pool[Currency("dai")] == 0.0 # We can't collect fees in case of total loss def test_trade_zero_fees_interest_rate_with_profit(): """ Trader invests in DAI/WETH with a profit of 10%. Collateral of 100.0, leverage of x10. No fees and fixed annual interest rate of 3%. Position is closed with a profit. """ DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 COLLATERAL = 100.0 PRINCIPAL = 1000.0 quotes = { Currency("dai"): make_test_quotes_from_prices([1.0, 1.0]), Currency("ethereum"): make_test_quotes_from_prices([4000, 4000 + Percent(10).of(4000)]), } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=NO_FEES, calculate_interest_rate=lambda _src_token, _dst_token, _collateral, _principal: 0.03, calculate_liquidation_fee=lambda _: 0.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (0.0, fees), vaults={ Currency("dai"): DAI_LIQUIDITY, } ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10, ) assert position_id is not None assert position_id in ithil.positions, metrics_logger.metrics position = ithil.active_positions[position_id] clock.step() INTEREST = ithil.calculate_interest(position) assert ithil.can_liquidate_position(position_id) == False trader_pl, liquidation_pl = ithil.close_position(position_id) assert trader_pl == Percent(10).of(PRINCIPAL) - INTEREST assert liquidation_pl == 0.0 assert ithil.vaults[Currency("dai")] == DAI_LIQUIDITY + INTEREST assert ithil.insurance_pool[Currency("dai")] == DAI_INSURANCE_LIQUIDITY assert ithil.governance_pool[Currency("dai")] == 0.0 # No fees were distributed def test_trade_zero_fees_zero_interest_with_loss_and_liquidation(): """ Trader invests in DAI/WETH with a loss of 80% of collateral. Collateral of 100.0, leverage of x10. No fees and no interest. Position in closed with a loss not fully covered by the collateral. LPs are compensated by the insurance pool. Liquidator in compensated by insurance pool. """ DAI_INSURANCE_LIQUIDITY = 1000.0 DAI_LIQUIDITY = 750000.0 COLLATERAL = 100.0 PRINCIPAL = 1000.0 quotes = { Currency("dai"): make_test_quotes_from_prices([1.0, 1.0]), Currency("ethereum"): make_test_quotes_from_prices([4400, 4400 - Percent(8).of(4400)]), } periods = len(list(quotes.values())[0]) clock = Clock(periods) metrics_logger = MetricsLogger(clock) ithil = Ithil( apply_slippage=NO_SLIPPAGE, calculate_fees=NO_FEES, calculate_interest_rate=NO_INTEREST, calculate_liquidation_fee=lambda _: 1.0, clock=clock, insurance_pool={ Currency("dai"): DAI_INSURANCE_LIQUIDITY, }, metrics_logger=metrics_logger, price_oracle=PriceOracle( clock=clock, quotes=quotes, ), split_fees=lambda fees: (0.0, fees), vaults={ Currency("dai"): DAI_LIQUIDITY, }, ) position_id = ithil.open_position( trader=Account("0xabcd"), src_token=Currency("dai"), dst_token=Currency("ethereum"), collateral_token=Currency("dai"), collateral=COLLATERAL, principal=PRINCIPAL, max_slippage_percent=10, ) assert position_id is not None assert position_id in ithil.active_positions clock.step() position = ithil.active_positions[position_id] LIQUIDATION_FEE = ithil.calculate_liquidation_fee(position) assert ithil.can_liquidate_position(position_id) == True trader_pl, liquidation_pl = ithil.liquidate_position(position_id) assert trader_pl == -(Percent(80).of(COLLATERAL) + LIQUIDATION_FEE) assert liquidation_pl == LIQUIDATION_FEE == 1.0
30.807843
104
0.656632
1,894
15,712
5.202746
0.069694
0.055815
0.036939
0.0274
0.897098
0.887558
0.875786
0.864421
0.841283
0.822001
0
0.037626
0.24389
15,712
509
105
30.868369
0.791835
0.095214
0
0.764858
0
0
0.021914
0
0
0
0.002998
0
0.129199
1
0.020672
false
0
0.023256
0.002584
0.046512
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
02e05748a84e5eeeddc0e93ab773d22f9e618665
25,608
py
Python
sdk/python/pulumi_checkly/dashboard.py
checkly/pulumi-checkly
e65680ff86516e95e2bcf3ce600ea5e641e28fe2
[ "MIT" ]
7
2022-02-16T15:04:48.000Z
2022-03-30T16:40:17.000Z
sdk/python/pulumi_checkly/dashboard.py
checkly/pulumi-checkly
e65680ff86516e95e2bcf3ce600ea5e641e28fe2
[ "MIT" ]
5
2022-03-11T17:01:17.000Z
2022-03-16T02:33:14.000Z
sdk/python/pulumi_checkly/dashboard.py
checkly/pulumi-checkly
e65680ff86516e95e2bcf3ce600ea5e641e28fe2
[ "MIT" ]
1
2022-03-11T16:55:01.000Z
2022-03-11T16:55:01.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities __all__ = ['DashboardArgs', 'Dashboard'] @pulumi.input_type class DashboardArgs: def __init__(__self__, *, custom_url: pulumi.Input[str], custom_domain: Optional[pulumi.Input[str]] = None, header: Optional[pulumi.Input[str]] = None, hide_tags: Optional[pulumi.Input[bool]] = None, logo: Optional[pulumi.Input[str]] = None, paginate: Optional[pulumi.Input[bool]] = None, pagination_rate: Optional[pulumi.Input[int]] = None, refresh_rate: Optional[pulumi.Input[int]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, width: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a Dashboard resource. :param pulumi.Input[str] custom_url: A subdomain name under 'checklyhq.com'. Needs to be unique across all users. :param pulumi.Input[str] custom_domain: A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. :param pulumi.Input[str] header: A piece of text displayed at the top of your dashboard. :param pulumi.Input[bool] hide_tags: Show or hide the tags on the dashboard. :param pulumi.Input[str] logo: A URL pointing to an image file. :param pulumi.Input[bool] paginate: Determines if pagination is on or off. :param pulumi.Input[int] pagination_rate: How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. :param pulumi.Input[int] refresh_rate: How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of one or more tags that filter which checks to display on the dashboard. :param pulumi.Input[str] width: Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ pulumi.set(__self__, "custom_url", custom_url) if custom_domain is not None: pulumi.set(__self__, "custom_domain", custom_domain) if header is not None: pulumi.set(__self__, "header", header) if hide_tags is not None: pulumi.set(__self__, "hide_tags", hide_tags) if logo is not None: pulumi.set(__self__, "logo", logo) if paginate is not None: pulumi.set(__self__, "paginate", paginate) if pagination_rate is not None: pulumi.set(__self__, "pagination_rate", pagination_rate) if refresh_rate is not None: pulumi.set(__self__, "refresh_rate", refresh_rate) if tags is not None: pulumi.set(__self__, "tags", tags) if width is not None: pulumi.set(__self__, "width", width) @property @pulumi.getter(name="customUrl") def custom_url(self) -> pulumi.Input[str]: """ A subdomain name under 'checklyhq.com'. Needs to be unique across all users. """ return pulumi.get(self, "custom_url") @custom_url.setter def custom_url(self, value: pulumi.Input[str]): pulumi.set(self, "custom_url", value) @property @pulumi.getter(name="customDomain") def custom_domain(self) -> Optional[pulumi.Input[str]]: """ A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. """ return pulumi.get(self, "custom_domain") @custom_domain.setter def custom_domain(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "custom_domain", value) @property @pulumi.getter def header(self) -> Optional[pulumi.Input[str]]: """ A piece of text displayed at the top of your dashboard. """ return pulumi.get(self, "header") @header.setter def header(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "header", value) @property @pulumi.getter(name="hideTags") def hide_tags(self) -> Optional[pulumi.Input[bool]]: """ Show or hide the tags on the dashboard. """ return pulumi.get(self, "hide_tags") @hide_tags.setter def hide_tags(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "hide_tags", value) @property @pulumi.getter def logo(self) -> Optional[pulumi.Input[str]]: """ A URL pointing to an image file. """ return pulumi.get(self, "logo") @logo.setter def logo(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "logo", value) @property @pulumi.getter def paginate(self) -> Optional[pulumi.Input[bool]]: """ Determines if pagination is on or off. """ return pulumi.get(self, "paginate") @paginate.setter def paginate(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "paginate", value) @property @pulumi.getter(name="paginationRate") def pagination_rate(self) -> Optional[pulumi.Input[int]]: """ How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. """ return pulumi.get(self, "pagination_rate") @pagination_rate.setter def pagination_rate(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "pagination_rate", value) @property @pulumi.getter(name="refreshRate") def refresh_rate(self) -> Optional[pulumi.Input[int]]: """ How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. """ return pulumi.get(self, "refresh_rate") @refresh_rate.setter def refresh_rate(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "refresh_rate", value) @property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ A list of one or more tags that filter which checks to display on the dashboard. """ return pulumi.get(self, "tags") @tags.setter def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "tags", value) @property @pulumi.getter def width(self) -> Optional[pulumi.Input[str]]: """ Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ return pulumi.get(self, "width") @width.setter def width(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "width", value) @pulumi.input_type class _DashboardState: def __init__(__self__, *, custom_domain: Optional[pulumi.Input[str]] = None, custom_url: Optional[pulumi.Input[str]] = None, header: Optional[pulumi.Input[str]] = None, hide_tags: Optional[pulumi.Input[bool]] = None, logo: Optional[pulumi.Input[str]] = None, paginate: Optional[pulumi.Input[bool]] = None, pagination_rate: Optional[pulumi.Input[int]] = None, refresh_rate: Optional[pulumi.Input[int]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, width: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering Dashboard resources. :param pulumi.Input[str] custom_domain: A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. :param pulumi.Input[str] custom_url: A subdomain name under 'checklyhq.com'. Needs to be unique across all users. :param pulumi.Input[str] header: A piece of text displayed at the top of your dashboard. :param pulumi.Input[bool] hide_tags: Show or hide the tags on the dashboard. :param pulumi.Input[str] logo: A URL pointing to an image file. :param pulumi.Input[bool] paginate: Determines if pagination is on or off. :param pulumi.Input[int] pagination_rate: How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. :param pulumi.Input[int] refresh_rate: How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of one or more tags that filter which checks to display on the dashboard. :param pulumi.Input[str] width: Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ if custom_domain is not None: pulumi.set(__self__, "custom_domain", custom_domain) if custom_url is not None: pulumi.set(__self__, "custom_url", custom_url) if header is not None: pulumi.set(__self__, "header", header) if hide_tags is not None: pulumi.set(__self__, "hide_tags", hide_tags) if logo is not None: pulumi.set(__self__, "logo", logo) if paginate is not None: pulumi.set(__self__, "paginate", paginate) if pagination_rate is not None: pulumi.set(__self__, "pagination_rate", pagination_rate) if refresh_rate is not None: pulumi.set(__self__, "refresh_rate", refresh_rate) if tags is not None: pulumi.set(__self__, "tags", tags) if width is not None: pulumi.set(__self__, "width", width) @property @pulumi.getter(name="customDomain") def custom_domain(self) -> Optional[pulumi.Input[str]]: """ A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. """ return pulumi.get(self, "custom_domain") @custom_domain.setter def custom_domain(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "custom_domain", value) @property @pulumi.getter(name="customUrl") def custom_url(self) -> Optional[pulumi.Input[str]]: """ A subdomain name under 'checklyhq.com'. Needs to be unique across all users. """ return pulumi.get(self, "custom_url") @custom_url.setter def custom_url(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "custom_url", value) @property @pulumi.getter def header(self) -> Optional[pulumi.Input[str]]: """ A piece of text displayed at the top of your dashboard. """ return pulumi.get(self, "header") @header.setter def header(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "header", value) @property @pulumi.getter(name="hideTags") def hide_tags(self) -> Optional[pulumi.Input[bool]]: """ Show or hide the tags on the dashboard. """ return pulumi.get(self, "hide_tags") @hide_tags.setter def hide_tags(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "hide_tags", value) @property @pulumi.getter def logo(self) -> Optional[pulumi.Input[str]]: """ A URL pointing to an image file. """ return pulumi.get(self, "logo") @logo.setter def logo(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "logo", value) @property @pulumi.getter def paginate(self) -> Optional[pulumi.Input[bool]]: """ Determines if pagination is on or off. """ return pulumi.get(self, "paginate") @paginate.setter def paginate(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "paginate", value) @property @pulumi.getter(name="paginationRate") def pagination_rate(self) -> Optional[pulumi.Input[int]]: """ How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. """ return pulumi.get(self, "pagination_rate") @pagination_rate.setter def pagination_rate(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "pagination_rate", value) @property @pulumi.getter(name="refreshRate") def refresh_rate(self) -> Optional[pulumi.Input[int]]: """ How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. """ return pulumi.get(self, "refresh_rate") @refresh_rate.setter def refresh_rate(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "refresh_rate", value) @property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ A list of one or more tags that filter which checks to display on the dashboard. """ return pulumi.get(self, "tags") @tags.setter def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "tags", value) @property @pulumi.getter def width(self) -> Optional[pulumi.Input[str]]: """ Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ return pulumi.get(self, "width") @width.setter def width(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "width", value) class Dashboard(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, custom_domain: Optional[pulumi.Input[str]] = None, custom_url: Optional[pulumi.Input[str]] = None, header: Optional[pulumi.Input[str]] = None, hide_tags: Optional[pulumi.Input[bool]] = None, logo: Optional[pulumi.Input[str]] = None, paginate: Optional[pulumi.Input[bool]] = None, pagination_rate: Optional[pulumi.Input[int]] = None, refresh_rate: Optional[pulumi.Input[int]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, width: Optional[pulumi.Input[str]] = None, __props__=None): """ ## Example Usage ```python import pulumi import pulumi_checkly as checkly dashboard_1 = checkly.Dashboard("dashboard-1", custom_domain="status.example.com", custom_url="checkly", header="Public dashboard", hide_tags=False, logo="https://www.checklyhq.com/logo.png", paginate=False, pagination_rate=30, refresh_rate=60, tags=["production"], width="FULL") ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] custom_domain: A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. :param pulumi.Input[str] custom_url: A subdomain name under 'checklyhq.com'. Needs to be unique across all users. :param pulumi.Input[str] header: A piece of text displayed at the top of your dashboard. :param pulumi.Input[bool] hide_tags: Show or hide the tags on the dashboard. :param pulumi.Input[str] logo: A URL pointing to an image file. :param pulumi.Input[bool] paginate: Determines if pagination is on or off. :param pulumi.Input[int] pagination_rate: How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. :param pulumi.Input[int] refresh_rate: How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of one or more tags that filter which checks to display on the dashboard. :param pulumi.Input[str] width: Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ ... @overload def __init__(__self__, resource_name: str, args: DashboardArgs, opts: Optional[pulumi.ResourceOptions] = None): """ ## Example Usage ```python import pulumi import pulumi_checkly as checkly dashboard_1 = checkly.Dashboard("dashboard-1", custom_domain="status.example.com", custom_url="checkly", header="Public dashboard", hide_tags=False, logo="https://www.checklyhq.com/logo.png", paginate=False, pagination_rate=30, refresh_rate=60, tags=["production"], width="FULL") ``` :param str resource_name: The name of the resource. :param DashboardArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(DashboardArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, custom_domain: Optional[pulumi.Input[str]] = None, custom_url: Optional[pulumi.Input[str]] = None, header: Optional[pulumi.Input[str]] = None, hide_tags: Optional[pulumi.Input[bool]] = None, logo: Optional[pulumi.Input[str]] = None, paginate: Optional[pulumi.Input[bool]] = None, pagination_rate: Optional[pulumi.Input[int]] = None, refresh_rate: Optional[pulumi.Input[int]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, width: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.plugin_download_url is None: opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = DashboardArgs.__new__(DashboardArgs) __props__.__dict__["custom_domain"] = custom_domain if custom_url is None and not opts.urn: raise TypeError("Missing required property 'custom_url'") __props__.__dict__["custom_url"] = custom_url __props__.__dict__["header"] = header __props__.__dict__["hide_tags"] = hide_tags __props__.__dict__["logo"] = logo __props__.__dict__["paginate"] = paginate __props__.__dict__["pagination_rate"] = pagination_rate __props__.__dict__["refresh_rate"] = refresh_rate __props__.__dict__["tags"] = tags __props__.__dict__["width"] = width super(Dashboard, __self__).__init__( 'checkly:index/dashboard:Dashboard', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, custom_domain: Optional[pulumi.Input[str]] = None, custom_url: Optional[pulumi.Input[str]] = None, header: Optional[pulumi.Input[str]] = None, hide_tags: Optional[pulumi.Input[bool]] = None, logo: Optional[pulumi.Input[str]] = None, paginate: Optional[pulumi.Input[bool]] = None, pagination_rate: Optional[pulumi.Input[int]] = None, refresh_rate: Optional[pulumi.Input[int]] = None, tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, width: Optional[pulumi.Input[str]] = None) -> 'Dashboard': """ Get an existing Dashboard resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] custom_domain: A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. :param pulumi.Input[str] custom_url: A subdomain name under 'checklyhq.com'. Needs to be unique across all users. :param pulumi.Input[str] header: A piece of text displayed at the top of your dashboard. :param pulumi.Input[bool] hide_tags: Show or hide the tags on the dashboard. :param pulumi.Input[str] logo: A URL pointing to an image file. :param pulumi.Input[bool] paginate: Determines if pagination is on or off. :param pulumi.Input[int] pagination_rate: How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. :param pulumi.Input[int] refresh_rate: How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of one or more tags that filter which checks to display on the dashboard. :param pulumi.Input[str] width: Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _DashboardState.__new__(_DashboardState) __props__.__dict__["custom_domain"] = custom_domain __props__.__dict__["custom_url"] = custom_url __props__.__dict__["header"] = header __props__.__dict__["hide_tags"] = hide_tags __props__.__dict__["logo"] = logo __props__.__dict__["paginate"] = paginate __props__.__dict__["pagination_rate"] = pagination_rate __props__.__dict__["refresh_rate"] = refresh_rate __props__.__dict__["tags"] = tags __props__.__dict__["width"] = width return Dashboard(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="customDomain") def custom_domain(self) -> pulumi.Output[Optional[str]]: """ A custom user domain, e.g. 'status.example.com'. See the docs on updating your DNS and SSL usage. """ return pulumi.get(self, "custom_domain") @property @pulumi.getter(name="customUrl") def custom_url(self) -> pulumi.Output[str]: """ A subdomain name under 'checklyhq.com'. Needs to be unique across all users. """ return pulumi.get(self, "custom_url") @property @pulumi.getter def header(self) -> pulumi.Output[Optional[str]]: """ A piece of text displayed at the top of your dashboard. """ return pulumi.get(self, "header") @property @pulumi.getter(name="hideTags") def hide_tags(self) -> pulumi.Output[Optional[bool]]: """ Show or hide the tags on the dashboard. """ return pulumi.get(self, "hide_tags") @property @pulumi.getter def logo(self) -> pulumi.Output[Optional[str]]: """ A URL pointing to an image file. """ return pulumi.get(self, "logo") @property @pulumi.getter def paginate(self) -> pulumi.Output[Optional[bool]]: """ Determines if pagination is on or off. """ return pulumi.get(self, "paginate") @property @pulumi.getter(name="paginationRate") def pagination_rate(self) -> pulumi.Output[Optional[int]]: """ How often to trigger pagination in seconds. Possible values `30`, `60` and `300`. """ return pulumi.get(self, "pagination_rate") @property @pulumi.getter(name="refreshRate") def refresh_rate(self) -> pulumi.Output[Optional[int]]: """ How often to refresh the dashboard in seconds. Possible values `30`, `60` and `600`. """ return pulumi.get(self, "refresh_rate") @property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Sequence[str]]]: """ A list of one or more tags that filter which checks to display on the dashboard. """ return pulumi.get(self, "tags") @property @pulumi.getter def width(self) -> pulumi.Output[Optional[str]]: """ Determines whether to use the full screen or focus in the center. Possible values `FULL` and `960PX`. """ return pulumi.get(self, "width")
42.118421
145
0.625391
3,143
25,608
4.916322
0.066497
0.104647
0.106976
0.059798
0.890823
0.875744
0.857624
0.851281
0.840862
0.822547
0
0.006989
0.262418
25,608
607
146
42.187809
0.811097
0.318026
0
0.828571
1
0
0.07458
0.00206
0
0
0
0
0
1
0.162857
false
0.002857
0.014286
0
0.274286
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
f3228ceb87283489a176ea4a3660c35180143c7d
7,860
py
Python
tests/test_tabulator.py
sixty-north/added-value
9ea1da2bd4e3ce4ce4333a7610aaff71b68a3fc7
[ "BSD-3-Clause" ]
null
null
null
tests/test_tabulator.py
sixty-north/added-value
9ea1da2bd4e3ce4ce4333a7610aaff71b68a3fc7
[ "BSD-3-Clause" ]
12
2018-06-06T20:08:30.000Z
2021-08-12T13:59:25.000Z
tests/test_tabulator.py
sixty-north/added-value
9ea1da2bd4e3ce4ce4333a7610aaff71b68a3fc7
[ "BSD-3-Clause" ]
null
null
null
from pytest import raises from added_value.multisort import asc, dec from added_value.tabulator import tabulate, validate_level_indexes a = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], ] b = [ [[5, 6], [1, 9], [3, 5]], [[7, 2], [4], [5, 6]], [[7, 8], [9, 3],], [[1, 9], [2, 9], [3, 6]], ] c = { 'alpha': 5, 'bravo': 5, 'charlie': 6, 'delta': 5, 'foxtrot': 6, 'golf': 4, } d = { 'alpha': "Fox base alpha".split(), 'bravo': "Rio bravo".split(), 'charlie': "Charlie says".split(), 'delta': "Concorde has a delta wing".split(), 'foxtrot': "The foxtrot was a popular dance".split(), 'golf': "Golf spoils a walk in the countryside".split(), } e = [ {'set': 3, 'pour': 4, 'serve': 5 }, {'serve': 19, 'set': 12, 'volley': 9 }, {'set': 98, 'pour': 1, 'cast': 14 }, {'cast': 34, 'line': 18, 'fish':8 } ] def test_tabulate_list_of_dicts_with_keys_zero_and_one_on_the_vertical_axis_has_three_columns(): table = tabulate(e, [0, 1], []) assert len(table[0]) == 3 def test_tabulate_list_of_dicts_with_keys_zero_and_one_on_the_vertical_axis_has_twelve_rows(): table = tabulate(e, [0, 1], []) assert len(table) == 12 def test_tabulate_list_of_dicts_with_keys_zero_and_one_on_the_vertical_axis_has_expected_column_0(): table = tabulate(e, [0, 1], []) assert all(row[0] in range(4) for row in table) def test_tabulate_list_of_dicts_with_keys_zero_and_one_on_the_vertical_axis_has_expected_column_1(): table = tabulate(e, [0, 1], []) assert all(row[1] in {'set', 'pour', 'serve', 'volley', 'cast', 'line', 'fish'} for row in table) # TODO: Test hiding indexes def test_tabulate_list_of_dicts_sorted_ascending_by_columns_1_and_ascending_by_column_2(): actual = tabulate(e, [0, 1], [], v_level_sort_keys=(asc(), asc())) expected = [ [0, 'pour', 4], [0, 'serve', 5], [0, 'set', 3], [1, 'serve', 19], [1, 'set', 12], [1, 'volley', 9], [2, 'cast', 14], [2, 'pour', 1], [2, 'set', 98], [3, 'cast', 34], [3, 'fish', 8], [3, 'line', 18] ] assert actual == expected def test_tabulate_list_of_dicts_sorted_descending_by_columns_1_and_ascending_by_column_2(): actual = tabulate(e, [0, 1], [], v_level_sort_keys=(dec(), asc())) expected = [ [3, 'cast', 34], [3, 'fish', 8], [3, 'line', 18], [2, 'cast', 14], [2, 'pour', 1], [2, 'set', 98], [1, 'serve', 19], [1, 'set', 12], [1, 'volley', 9], [0, 'pour', 4], [0, 'serve', 5], [0, 'set', 3] ] assert actual == expected def test_tabulate_list_of_dicts_sorted_ascending_by_columns_1_and_descending_by_column_2(): actual = tabulate(e, [0, 1], [], v_level_sort_keys=(asc(), dec())) expected = [ [0, 'set', 3], [0, 'serve', 5], [0, 'pour', 4], [1, 'volley', 9], [1, 'set', 12], [1, 'serve', 19], [2, 'set', 98], [2, 'pour', 1], [2, 'cast', 14], [3, 'line', 18], [3, 'fish', 8], [3, 'cast', 34] ] assert actual == expected def test_tabulate_list_of_dicts_sorted_descending_by_columns_1_and_descending_by_column_2(): actual = tabulate(e, [0, 1], [], v_level_sort_keys=(dec(), dec())) expected = [ [3, 'line', 18], [3, 'fish', 8], [3, 'cast', 34], [2, 'set', 98], [2, 'pour', 1], [2, 'cast', 14], [1, 'volley', 9], [1, 'set', 12], [1, 'serve', 19], [0, 'set', 3], [0, 'serve', 5], [0, 'pour', 4] ] assert actual == expected # TODO: str/repr/format of cells. # TODO: Formatting of heterogeneous tuples e.g. ("Norway", 345, 12.45) Maybe a sort of x-path syntax? def test_validate_level_indexes_with_num_levels_less_than_zero_raises_value_error(): with raises(ValueError): validate_level_indexes(-1, None, None) def test_validate_level_indexes_with_with_num_levels_equal_to_one(): v_level_indexes, h_level_indexes = validate_level_indexes(1, None, None) assert list(v_level_indexes) == [0] assert list(h_level_indexes) == [] def test_validate_level_indexes_with_with_num_levels_equal_to_two(): v_level_indexes, h_level_indexes = validate_level_indexes(2, None, None) assert list(v_level_indexes) == [0] assert list(h_level_indexes) == [1] def test_validate_level_indexes_with_with_num_levels_equal_to_three(): v_level_indexes, h_level_indexes = validate_level_indexes(3, None, None) assert list(v_level_indexes) == [0, 2] assert list(h_level_indexes) == [1] def test_validate_level_indexes_with_with_num_levels_equal_to_four(): v_level_indexes, h_level_indexes = validate_level_indexes(4, None, None) assert list(v_level_indexes) == [0, 2] assert list(h_level_indexes) == [1, 3] def test_validate_level_indexes_with_with_num_levels_equal_to_five(): v_level_indexes, h_level_indexes = validate_level_indexes(5, None, None) assert list(v_level_indexes) == [0, 2, 4] assert list(h_level_indexes) == [1, 3] def test_validate_level_indexes_with_only_v_level_indexes_provided(): v_level_indexes, h_level_indexes = validate_level_indexes(5, [0, 1, 2, 3, 4], None) assert list(v_level_indexes) == [0, 1, 2, 3, 4] assert list(h_level_indexes) == [] def test_validate_level_indexes_with_only_h_level_indexes_provided(): v_level_indexes, h_level_indexes = validate_level_indexes(5, None, [0, 1, 2, 3, 4]) assert list(v_level_indexes) == [] assert list(h_level_indexes) == [0, 1, 2, 3, 4] def test_validate_level_indexes_with_mixed_indexes_provided(): v_level_indexes, h_level_indexes = validate_level_indexes(5, [0, 1, 2], [3, 4]) assert list(v_level_indexes) == [0, 1, 2] assert list(h_level_indexes) == [3, 4] def test_validate_level_indexes_with_alternate_indexes_provided(): v_level_indexes, h_level_indexes = validate_level_indexes(5, [0, 2, 4], [1, 3]) assert list(v_level_indexes) == [0, 2, 4] assert list(h_level_indexes) == [1, 3] def test_validate_level_indexes_with_reordered_indexes_provided(): v_level_indexes, h_level_indexes = validate_level_indexes(5, [4, 1, 3], [0, 2]) assert list(v_level_indexes) == [4, 1, 3] assert list(h_level_indexes) == [0, 2] def test_validate_level_indexes_missing_v_level_index(): with raises(ValueError): validate_level_indexes(5, [4, 3], [0, 2]) def test_validate_level_indexes_missing_h_level_index(): with raises(ValueError): validate_level_indexes(5, [4, 1, 3], [0]) def test_validate_level_indexes_duplicate_v_level_index(): with raises(ValueError): validate_level_indexes(5, [4, 1, 1, 3], [0, 2]) def test_validate_level_indexes_duplicate_h_level_index(): with raises(ValueError): validate_level_indexes(5, [4, 1,3], [0, 0, 2]) def test_validate_level_indexes_duplicate_v_and_h_level_indexes_are_not_disjoint(): with raises(ValueError): validate_level_indexes(5, [4, 1, 3], [0, 1, 2]) def test_validate_level_indexes_duplicate_v_level_index_is_out_of_lower_range(): with raises(ValueError): validate_level_indexes(5, [4, 1, -1], [0, 2]) def test_validate_level_indexes_duplicate_v_level_index_is_out_of_upper_range(): with raises(ValueError): validate_level_indexes(5, [4, 1, 5], [0, 2]) def test_validate_level_indexes_duplicate_h_level_index_is_out_of_lower_range(): with raises(ValueError): validate_level_indexes(5, [4, 1, 3], [-1, 2]) def test_validate_level_indexes_duplicate_h_level_index_is_out_of_upper_range(): with raises(ValueError): validate_level_indexes(5, [4, 1, 3], [0, 5])
31.95122
102
0.634987
1,181
7,860
3.847587
0.121931
0.221831
0.180458
0.088028
0.820202
0.81382
0.78081
0.774428
0.710387
0.582746
0
0.056595
0.210941
7,860
245
103
32.081633
0.676072
0.020102
0
0.396985
0
0
0.060925
0
0
0
0
0.004082
0.140704
1
0.140704
false
0
0.015075
0
0.155779
0
0
0
0
null
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
b86e530fb14f767d9ec805d34bdfa3337252929c
33,020
py
Python
sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py
roderik/pulumi-azure
f6d0c058d6f9111a709bc5f1515d1638f9d615f0
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py
roderik/pulumi-azure
f6d0c058d6f9111a709bc5f1515d1638f9d615f0
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py
roderik/pulumi-azure
f6d0c058d6f9111a709bc5f1515d1638f9d615f0
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities __all__ = ['IntegrationRuntimeRuleArgs', 'IntegrationRuntimeRule'] @pulumi.input_type class IntegrationRuntimeRuleArgs: def __init__(__self__, *, data_factory_name: pulumi.Input[str], resource_group_name: pulumi.Input[str], cleanup_enabled: Optional[pulumi.Input[bool]] = None, compute_type: Optional[pulumi.Input[str]] = None, core_count: Optional[pulumi.Input[int]] = None, description: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, time_to_live_min: Optional[pulumi.Input[int]] = None, virtual_network_enabled: Optional[pulumi.Input[bool]] = None): """ The set of arguments for constructing a IntegrationRuntimeRule resource. :param pulumi.Input[str] data_factory_name: Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. :param pulumi.Input[str] resource_group_name: The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. :param pulumi.Input[bool] cleanup_enabled: Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. :param pulumi.Input[str] compute_type: Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. :param pulumi.Input[int] core_count: Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. :param pulumi.Input[str] description: Integration runtime description. :param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. :param pulumi.Input[str] name: Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. :param pulumi.Input[int] time_to_live_min: Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. :param pulumi.Input[bool] virtual_network_enabled: Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ pulumi.set(__self__, "data_factory_name", data_factory_name) pulumi.set(__self__, "resource_group_name", resource_group_name) if cleanup_enabled is not None: pulumi.set(__self__, "cleanup_enabled", cleanup_enabled) if compute_type is not None: pulumi.set(__self__, "compute_type", compute_type) if core_count is not None: pulumi.set(__self__, "core_count", core_count) if description is not None: pulumi.set(__self__, "description", description) if location is not None: pulumi.set(__self__, "location", location) if name is not None: pulumi.set(__self__, "name", name) if time_to_live_min is not None: pulumi.set(__self__, "time_to_live_min", time_to_live_min) if virtual_network_enabled is not None: pulumi.set(__self__, "virtual_network_enabled", virtual_network_enabled) @property @pulumi.getter(name="dataFactoryName") def data_factory_name(self) -> pulumi.Input[str]: """ Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. """ return pulumi.get(self, "data_factory_name") @data_factory_name.setter def data_factory_name(self, value: pulumi.Input[str]): pulumi.set(self, "data_factory_name", value) @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> pulumi.Input[str]: """ The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. """ return pulumi.get(self, "resource_group_name") @resource_group_name.setter def resource_group_name(self, value: pulumi.Input[str]): pulumi.set(self, "resource_group_name", value) @property @pulumi.getter(name="cleanupEnabled") def cleanup_enabled(self) -> Optional[pulumi.Input[bool]]: """ Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. """ return pulumi.get(self, "cleanup_enabled") @cleanup_enabled.setter def cleanup_enabled(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "cleanup_enabled", value) @property @pulumi.getter(name="computeType") def compute_type(self) -> Optional[pulumi.Input[str]]: """ Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. """ return pulumi.get(self, "compute_type") @compute_type.setter def compute_type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "compute_type", value) @property @pulumi.getter(name="coreCount") def core_count(self) -> Optional[pulumi.Input[int]]: """ Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. """ return pulumi.get(self, "core_count") @core_count.setter def core_count(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "core_count", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ Integration runtime description. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter def location(self) -> Optional[pulumi.Input[str]]: """ Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. """ return pulumi.get(self, "location") @location.setter def location(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "location", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter(name="timeToLiveMin") def time_to_live_min(self) -> Optional[pulumi.Input[int]]: """ Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. """ return pulumi.get(self, "time_to_live_min") @time_to_live_min.setter def time_to_live_min(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "time_to_live_min", value) @property @pulumi.getter(name="virtualNetworkEnabled") def virtual_network_enabled(self) -> Optional[pulumi.Input[bool]]: """ Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ return pulumi.get(self, "virtual_network_enabled") @virtual_network_enabled.setter def virtual_network_enabled(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "virtual_network_enabled", value) @pulumi.input_type class _IntegrationRuntimeRuleState: def __init__(__self__, *, cleanup_enabled: Optional[pulumi.Input[bool]] = None, compute_type: Optional[pulumi.Input[str]] = None, core_count: Optional[pulumi.Input[int]] = None, data_factory_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, time_to_live_min: Optional[pulumi.Input[int]] = None, virtual_network_enabled: Optional[pulumi.Input[bool]] = None): """ Input properties used for looking up and filtering IntegrationRuntimeRule resources. :param pulumi.Input[bool] cleanup_enabled: Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. :param pulumi.Input[str] compute_type: Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. :param pulumi.Input[int] core_count: Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. :param pulumi.Input[str] data_factory_name: Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. :param pulumi.Input[str] description: Integration runtime description. :param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. :param pulumi.Input[str] name: Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. :param pulumi.Input[str] resource_group_name: The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. :param pulumi.Input[int] time_to_live_min: Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. :param pulumi.Input[bool] virtual_network_enabled: Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ if cleanup_enabled is not None: pulumi.set(__self__, "cleanup_enabled", cleanup_enabled) if compute_type is not None: pulumi.set(__self__, "compute_type", compute_type) if core_count is not None: pulumi.set(__self__, "core_count", core_count) if data_factory_name is not None: pulumi.set(__self__, "data_factory_name", data_factory_name) if description is not None: pulumi.set(__self__, "description", description) if location is not None: pulumi.set(__self__, "location", location) if name is not None: pulumi.set(__self__, "name", name) if resource_group_name is not None: pulumi.set(__self__, "resource_group_name", resource_group_name) if time_to_live_min is not None: pulumi.set(__self__, "time_to_live_min", time_to_live_min) if virtual_network_enabled is not None: pulumi.set(__self__, "virtual_network_enabled", virtual_network_enabled) @property @pulumi.getter(name="cleanupEnabled") def cleanup_enabled(self) -> Optional[pulumi.Input[bool]]: """ Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. """ return pulumi.get(self, "cleanup_enabled") @cleanup_enabled.setter def cleanup_enabled(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "cleanup_enabled", value) @property @pulumi.getter(name="computeType") def compute_type(self) -> Optional[pulumi.Input[str]]: """ Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. """ return pulumi.get(self, "compute_type") @compute_type.setter def compute_type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "compute_type", value) @property @pulumi.getter(name="coreCount") def core_count(self) -> Optional[pulumi.Input[int]]: """ Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. """ return pulumi.get(self, "core_count") @core_count.setter def core_count(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "core_count", value) @property @pulumi.getter(name="dataFactoryName") def data_factory_name(self) -> Optional[pulumi.Input[str]]: """ Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. """ return pulumi.get(self, "data_factory_name") @data_factory_name.setter def data_factory_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "data_factory_name", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ Integration runtime description. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter def location(self) -> Optional[pulumi.Input[str]]: """ Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. """ return pulumi.get(self, "location") @location.setter def location(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "location", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> Optional[pulumi.Input[str]]: """ The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. """ return pulumi.get(self, "resource_group_name") @resource_group_name.setter def resource_group_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "resource_group_name", value) @property @pulumi.getter(name="timeToLiveMin") def time_to_live_min(self) -> Optional[pulumi.Input[int]]: """ Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. """ return pulumi.get(self, "time_to_live_min") @time_to_live_min.setter def time_to_live_min(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "time_to_live_min", value) @property @pulumi.getter(name="virtualNetworkEnabled") def virtual_network_enabled(self) -> Optional[pulumi.Input[bool]]: """ Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ return pulumi.get(self, "virtual_network_enabled") @virtual_network_enabled.setter def virtual_network_enabled(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "virtual_network_enabled", value) class IntegrationRuntimeRule(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cleanup_enabled: Optional[pulumi.Input[bool]] = None, compute_type: Optional[pulumi.Input[str]] = None, core_count: Optional[pulumi.Input[int]] = None, data_factory_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, time_to_live_min: Optional[pulumi.Input[int]] = None, virtual_network_enabled: Optional[pulumi.Input[bool]] = None, __props__=None): """ Manages a Data Factory Azure Integration Runtime. ## Example Usage ```python import pulumi import pulumi_azure as azure example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") example_factory = azure.datafactory.Factory("exampleFactory", location=example_resource_group.location, resource_group_name=example_resource_group.name) example_integration_runtime_rule = azure.datafactory.IntegrationRuntimeRule("exampleIntegrationRuntimeRule", data_factory_name=example_factory.name, resource_group_name=example_resource_group.name, location=example_resource_group.location) ``` ## Import Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. ```sh $ pulumi import azure:datafactory/integrationRuntimeRule:IntegrationRuntimeRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/integrationruntimes/example ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[bool] cleanup_enabled: Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. :param pulumi.Input[str] compute_type: Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. :param pulumi.Input[int] core_count: Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. :param pulumi.Input[str] data_factory_name: Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. :param pulumi.Input[str] description: Integration runtime description. :param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. :param pulumi.Input[str] name: Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. :param pulumi.Input[str] resource_group_name: The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. :param pulumi.Input[int] time_to_live_min: Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. :param pulumi.Input[bool] virtual_network_enabled: Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ ... @overload def __init__(__self__, resource_name: str, args: IntegrationRuntimeRuleArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Manages a Data Factory Azure Integration Runtime. ## Example Usage ```python import pulumi import pulumi_azure as azure example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") example_factory = azure.datafactory.Factory("exampleFactory", location=example_resource_group.location, resource_group_name=example_resource_group.name) example_integration_runtime_rule = azure.datafactory.IntegrationRuntimeRule("exampleIntegrationRuntimeRule", data_factory_name=example_factory.name, resource_group_name=example_resource_group.name, location=example_resource_group.location) ``` ## Import Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. ```sh $ pulumi import azure:datafactory/integrationRuntimeRule:IntegrationRuntimeRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/integrationruntimes/example ``` :param str resource_name: The name of the resource. :param IntegrationRuntimeRuleArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(IntegrationRuntimeRuleArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cleanup_enabled: Optional[pulumi.Input[bool]] = None, compute_type: Optional[pulumi.Input[str]] = None, core_count: Optional[pulumi.Input[int]] = None, data_factory_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, time_to_live_min: Optional[pulumi.Input[int]] = None, virtual_network_enabled: Optional[pulumi.Input[bool]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = IntegrationRuntimeRuleArgs.__new__(IntegrationRuntimeRuleArgs) __props__.__dict__["cleanup_enabled"] = cleanup_enabled __props__.__dict__["compute_type"] = compute_type __props__.__dict__["core_count"] = core_count if data_factory_name is None and not opts.urn: raise TypeError("Missing required property 'data_factory_name'") __props__.__dict__["data_factory_name"] = data_factory_name __props__.__dict__["description"] = description __props__.__dict__["location"] = location __props__.__dict__["name"] = name if resource_group_name is None and not opts.urn: raise TypeError("Missing required property 'resource_group_name'") __props__.__dict__["resource_group_name"] = resource_group_name __props__.__dict__["time_to_live_min"] = time_to_live_min __props__.__dict__["virtual_network_enabled"] = virtual_network_enabled super(IntegrationRuntimeRule, __self__).__init__( 'azure:datafactory/integrationRuntimeRule:IntegrationRuntimeRule', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, cleanup_enabled: Optional[pulumi.Input[bool]] = None, compute_type: Optional[pulumi.Input[str]] = None, core_count: Optional[pulumi.Input[int]] = None, data_factory_name: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, resource_group_name: Optional[pulumi.Input[str]] = None, time_to_live_min: Optional[pulumi.Input[int]] = None, virtual_network_enabled: Optional[pulumi.Input[bool]] = None) -> 'IntegrationRuntimeRule': """ Get an existing IntegrationRuntimeRule resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[bool] cleanup_enabled: Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. :param pulumi.Input[str] compute_type: Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. :param pulumi.Input[int] core_count: Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. :param pulumi.Input[str] data_factory_name: Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. :param pulumi.Input[str] description: Integration runtime description. :param pulumi.Input[str] location: Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. :param pulumi.Input[str] name: Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. :param pulumi.Input[str] resource_group_name: The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. :param pulumi.Input[int] time_to_live_min: Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. :param pulumi.Input[bool] virtual_network_enabled: Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _IntegrationRuntimeRuleState.__new__(_IntegrationRuntimeRuleState) __props__.__dict__["cleanup_enabled"] = cleanup_enabled __props__.__dict__["compute_type"] = compute_type __props__.__dict__["core_count"] = core_count __props__.__dict__["data_factory_name"] = data_factory_name __props__.__dict__["description"] = description __props__.__dict__["location"] = location __props__.__dict__["name"] = name __props__.__dict__["resource_group_name"] = resource_group_name __props__.__dict__["time_to_live_min"] = time_to_live_min __props__.__dict__["virtual_network_enabled"] = virtual_network_enabled return IntegrationRuntimeRule(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="cleanupEnabled") def cleanup_enabled(self) -> pulumi.Output[bool]: """ Cluster will not be recycled and it will be used in next data flow activity run until TTL (time to live) is reached if this is set as `false`. Default is `true`. """ return pulumi.get(self, "cleanup_enabled") @property @pulumi.getter(name="computeType") def compute_type(self) -> pulumi.Output[Optional[str]]: """ Compute type of the cluster which will execute data flow job. Valid values are `General`, `ComputeOptimized` and `MemoryOptimized`. Defaults to `General`. """ return pulumi.get(self, "compute_type") @property @pulumi.getter(name="coreCount") def core_count(self) -> pulumi.Output[Optional[int]]: """ Core count of the cluster which will execute data flow job. Valid values are `8`, `16`, `32`, `48`, `80`, `144` and `272`. Defaults to `8`. """ return pulumi.get(self, "core_count") @property @pulumi.getter(name="dataFactoryName") def data_factory_name(self) -> pulumi.Output[str]: """ Specifies the name of the Data Factory the Managed Integration Runtime belongs to. Changing this forces a new resource to be created. """ return pulumi.get(self, "data_factory_name") @property @pulumi.getter def description(self) -> pulumi.Output[Optional[str]]: """ Integration runtime description. """ return pulumi.get(self, "description") @property @pulumi.getter def location(self) -> pulumi.Output[str]: """ Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. """ return pulumi.get(self, "location") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ Specifies the name of the Managed Integration Runtime. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. """ return pulumi.get(self, "name") @property @pulumi.getter(name="resourceGroupName") def resource_group_name(self) -> pulumi.Output[str]: """ The name of the resource group in which to create the Managed Integration Runtime. Changing this forces a new resource to be created. """ return pulumi.get(self, "resource_group_name") @property @pulumi.getter(name="timeToLiveMin") def time_to_live_min(self) -> pulumi.Output[Optional[int]]: """ Time to live (in minutes) setting of the cluster which will execute data flow job. Defaults to `0`. """ return pulumi.get(self, "time_to_live_min") @property @pulumi.getter(name="virtualNetworkEnabled") def virtual_network_enabled(self) -> pulumi.Output[Optional[bool]]: """ Is Integration Runtime compute provisioned within Managed Virtual Network? Changing this forces a new resource to be created. """ return pulumi.get(self, "virtual_network_enabled")
53.172303
291
0.681254
4,098
33,020
5.292826
0.056613
0.067958
0.073582
0.048686
0.914846
0.902812
0.896035
0.89018
0.887828
0.872199
0
0.007183
0.224258
33,020
620
292
53.258065
0.839586
0.427044
0
0.810888
1
0
0.108835
0.024326
0
0
0
0
0
1
0.163324
false
0.002865
0.014327
0
0.275072
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
b878000b24edbd911327fc6aec5ca502c34f37c8
64,214
py
Python
kapua-client/python-client/swagger_client/api/roles_api.py
liang-faan/SmartIOT-Diec
8336a4b558295295f10a82cf350d8b7ff3fb9f5c
[ "MIT" ]
5
2019-05-30T02:55:16.000Z
2020-03-03T14:18:23.000Z
kapua-client/python-client/swagger_client/api/roles_api.py
liang-faan/SmartIOT-Diec
8336a4b558295295f10a82cf350d8b7ff3fb9f5c
[ "MIT" ]
3
2019-12-27T00:53:23.000Z
2020-02-17T05:29:19.000Z
kapua-client/python-client/swagger_client/api/roles_api.py
liang-faan/SmartIOT-Diec
8336a4b558295295f10a82cf350d8b7ff3fb9f5c
[ "MIT" ]
4
2019-06-04T06:26:14.000Z
2021-01-07T04:25:32.000Z
# coding: utf-8 """ Eclipse Kapua REST API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from swagger_client.api_client import ApiClient class RolesApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client def role_count(self, scope_id, body, **kwargs): # noqa: E501 """Counts the Roles # noqa: E501 Counts the Roles with the given RoleQuery parameter returning the number of matching Roles # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_count(scope_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to count results (required) :param RoleQuery body: The RoleQuery to use to filter count results (required) :return: CountResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_count_with_http_info(scope_id, body, **kwargs) # noqa: E501 else: (data) = self.role_count_with_http_info(scope_id, body, **kwargs) # noqa: E501 return data def role_count_with_http_info(self, scope_id, body, **kwargs): # noqa: E501 """Counts the Roles # noqa: E501 Counts the Roles with the given RoleQuery parameter returning the number of matching Roles # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_count_with_http_info(scope_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to count results (required) :param RoleQuery body: The RoleQuery to use to filter count results (required) :return: CountResult If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_count" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_count`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_count`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/_count', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CountResult', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_create(self, scope_id, body, **kwargs): # noqa: E501 """Create a Role # noqa: E501 Creates a new Role based on the information provided in RoleCreator parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_create(scope_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to create the Account (required) :param RoleCreator body: Provides the information for the new Role to be created (required) :return: Role If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_create_with_http_info(scope_id, body, **kwargs) # noqa: E501 else: (data) = self.role_create_with_http_info(scope_id, body, **kwargs) # noqa: E501 return data def role_create_with_http_info(self, scope_id, body, **kwargs): # noqa: E501 """Create a Role # noqa: E501 Creates a new Role based on the information provided in RoleCreator parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_create_with_http_info(scope_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to create the Account (required) :param RoleCreator body: Provides the information for the new Role to be created (required) :return: Role If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_create" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_create`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_create`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Role', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_delete(self, scope_id, role_id, **kwargs): # noqa: E501 """Delete a Role # noqa: E501 Deletes the Role specified by the \"roleId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_delete(scope_id, role_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the Account to delete. (required) :param str role_id: The id of the Role to be deleted (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_delete_with_http_info(scope_id, role_id, **kwargs) # noqa: E501 else: (data) = self.role_delete_with_http_info(scope_id, role_id, **kwargs) # noqa: E501 return data def role_delete_with_http_info(self, scope_id, role_id, **kwargs): # noqa: E501 """Delete a Role # noqa: E501 Deletes the Role specified by the \"roleId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_delete_with_http_info(scope_id, role_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the Account to delete. (required) :param str role_id: The id of the Role to be deleted (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_delete`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_find(self, scope_id, role_id, **kwargs): # noqa: E501 """Get a Role # noqa: E501 Returns the Role specified by the \"roleId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_find(scope_id, role_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the requested Account. (required) :param str role_id: The id of the requested Role (required) :return: Role If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_find_with_http_info(scope_id, role_id, **kwargs) # noqa: E501 else: (data) = self.role_find_with_http_info(scope_id, role_id, **kwargs) # noqa: E501 return data def role_find_with_http_info(self, scope_id, role_id, **kwargs): # noqa: E501 """Get a Role # noqa: E501 Returns the Role specified by the \"roleId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_find_with_http_info(scope_id, role_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the requested Account. (required) :param str role_id: The id of the requested Role (required) :return: Role If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_find" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_find`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_find`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/xml']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Role', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_permission_count(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Counts the RolePermissions # noqa: E501 Counts the RolePermissions with the given RolePermissionQuery parameter returning the number of matching RolePermissions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_count(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to count results. (required) :param str role_id: The Role id in which to count results. (required) :param RolePermissionQuery body: The RolePermissionQuery to use to filter results. (required) :return: CountResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_permission_count_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 else: (data) = self.role_permission_count_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 return data def role_permission_count_with_http_info(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Counts the RolePermissions # noqa: E501 Counts the RolePermissions with the given RolePermissionQuery parameter returning the number of matching RolePermissions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_count_with_http_info(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to count results. (required) :param str role_id: The Role id in which to count results. (required) :param RolePermissionQuery body: The RolePermissionQuery to use to filter results. (required) :return: CountResult If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_permission_count" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_permission_count`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_permission_count`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_permission_count`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}/permissions/_count', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='CountResult', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_permission_create(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Create a RolePermission # noqa: E501 Creates a new RolePermission based on the information provided in RolePermissionCreator parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_create(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to create the RolePermission (required) :param str role_id: The Role id in which to create the RolePermission. (required) :param RolePermissionCreator body: Provides the information for the new RolePermission to be created (required) :return: RolePermission If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_permission_create_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 else: (data) = self.role_permission_create_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 return data def role_permission_create_with_http_info(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Create a RolePermission # noqa: E501 Creates a new RolePermission based on the information provided in RolePermissionCreator parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_create_with_http_info(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to create the RolePermission (required) :param str role_id: The Role id in which to create the RolePermission. (required) :param RolePermissionCreator body: Provides the information for the new RolePermission to be created (required) :return: RolePermission If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_permission_create" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_permission_create`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_permission_create`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_permission_create`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}/permissions', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='RolePermission', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_permission_delete(self, scope_id, role_id, role_permission_id, **kwargs): # noqa: E501 """Delete an RolePermission # noqa: E501 Deletes the RolePermission specified by the \"rolePermissionId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_delete(scope_id, role_id, role_permission_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the RolePermission to delete. (required) :param str role_id: Specifies the Role Id for the requested RolePermission (required) :param str role_permission_id: The id of the RolePermission to be deleted (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_permission_delete_with_http_info(scope_id, role_id, role_permission_id, **kwargs) # noqa: E501 else: (data) = self.role_permission_delete_with_http_info(scope_id, role_id, role_permission_id, **kwargs) # noqa: E501 return data def role_permission_delete_with_http_info(self, scope_id, role_id, role_permission_id, **kwargs): # noqa: E501 """Delete an RolePermission # noqa: E501 Deletes the RolePermission specified by the \"rolePermissionId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_delete_with_http_info(scope_id, role_id, role_permission_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the RolePermission to delete. (required) :param str role_id: Specifies the Role Id for the requested RolePermission (required) :param str role_permission_id: The id of the RolePermission to be deleted (required) :return: None If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'role_permission_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_permission_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_permission_delete`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_permission_delete`") # noqa: E501 # verify the required parameter 'role_permission_id' is set if ('role_permission_id' not in params or params['role_permission_id'] is None): raise ValueError("Missing the required parameter `role_permission_id` when calling `role_permission_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 if 'role_permission_id' in params: path_params['rolePermissionId'] = params['role_permission_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}/permissions/{rolePermissionId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_permission_find(self, scope_id, role_id, role_permission_id, **kwargs): # noqa: E501 """Get a RolePermission # noqa: E501 Returns the RolePermission specified by the \"rolePermissionId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_find(scope_id, role_id, role_permission_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the requested RolePermission. (required) :param str role_id: Specifies the RoleId for the requested RolePermission (required) :param str role_permission_id: The id of the requested RolePermission (required) :return: RolePermission If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_permission_find_with_http_info(scope_id, role_id, role_permission_id, **kwargs) # noqa: E501 else: (data) = self.role_permission_find_with_http_info(scope_id, role_id, role_permission_id, **kwargs) # noqa: E501 return data def role_permission_find_with_http_info(self, scope_id, role_id, role_permission_id, **kwargs): # noqa: E501 """Get a RolePermission # noqa: E501 Returns the RolePermission specified by the \"rolePermissionId\" path parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_find_with_http_info(scope_id, role_id, role_permission_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the requested RolePermission. (required) :param str role_id: Specifies the RoleId for the requested RolePermission (required) :param str role_permission_id: The id of the requested RolePermission (required) :return: RolePermission If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'role_permission_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_permission_find" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_permission_find`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_permission_find`") # noqa: E501 # verify the required parameter 'role_permission_id' is set if ('role_permission_id' not in params or params['role_permission_id'] is None): raise ValueError("Missing the required parameter `role_permission_id` when calling `role_permission_find`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 if 'role_permission_id' in params: path_params['rolePermissionId'] = params['role_permission_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/xml']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}/permissions/{rolePermissionId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='RolePermission', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_permission_query(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Queries the RolePermissions # noqa: E501 Queries the RolePermissions with the given RolePermissionQuery parameter returning all matching RolePermissions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_query(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param str role_id: The Role id in which to search results. (required) :param RolePermissionQuery body: The RolePermissionQuery to use to filter results. (required) :return: RolePermissionListResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_permission_query_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 else: (data) = self.role_permission_query_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 return data def role_permission_query_with_http_info(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Queries the RolePermissions # noqa: E501 Queries the RolePermissions with the given RolePermissionQuery parameter returning all matching RolePermissions # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_query_with_http_info(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param str role_id: The Role id in which to search results. (required) :param RolePermissionQuery body: The RolePermissionQuery to use to filter results. (required) :return: RolePermissionListResult If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_permission_query" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_permission_query`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_permission_query`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_permission_query`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}/permissions/_query', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='RolePermissionListResult', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_permission_simple_query(self, scope_id, role_id, **kwargs): # noqa: E501 """Gets the RolePermission list in the scope # noqa: E501 Returns the list of all the rolePermissions associated to the current selected scope. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_simple_query(scope_id, role_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param str role_id: The id of the Role to filter results. (required) :param str name: The domain name to filter results. :param str action: The action to filter results. :param int offset: The result set offset. :param int limit: The result set limit. :return: RolePermissionListResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_permission_simple_query_with_http_info(scope_id, role_id, **kwargs) # noqa: E501 else: (data) = self.role_permission_simple_query_with_http_info(scope_id, role_id, **kwargs) # noqa: E501 return data def role_permission_simple_query_with_http_info(self, scope_id, role_id, **kwargs): # noqa: E501 """Gets the RolePermission list in the scope # noqa: E501 Returns the list of all the rolePermissions associated to the current selected scope. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_permission_simple_query_with_http_info(scope_id, role_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param str role_id: The id of the Role to filter results. (required) :param str name: The domain name to filter results. :param str action: The action to filter results. :param int offset: The result set offset. :param int limit: The result set limit. :return: RolePermissionListResult If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'name', 'action', 'offset', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_permission_simple_query" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_permission_simple_query`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_permission_simple_query`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 if 'action' in params: query_params.append(('action', params['action'])) # noqa: E501 if 'offset' in params: query_params.append(('offset', params['offset'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/xml']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}/permissions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='RolePermissionListResult', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_query(self, scope_id, body, **kwargs): # noqa: E501 """Queries the Roles # noqa: E501 Queries the Roles with the given RoleQuery parameter returning all matching Roles # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_query(scope_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param RoleQuery body: The RoleQuery to use to filter results. (required) :return: RoleListResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_query_with_http_info(scope_id, body, **kwargs) # noqa: E501 else: (data) = self.role_query_with_http_info(scope_id, body, **kwargs) # noqa: E501 return data def role_query_with_http_info(self, scope_id, body, **kwargs): # noqa: E501 """Queries the Roles # noqa: E501 Queries the Roles with the given RoleQuery parameter returning all matching Roles # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_query_with_http_info(scope_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param RoleQuery body: The RoleQuery to use to filter results. (required) :return: RoleListResult If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_query" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_query`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_query`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/_query', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='RoleListResult', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_simple_query(self, scope_id, **kwargs): # noqa: E501 """Gets the Role list in the scope # noqa: E501 Returns the list of all the roles associated to the current selected scope. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_simple_query(scope_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param str name: The role name to filter results. :param int offset: The result set offset. :param int limit: The result set limit. :return: RoleListResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_simple_query_with_http_info(scope_id, **kwargs) # noqa: E501 else: (data) = self.role_simple_query_with_http_info(scope_id, **kwargs) # noqa: E501 return data def role_simple_query_with_http_info(self, scope_id, **kwargs): # noqa: E501 """Gets the Role list in the scope # noqa: E501 Returns the list of all the roles associated to the current selected scope. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_simple_query_with_http_info(scope_id, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId in which to search results. (required) :param str name: The role name to filter results. :param int offset: The result set offset. :param int limit: The result set limit. :return: RoleListResult If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'name', 'offset', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_simple_query" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_simple_query`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 query_params = [] if 'name' in params: query_params.append(('name', params['name'])) # noqa: E501 if 'offset' in params: query_params.append(('offset', params['offset'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json', 'application/xml']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='RoleListResult', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def role_update(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Update an Role # noqa: E501 Updates a new Role based on the information provided in the Role parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_update(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the requested Account. (required) :param str role_id: The id of the requested Role (required) :param Role body: The modified Role whose attributed need to be updated (required) :return: Role If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.role_update_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 else: (data) = self.role_update_with_http_info(scope_id, role_id, body, **kwargs) # noqa: E501 return data def role_update_with_http_info(self, scope_id, role_id, body, **kwargs): # noqa: E501 """Update an Role # noqa: E501 Updates a new Role based on the information provided in the Role parameter. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.role_update_with_http_info(scope_id, role_id, body, async_req=True) >>> result = thread.get() :param async_req bool :param str scope_id: The ScopeId of the requested Account. (required) :param str role_id: The id of the requested Role (required) :param Role body: The modified Role whose attributed need to be updated (required) :return: Role If the method is called asynchronously, returns the request thread. """ all_params = ['scope_id', 'role_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method role_update" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'scope_id' is set if ('scope_id' not in params or params['scope_id'] is None): raise ValueError("Missing the required parameter `scope_id` when calling `role_update`") # noqa: E501 # verify the required parameter 'role_id' is set if ('role_id' not in params or params['role_id'] is None): raise ValueError("Missing the required parameter `role_id` when calling `role_update`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `role_update`") # noqa: E501 collection_formats = {} path_params = {} if 'scope_id' in params: path_params['scopeId'] = params['scope_id'] # noqa: E501 if 'role_id' in params: path_params['roleId'] = params['role_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # Authentication setting auth_settings = ['kapuaAccessToken'] # noqa: E501 return self.api_client.call_api( '/{scopeId}/roles/{roleId}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='Role', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
43.922025
142
0.621858
7,705
64,214
4.953537
0.027774
0.048419
0.018157
0.021458
0.986245
0.984987
0.984044
0.98035
0.97862
0.977415
0
0.01536
0.289283
64,214
1,461
143
43.952088
0.820939
0.356184
0
0.831039
1
0
0.218464
0.04773
0
0
0
0
0
1
0.033792
false
0
0.005006
0
0.088861
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
b28df110b60f9d18736e136915dc79cc87a15146
141
py
Python
layers/activation.py
inflation/wgan
a546251fd4c825a95e075fea0dac7abe301b0b81
[ "MIT" ]
2
2017-03-12T07:55:35.000Z
2019-12-04T06:09:10.000Z
layers/activation.py
inflation/wgan
a546251fd4c825a95e075fea0dac7abe301b0b81
[ "MIT" ]
null
null
null
layers/activation.py
inflation/wgan
a546251fd4c825a95e075fea0dac7abe301b0b81
[ "MIT" ]
null
null
null
import tensorflow as tf def leaky_relu(input_tensor, leak=0.2, name="leaky_relu"): return tf.maximum(input_tensor, leak * input_tensor)
28.2
58
0.765957
23
141
4.478261
0.652174
0.320388
0.291262
0
0
0
0
0
0
0
0
0.01626
0.12766
141
5
59
28.2
0.821138
0
0
0
0
0
0.070423
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
8
a23ebd46264ddb8520b565bd8dcfe079ed3f651e
14,823
py
Python
sdk/python/pulumi_vault/quota_lease_count.py
pulumi/pulumi-vault
1682875f4a5d7d508f36e166529ad2b8aec34090
[ "ECL-2.0", "Apache-2.0" ]
10
2019-10-07T17:44:18.000Z
2022-03-30T20:46:33.000Z
sdk/python/pulumi_vault/quota_lease_count.py
pulumi/pulumi-vault
1682875f4a5d7d508f36e166529ad2b8aec34090
[ "ECL-2.0", "Apache-2.0" ]
79
2019-10-11T18:13:07.000Z
2022-03-31T21:09:41.000Z
sdk/python/pulumi_vault/quota_lease_count.py
pulumi/pulumi-vault
1682875f4a5d7d508f36e166529ad2b8aec34090
[ "ECL-2.0", "Apache-2.0" ]
2
2019-10-28T10:08:40.000Z
2020-03-17T14:20:55.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities __all__ = ['QuotaLeaseCountArgs', 'QuotaLeaseCount'] @pulumi.input_type class QuotaLeaseCountArgs: def __init__(__self__, *, max_leases: pulumi.Input[int], name: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a QuotaLeaseCount resource. :param pulumi.Input[int] max_leases: The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. :param pulumi.Input[str] name: Name of the rate limit quota :param pulumi.Input[str] path: Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ pulumi.set(__self__, "max_leases", max_leases) if name is not None: pulumi.set(__self__, "name", name) if path is not None: pulumi.set(__self__, "path", path) @property @pulumi.getter(name="maxLeases") def max_leases(self) -> pulumi.Input[int]: """ The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. """ return pulumi.get(self, "max_leases") @max_leases.setter def max_leases(self, value: pulumi.Input[int]): pulumi.set(self, "max_leases", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Name of the rate limit quota """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter def path(self) -> Optional[pulumi.Input[str]]: """ Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ return pulumi.get(self, "path") @path.setter def path(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "path", value) @pulumi.input_type class _QuotaLeaseCountState: def __init__(__self__, *, max_leases: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering QuotaLeaseCount resources. :param pulumi.Input[int] max_leases: The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. :param pulumi.Input[str] name: Name of the rate limit quota :param pulumi.Input[str] path: Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ if max_leases is not None: pulumi.set(__self__, "max_leases", max_leases) if name is not None: pulumi.set(__self__, "name", name) if path is not None: pulumi.set(__self__, "path", path) @property @pulumi.getter(name="maxLeases") def max_leases(self) -> Optional[pulumi.Input[int]]: """ The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. """ return pulumi.get(self, "max_leases") @max_leases.setter def max_leases(self, value: Optional[pulumi.Input[int]]): pulumi.set(self, "max_leases", value) @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ Name of the rate limit quota """ return pulumi.get(self, "name") @name.setter def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) @property @pulumi.getter def path(self) -> Optional[pulumi.Input[str]]: """ Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ return pulumi.get(self, "path") @path.setter def path(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "path", value) class QuotaLeaseCount(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, max_leases: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None, __props__=None): """ Manage lease count quotas which enforce the number of leases that can be created. A lease count quota can be created at the root level or defined on a namespace or mount by specifying a path when creating the quota. See [Vault's Documentation](https://www.vaultproject.io/docs/enterprise/lease-count-quotas) for more information. **Note** this feature is available only with Vault Enterprise. ## Example Usage ```python import pulumi import pulumi_vault as vault global_ = vault.QuotaLeaseCount("global", max_leases=100, path="") ``` ## Import Lease count quotas can be imported using their names ```sh $ pulumi import vault:index/quotaLeaseCount:QuotaLeaseCount global global ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[int] max_leases: The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. :param pulumi.Input[str] name: Name of the rate limit quota :param pulumi.Input[str] path: Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ ... @overload def __init__(__self__, resource_name: str, args: QuotaLeaseCountArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Manage lease count quotas which enforce the number of leases that can be created. A lease count quota can be created at the root level or defined on a namespace or mount by specifying a path when creating the quota. See [Vault's Documentation](https://www.vaultproject.io/docs/enterprise/lease-count-quotas) for more information. **Note** this feature is available only with Vault Enterprise. ## Example Usage ```python import pulumi import pulumi_vault as vault global_ = vault.QuotaLeaseCount("global", max_leases=100, path="") ``` ## Import Lease count quotas can be imported using their names ```sh $ pulumi import vault:index/quotaLeaseCount:QuotaLeaseCount global global ``` :param str resource_name: The name of the resource. :param QuotaLeaseCountArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(QuotaLeaseCountArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, max_leases: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = QuotaLeaseCountArgs.__new__(QuotaLeaseCountArgs) if max_leases is None and not opts.urn: raise TypeError("Missing required property 'max_leases'") __props__.__dict__["max_leases"] = max_leases __props__.__dict__["name"] = name __props__.__dict__["path"] = path super(QuotaLeaseCount, __self__).__init__( 'vault:index/quotaLeaseCount:QuotaLeaseCount', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, max_leases: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, path: Optional[pulumi.Input[str]] = None) -> 'QuotaLeaseCount': """ Get an existing QuotaLeaseCount resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[int] max_leases: The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. :param pulumi.Input[str] name: Name of the rate limit quota :param pulumi.Input[str] path: Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _QuotaLeaseCountState.__new__(_QuotaLeaseCountState) __props__.__dict__["max_leases"] = max_leases __props__.__dict__["name"] = name __props__.__dict__["path"] = path return QuotaLeaseCount(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="maxLeases") def max_leases(self) -> pulumi.Output[int]: """ The maximum number of leases to be allowed by the quota rule. The `max_leases` must be positive. """ return pulumi.get(self, "max_leases") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ Name of the rate limit quota """ return pulumi.get(self, "name") @property @pulumi.getter def path(self) -> pulumi.Output[Optional[str]]: """ Path of the mount or namespace to apply the quota. A blank path configures a global rate limit quota. For example `namespace1/` adds a quota to a full namespace, `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`. Updating this field on an existing quota can have "moving" effects. For example, updating `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.** """ return pulumi.get(self, "path")
43.985163
134
0.638467
1,833
14,823
5.020185
0.108565
0.051402
0.042599
0.043034
0.80526
0.78885
0.781135
0.772549
0.767007
0.767007
0
0.003253
0.274101
14,823
336
135
44.116071
0.851952
0.500236
0
0.648276
1
0
0.075676
0.006836
0
0
0
0
0
1
0.151724
false
0.006897
0.034483
0
0.275862
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
a2597641c57569f89306a4a14193361652fa8e96
56
py
Python
python/testData/refactoring/changeSignature/positionalOnlyMarkerTurnsKeywordArgumentIntoPositional.after.py
Sajaki/intellij-community
6748af2c40567839d11fd652ec77ba263c074aad
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/refactoring/changeSignature/positionalOnlyMarkerTurnsKeywordArgumentIntoPositional.after.py
Sajaki/intellij-community
6748af2c40567839d11fd652ec77ba263c074aad
[ "Apache-2.0" ]
1
2020-07-30T19:04:47.000Z
2020-07-30T19:04:47.000Z
python/testData/refactoring/changeSignature/positionalOnlyMarkerTurnsKeywordArgumentIntoPositional.after.py
bradleesand/intellij-community
750ff9c10333c9c1278c00dbe8d88c877b1b9749
[ "Apache-2.0" ]
1
2020-10-15T05:56:42.000Z
2020-10-15T05:56:42.000Z
def func(a, /, b): pass func(1, b=2) func(1, b=2)
8
18
0.482143
13
56
2.076923
0.538462
0.37037
0.444444
0.518519
0
0
0
0
0
0
0
0.097561
0.267857
56
6
19
9.333333
0.560976
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0
0
0.25
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
7
a28f3ac57e36593bb5f3774e54f47e51ce310bb2
83
py
Python
datasets/__init__.py
hhk998402/NaiveBayesClassifier
ac7e7b8b67505e526376a1a8e96f25f5a1ac5705
[ "MIT" ]
27
2018-09-13T21:13:34.000Z
2022-02-05T21:48:54.000Z
datasets/__init__.py
hhk998402/NaiveBayesClassifier
ac7e7b8b67505e526376a1a8e96f25f5a1ac5705
[ "MIT" ]
null
null
null
datasets/__init__.py
hhk998402/NaiveBayesClassifier
ac7e7b8b67505e526376a1a8e96f25f5a1ac5705
[ "MIT" ]
28
2018-12-19T18:59:43.000Z
2022-03-05T20:00:11.000Z
from .datasets import load_loan_defaulters from .datasets import load_pima_indians
27.666667
42
0.879518
12
83
5.75
0.666667
0.347826
0.521739
0.637681
0
0
0
0
0
0
0
0
0.096386
83
2
43
41.5
0.92
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
a2a812bd0791839a55c95f970d6abecc211e948b
194
py
Python
test/test_word_composition_game.py
erichaase/topcoder-python
de285d8092a94f2ec1b5c0c33eba55b5c27a5390
[ "MIT" ]
1
2017-03-25T17:40:57.000Z
2017-03-25T17:40:57.000Z
test/test_word_composition_game.py
erichaase/topcoder-python
de285d8092a94f2ec1b5c0c33eba55b5c27a5390
[ "MIT" ]
null
null
null
test/test_word_composition_game.py
erichaase/topcoder-python
de285d8092a94f2ec1b5c0c33eba55b5c27a5390
[ "MIT" ]
null
null
null
from test.assert_json import assert_json from topcoder.word_composition_game import solution def test_word_composition_game (): assert_json('word_composition_game', solution)
32.333333
54
0.783505
25
194
5.68
0.44
0.211268
0.401408
0
0
0
0
0
0
0
0
0
0.164948
194
5
55
38.8
0.876543
0
0
0
0
0
0.108247
0.108247
0
0
0
0
0.5
1
0.25
true
0
0.5
0
0.75
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
1
0
1
0
1
0
0
9
38ec3cf5d1ac72a92473f712a7786d47afcf20b4
258
py
Python
hackerrank/16. numpy/7.py
Eurydia/Xian-assignment
4a7e4bcd3d4999ea7429054fec1792064c96ff30
[ "MIT" ]
null
null
null
hackerrank/16. numpy/7.py
Eurydia/Xian-assignment
4a7e4bcd3d4999ea7429054fec1792064c96ff30
[ "MIT" ]
null
null
null
hackerrank/16. numpy/7.py
Eurydia/Xian-assignment
4a7e4bcd3d4999ea7429054fec1792064c96ff30
[ "MIT" ]
null
null
null
import numpy n, m = map(int, input().split()) a = numpy.array([tuple(map(int, input().split())) for _ in range(n)]) b = numpy.array([tuple(map(int, input().split())) for _ in range(n)]) print(a+b) print(a-b) print(a*b) print(a//b) print(a%b) print(a**b)
17.2
69
0.616279
50
258
3.14
0.32
0.229299
0.267516
0.382166
0.802548
0.802548
0.802548
0.802548
0.802548
0.802548
0
0
0.127907
258
14
70
18.428571
0.697778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.1
0
0.1
0.6
0
0
0
null
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
10
ac237f68500e2609095185eddbb7976bf81c8ebf
114
py
Python
src/tf_components/visualization/__init__.py
YorkUCVIL/Wavelet-Flow
8d6d63fa116ec44299c32f37e66817594510f644
[ "MIT" ]
59
2020-10-28T03:09:05.000Z
2022-01-29T22:10:04.000Z
src/tf_components/visualization/__init__.py
YorkUCVIL/Wavelet-Flow
8d6d63fa116ec44299c32f37e66817594510f644
[ "MIT" ]
4
2020-12-24T11:00:40.000Z
2021-05-22T06:14:27.000Z
src/tf_components/visualization/__init__.py
YorkUCVIL/Wavelet-Flow
8d6d63fa116ec44299c32f37e66817594510f644
[ "MIT" ]
2
2020-10-29T01:15:03.000Z
2021-04-20T11:55:51.000Z
from tf_components.visualization.clip_uint8 import * from tf_components.visualization.haar_visualization import *
38
60
0.877193
14
114
6.857143
0.571429
0.125
0.333333
0.604167
0
0
0
0
0
0
0
0.009434
0.070175
114
2
61
57
0.896226
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
ac322a72c9a44008676aa9a3e9611834a06f8eec
1,472
py
Python
core/models/mobilenet_v3/get_mobilenet.py
matthew-wave/pool
698c140d161f369ef6a198dec9ab8b91a4532fa8
[ "MIT" ]
6
2020-04-17T10:13:28.000Z
2020-10-13T08:16:32.000Z
core/models/mobilenet_v3/get_mobilenet.py
matthew-wave/pool
698c140d161f369ef6a198dec9ab8b91a4532fa8
[ "MIT" ]
null
null
null
core/models/mobilenet_v3/get_mobilenet.py
matthew-wave/pool
698c140d161f369ef6a198dec9ab8b91a4532fa8
[ "MIT" ]
1
2021-05-14T08:11:08.000Z
2021-05-14T08:11:08.000Z
from core.models.mobilenet_v3.mobilenet_v3 import * def small(num_classes=1001, pretrained=True, pretrain_model_path='./data/pretrain_models/mobilenet_v3_small.pth'): return mobilenet(conv_defs=V3_SMALL, num_classes=num_classes, pretrained=pretrained, checkpoint_path=pretrain_model_path) def small_minimalistic(num_classes=1001, pretrained=True, pretrain_model_path='./data/pretrain_models/mobilenet_v3_small.pth'): return mobilenet(conv_defs=V3_SMALL_MINIMALISTIC, num_classes=num_classes, pretrained=pretrained, checkpoint_path=pretrain_model_path) def large(num_classes=1001, pretrained=True, pretrain_model_path='./data/pretrain_models/mobilenet_v3_large.pth'): return mobilenet(conv_defs=V3_LARGE, num_classes=num_classes, pretrained=pretrained, checkpoint_path=pretrain_model_path) def large_minimalistic(num_classes=1001, pretrained=True, pretrain_model_path='./data/pretrain_models/mobilenet_v3_small.pth'): return mobilenet(conv_defs=V3_LARGE_MINIMALISTIC, num_classes=num_classes, pretrained=pretrained, checkpoint_path=pretrain_model_path) def edge_tpu(num_classes=1001, pretrained=True, pretrain_model_path='./data/pretrain_models/mobilenet_v3_small.pth'): return mobilenet(conv_defs=V3_EDGETPU, num_classes=num_classes, pretrained=pretrained, checkpoint_path=pretrain_model_path)
47.483871
92
0.761549
183
1,472
5.73224
0.147541
0.142993
0.162059
0.114395
0.929457
0.929457
0.929457
0.893232
0.893232
0.893232
0
0.025703
0.154212
1,472
31
93
47.483871
0.816867
0
0
0.428571
0
0
0.152749
0.152749
0
0
0
0
0
1
0.238095
false
0
0.047619
0.238095
0.52381
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
9
ac4146882a51b4eeb6b796cc2694adb63c7429c7
3,764
py
Python
dev/Experimental/Pysat/tally/tests/test_tally_hypothesis.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
119
2019-05-14T18:44:34.000Z
2022-03-17T01:01:02.000Z
dev/Experimental/Pysat/tally/tests/test_tally_hypothesis.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
717
2019-04-03T15:36:35.000Z
2022-03-31T21:56:47.000Z
dev/Experimental/Pysat/tally/tests/test_tally_hypothesis.py
mabrains/ALIGN-public
9a6c14310de13df369a8340f465911b629f15a3f
[ "BSD-3-Clause" ]
34
2019-04-01T21:21:27.000Z
2022-03-21T09:46:57.000Z
from hypothesis import given, example import hypothesis.strategies as st from tally.tally import * @given(st.lists(st.booleans())) @example([]) @example([True]) @example([True,True]) @example([False]) @example([False,False]) def test_at_most_one_alt_hypothesis(lst): s = Tally() mgr = VarMgr( s) a = mgr.add_var( BitVec( s, 'a', len(lst))) print("lst:", lst) for (idx,v) in enumerate(lst): if v: s.emit_always(a.var(idx)) else: s.emit_never(a.var(idx)) s.emit_at_most_one_alt( a.vars) s.solve() if len( [v for v in lst if v]) <= 1: assert s.state == 'SAT' else: assert s.state == 'UNSAT' @given(st.lists(st.booleans())) @example([]) @example([True]) @example([True,True]) @example([False]) @example([False,False]) def test_tally_hypothesis(lst): s = Tally() mgr = VarMgr( s) a = mgr.add_var( BitVec( s, 'a', len(lst))) b = mgr.add_var( BitVec( s, 'b', len(lst))) tally = len([v for v in lst if v]) print("lst:", lst, tally) for (val,var) in zip(lst,a.vars): if val: s.emit_always( var) else: s.emit_never( var) if tally > 0: s.emit_always(b.var(tally-1)) if tally < len(lst): s.emit_never(b.var(tally)) s.emit_tally( a.vars, b.vars) s.solve() assert s.state == 'SAT' @given(st.lists(st.booleans())) @example([True,True,True]) @example([True,False,True]) def test_xor_hypothesis(lst): s = Tally() mgr = VarMgr( s) a = mgr.add_var( BitVec( s, 'a', len(lst))) z = mgr.add_var( BitVar( s, 'z')) tally = len([v for v in lst if v]) print("xor lst:", lst, tally) for (val,var) in zip(lst,a.vars): if val: s.emit_always( var) else: s.emit_never( var) if tally % 2 == 1: s.emit_always(z.var()) else: s.emit_never(z.var()) s.emit_xor( a.vars, z.var()) s.solve() assert s.state == 'SAT' @given(st.lists(st.booleans())) @example([True,True,True]) @example([True,False,True]) def test_xnor_hypothesis(lst): s = Tally() mgr = VarMgr( s) a = mgr.add_var( BitVec( s, 'a', len(lst))) z = mgr.add_var( BitVar( s, 'z')) tally = len([v for v in lst if v]) true_tallys = list(range(0,len(lst)+1,2)) print("xnor lst:", lst, tally, true_tallys) for (val,var) in zip(lst,a.vars): if val: s.emit_always( var) else: s.emit_never( var) if tally % 2 == 0: s.emit_always(z.var()) else: s.emit_never(z.var()) s.emit_symmetric( true_tallys, a.vars, z.var()) s.solve() assert s.state == 'SAT' @given(st.lists(st.booleans())) @example([True,True,True]) @example([True,False,True]) def test_symmetric_hypothesis(lst): s = Tally() mgr = VarMgr( s) a = mgr.add_var( BitVec( s, 'a', len(lst))) z = mgr.add_var( BitVar( s, 'z')) tally = len([v for v in lst if v]) true_tallys = list(range( (len(lst)+1)//2, len(lst)+1)) print("majority lst:", lst, tally, true_tallys) for (val,var) in zip(lst,a.vars): if val: s.emit_always( var) else: s.emit_never( var) if tally in true_tallys: s.emit_always(z.var()) else: s.emit_never(z.var()) s.emit_symmetric( true_tallys, a.vars, z.var()) s.solve() assert s.state == 'SAT' @given(st.lists(st.booleans())) @example([]) @example([True,True,True]) @example([True,False,True]) def test_majority_hypothesis(lst): s = Tally() mgr = VarMgr( s) a = mgr.add_var( BitVec( s, 'a', len(lst))) z = mgr.add_var( BitVar( s, 'z')) tally = len([v for v in lst if v]) print("majority lst:", lst, tally) for (val,var) in zip(lst,a.vars): if val: s.emit_always( var) else: s.emit_never( var) if tally >= (len(lst)+1)//2: s.emit_always(z.var()) else: s.emit_never(z.var()) s.emit_majority( a.vars, z.var()) s.solve() assert s.state == 'SAT'
21.632184
57
0.604145
646
3,764
3.421053
0.092879
0.063348
0.044796
0.063348
0.812217
0.795475
0.795475
0.795475
0.788235
0.788235
0
0.004983
0.200319
3,764
173
58
21.757225
0.729236
0
0
0.744681
0
0
0.022582
0
0
0
0
0
0.049645
1
0.042553
false
0
0.021277
0
0.06383
0.042553
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
ce31c085305f636cc2e306e19cbd37f3e4bed798
215
py
Python
x_transformers/__init__.py
booydar/x-transformers
97f0a854fdf4df8a3fbf6a580e2375463af3538c
[ "MIT" ]
null
null
null
x_transformers/__init__.py
booydar/x-transformers
97f0a854fdf4df8a3fbf6a580e2375463af3538c
[ "MIT" ]
null
null
null
x_transformers/__init__.py
booydar/x-transformers
97f0a854fdf4df8a3fbf6a580e2375463af3538c
[ "MIT" ]
null
null
null
from .x_transformers import XTransformer, Encoder, Decoder, CrossAttender, Attention, TransformerWrapper, ViTransformerWrapper, ContinuousTransformerWrapper from .autoregressive_wrapper import AutoregressiveWrapper
71.666667
156
0.888372
17
215
11.117647
0.882353
0
0
0
0
0
0
0
0
0
0
0
0.069767
215
2
157
107.5
0.945
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
ce44aea930721da362bff735696a871a73822f9a
8,832
py
Python
test/testMessageScheduler.py
kdheepak89/pypdevs
979d708a184d342313cc7c2b6bd24225e475af3b
[ "Apache-2.0" ]
null
null
null
test/testMessageScheduler.py
kdheepak89/pypdevs
979d708a184d342313cc7c2b6bd24225e475af3b
[ "Apache-2.0" ]
null
null
null
test/testMessageScheduler.py
kdheepak89/pypdevs
979d708a184d342313cc7c2b6bd24225e475af3b
[ "Apache-2.0" ]
2
2020-05-29T10:12:37.000Z
2021-05-19T21:32:35.000Z
# Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at # McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from testutils import * from pypdevs.messageScheduler import MessageScheduler from copy import deepcopy class TestMessageScheduler(unittest.TestCase): def setUp(self): self.scheduler = MessageScheduler() def tearDown(self): pass def test_mscheduler_schedule(self): self.assertTrue(len(self.scheduler.heap) == 0) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {}) # Only [0] and [3] are important, so don't even bother # creating the rest msg = NetworkMessage((1, 1), {}, 12345, False, 0) self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 1) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {}) msg = deepcopy(msg) msg.uuid = 444 self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 2) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {}) msg = deepcopy(msg) msg.uuid = 456 self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 3) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {}) def test_mschedule_invalids(self): self.assertTrue(len(self.scheduler.heap) == 0) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {}) # Only [0] and [3] are important, so don't even bother # creating the rest msg = NetworkMessage((1, 1), {}, 12345, False, 0) self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 1) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {}) msg = deepcopy(msg) msg.uuid = 1111 self.scheduler.invalids = {1111: 1} self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 1) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {1111: 0}) msg = deepcopy(msg) msg.uuid = 1111 self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 2) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {1111: 0}) msg = deepcopy(msg) msg.uuid = 234 self.scheduler.invalids[234] = -2 self.scheduler.schedule(msg) self.assertTrue(len(self.scheduler.heap) == 3) self.assertTrue(len(self.scheduler.processed) == 0) self.assertTrue(self.scheduler.invalids == {1111: 0, 234: -2}) def test_mscheduler_unschedule(self): msg1 = NetworkMessage((3, 1), {}, 1, False, 0) msg2 = NetworkMessage((4, 1), {}, 2, False, 0) msg3 = NetworkMessage((5, 1), {}, 3, False, 0) self.scheduler.heap = [msg1, msg2, msg3] self.scheduler.processed = [] self.scheduler.unschedule(msg2) self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {2: 1}) self.scheduler.unschedule(msg1) self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {1: 1, 2: 1}) msg4 = NetworkMessage((5, 1), {}, 4, False, 0) self.scheduler.unschedule(msg4) self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {1: 1, 2: 1, 4: 1}) def test_mscheduler_read_first(self): msg1 = NetworkMessage((3, 1), {}, 1, False, 0) msg2 = NetworkMessage((4, 1), {}, 2, False, 0) msg3 = NetworkMessage((5, 1), {}, 3, False, 0) self.scheduler.heap = [msg1, msg2, msg3] self.scheduler.processed = [] self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) first = self.scheduler.readFirst() self.assertTrue(first == msg1) self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) first = self.scheduler.readFirst() self.assertTrue(first == msg1) self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.invalids = {1: 1} first = self.scheduler.readFirst() self.assertTrue(first == msg2) self.assertTrue(self.scheduler.heap == [msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {1: 0}) def test_mscheduler_removeFirst(self): msg1 = NetworkMessage((3, 1), {}, 1, False, 0) msg2 = NetworkMessage((4, 1), {}, 2, False, 0) msg3 = NetworkMessage((5, 1), {}, 3, False, 0) self.scheduler.heap = [msg1, msg2, msg3] self.scheduler.processed = [] self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.removeFirst() self.assertTrue(self.scheduler.heap == [msg2, msg3]) self.assertTrue(self.scheduler.processed == [msg1]) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.invalids = {2: 1} self.scheduler.removeFirst() self.assertTrue(self.scheduler.heap == []) self.assertTrue(self.scheduler.processed == [msg1, msg3]) self.assertTrue(self.scheduler.invalids == {2: 0}) def test_mscheduler_revert(self): msg1 = NetworkMessage((3, 1), {}, 1, False, 0) msg2 = NetworkMessage((4, 1), {}, 2, False, 0) msg3 = NetworkMessage((5, 1), {}, 3, False, 0) self.scheduler.heap = [msg3] self.scheduler.processed = [msg1, msg2] self.scheduler.revert((4, 1)) self.assertTrue(self.scheduler.heap == [msg2, msg3]) self.assertTrue(self.scheduler.processed == [msg1]) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.revert((2, 1)) self.assertTrue(self.scheduler.heap == [msg1, msg3, msg2]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.heap = [] self.scheduler.processed = [msg1, msg2, msg3] self.scheduler.revert((2, 1)) self.assertTrue(self.scheduler.heap == [msg1, msg2, msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) def test_mscheduler_cleanup(self): msg1 = NetworkMessage((3, 1), {}, 1, False, 0) msg2 = NetworkMessage((4, 1), {}, 2, False, 0) msg3 = NetworkMessage((5, 1), {}, 3, False, 0) self.scheduler.heap = [msg3] self.scheduler.processed = [msg1, msg2] self.scheduler.cleanup((4, 1)) self.assertTrue(self.scheduler.heap == [msg3]) self.assertTrue(self.scheduler.processed == [msg2]) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.cleanup((5, 1)) self.assertTrue(self.scheduler.heap == [msg3]) self.assertTrue(self.scheduler.processed == []) self.assertTrue(self.scheduler.invalids == {}) self.scheduler.processed = [msg1, msg2] self.scheduler.invalids = {2: 1} self.scheduler.cleanup((4, 1)) self.assertTrue(self.scheduler.heap == [msg3]) self.assertTrue(self.scheduler.processed == [msg2]) self.assertTrue(self.scheduler.invalids == {2: 1})
37.423729
77
0.624207
1,016
8,832
5.411417
0.127953
0.271917
0.186613
0.27992
0.811022
0.803019
0.787741
0.763369
0.744634
0.744634
0
0.040453
0.230299
8,832
235
78
37.582979
0.768314
0.091259
0
0.7625
0
0
0
0
0
0
0
0
0.4875
1
0.05625
false
0.00625
0.01875
0
0.08125
0
0
0
0
null
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
11
cbf88aef02d53b882723dff4eeb778131af874be
17,210
py
Python
tests/test_parsing.py
nfelger/gesetze-aus-dem-internet
cc7430d0e42a8d5c57a8b7fc6e25a8879aa80658
[ "Apache-2.0" ]
2
2022-02-11T21:54:01.000Z
2022-02-12T18:42:29.000Z
tests/test_parsing.py
nfelger/gesetze-aus-dem-internet
cc7430d0e42a8d5c57a8b7fc6e25a8879aa80658
[ "Apache-2.0" ]
null
null
null
tests/test_parsing.py
nfelger/gesetze-aus-dem-internet
cc7430d0e42a8d5c57a8b7fc6e25a8879aa80658
[ "Apache-2.0" ]
null
null
null
from unittest import mock from gadi.gesetze_im_internet.parsing import parse_law def test_parser(): mock_open = mock.mock_open(read_data=XML_DATA) with mock.patch("gadi.gesetze_im_internet.parsing.open", mock_open): law = parse_law("mock/xml/path.xml") assert law["doknr"] == "BJNR055429995" assert law["abbreviation"] == "SkAufG" assert law["extra_abbreviations"] == [] assert law["first_published"] == "1995-07-20" assert law["source_timestamp"] == "20200722212521" assert law["title_short"] == "Streitkräfteaufenthaltsgesetz" assert law["title_long"] == ( "Gesetz über die Rechtsstellung ausländischer Streitkräfte bei\nvorübergehenden " "Aufenthalten in der Bundesrepublik Deutschland" ) assert law["publication_info"] == [ {"periodical": "BGBl II", "reference": "1995, 554"} ] assert law["status_info"] == [ { "category": "Stand", "comment": "Zuletzt geändert durch Art. 191 V v. 19.6.2020 I 1328", } ] assert law["notes_body"] is None assert law["notes_footnotes"] is None assert law["notes_documentary_footnotes"] == \ '<P><BR /> <pre xml:space="preserve">(+++ Textnachweis ab: 27.7.1995 +++)<BR /><BR /></pre></P>' assert len(law["contents"]) == 9 item = law["contents"][0] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNE000600305" assert item["name"] == "Eingangsformel" assert item["title"] is None assert item["body"] == "<P>Der Bundestag hat mit Zustimmung des Bundesrates das folgende Gesetz beschlossen:</P>" assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] is None item = law["contents"][1] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNG000100305" assert item["name"] == "Art 1" assert item["title"] is None assert item["body"] == ( "<P>(1) Die Bundesregierung wird ermächtigt, Vereinbarungen mit ausländischen Staaten " "über Einreise und vorübergehenden Aufenthalt ihrer Streitkräfte in der Bundesrepublik " "Deutschland für Übungen, Durchreise auf dem Landwege und Ausbildung von Einheiten durch " "Rechtsverordnung ohne Zustimmung des Bundesrates in Kraft zu setzen.</P><P>(2) " "Vereinbarungen dürfen nur mit solchen Staaten geschlossen werden, die auch der " "Bundeswehr den Aufenthalt in ihrem Hoheitsgebiet gestatten.</P><P>(3) Die betroffenen " "Länder werden beteiligt.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] is None item = law["contents"][2] assert item["item_type"] == "heading_article" assert item["doknr"] == "BJNR055429995BJNG000200305" assert item["name"] == "Art 2" assert item["title"] is None assert item["body"] == ( "<P>In die Vereinbarungen werden, soweit nach ihrem Gegenstand und Zweck erforderlich, " "Regelungen mit folgendem Inhalt aufgenommen.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] is None item = law["contents"][3] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNE000700305" assert item["name"] == "§ 1" assert item["title"] == "Allgemeine Voraussetzungen" assert item["body"] == ( "<P>(1) Für Einreise und Aufenthalt bestimmen sich die Rechte und Pflichten der " "ausländischen Streitkräfte und ihrer Mitglieder nach den deutschen Gesetzen und " "Rechtsvorschriften.</P><P>(2) In der Vereinbarung sind die Rahmenbedingungen für den " "Aufenthalt der ausländischen Streitkräfte nach Art, Umfang und Dauer festzulegen.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] == law["contents"][2] item = law["contents"][4] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNE000801310" assert item["name"] == "§ 2" assert item["title"] == "Grenzübertritt, Einreise" assert item["body"] == ( "<P>(1) Ausländische Streitkräfte und deren Mitglieder sind im Rahmen dieses Gesetzes " "und der ausländerrechtlichen Vorschriften berechtigt, mit Land-, Wasser- und " "Luftfahrzeugen in die Bundesrepublik Deutschland einzureisen und sich in oder über " "dem Bundesgebiet aufzuhalten.</P><P>(2) Mitglieder ausländischer Streitkräfte, die zum " "militärischen Personal gehören, müssen beim Grenzübertritt mit sich führen entweder " "<DL Font=\"normal\" Type=\"arabic\"><DT>a)</DT><DD Font=\"normal\"><LA Size=\"normal\">einen " "gültigen Paß oder ein anerkanntes Paßersatzpapier oder</LA></DD> <DT>b)</DT><DD Font=\"normal\">" "<LA Size=\"normal\">einen amtlichen Lichtbildausweis, sofern sie in eine Sammelliste " "eingetragen sind und sich der Einheits- oder Verbandsführer durch einen gültigen Paß " "oder ein anerkanntes Paßersatzpapier ausweisen kann.</LA></DD> </DL> </P><P>(3) Mitglieder " "ausländischer Streitkräfte, die zum zivilen Personal gehören, müssen beim Grenzübertritt " "einen gültigen Paß oder ein anerkanntes Paßersatzpapier mit sich führen.</P><P>(4) " "Mitglieder ausländischer Streitkräfte weisen sich durch einen Paß, ein anerkanntes " "Paßersatzpapier oder, soweit sie zum militärischen Personal gehören, durch eine " "Sammelliste in Verbindung mit einem amtlichen Lichtbildausweis aus.</P><P>(5) Es " "gelten die internationalen und die deutschen Gesundheitsvorschriften. Bei der Einreise " "in die Bundesrepublik Deutschland kann die Vorlage eines von den Behörden des " "ausländischen Staates ausgestellten amtlichen Gesundheitszeugnisses verlangt werden, " "aus dem hervorgeht, daß die Mitglieder ausländischer Streitkräfte frei von ansteckenden " "Krankheiten sind.</P><P>(6) Wird die öffentliche Sicherheit oder Ordnung der " "Bundesrepublik Deutschland durch ein ziviles oder militärisches Mitglied einer " "ausländischen Streitkraft gefährdet, so kann die Bundesrepublik Deutschland die unverzügliche " "Entfernung des Mitgliedes durch die ausländischen Streitkräfte verlangen. In der Vereinbarung " "ist zu bestimmen, daß die Behörden des Entsendestaates solchen Entfernungsersuchen " "nachzukommen und die Aufnahme des betreffenden Mitgliedes im eigenen Hoheitsgebiet zu " "gewährleisten haben. Im übrigen bleiben die Bestimmungen des Aufenthaltsgesetzes unberührt.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] == law["contents"][2] item = law["contents"][5] assert item["item_type"] == "heading" assert item["doknr"] == "BJNR055429995BJNG000300305" assert item["name"] == "Art 3" assert item["title"] is None assert item["parent"] is None item = law["contents"][6] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNE002801311" assert item["name"] == "§ 1" assert item["title"] is None assert item["body"] == ( "<P>Das Bundesministerium der Verteidigung erläßt im Einvernehmen mit dem Bundesministerium des " "Innern, für Bau und Heimat allgemeine Verwaltungsvorschriften zur Ausführung des Artikels 2 § 5 " "über Besitz und Führen von Schußwaffen der diesem Gesetz unterfallenden ausländischen " "Militärangehörigen.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] == law["contents"][5] item = law["contents"][7] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNE002900305" assert item["name"] == "§ 2" assert item["title"] is None assert item["body"] == ( "<P>Der Verzicht auf die Ausübung der deutschen Gerichtsbarkeit gemäß Artikel 2 § 7 Abs. 2 " "wird von der Staatsanwaltschaft erklärt.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] == law["contents"][5] item = law["contents"][8] assert item["item_type"] == "article" assert item["doknr"] == "BJNR055429995BJNG000400305" assert item["name"] == "Art 4" assert item["title"] is None assert item["body"] == ( "<P>Dieses Gesetz findet keine Anwendung auf <ABWFORMAT typ=\"A\" />Militärattaches eines " "ausländischen Staates in der Bundesrepublik Deutschland, die Mitglieder ihrer Stäbe " "sowie andere Militärpersonen, die in der Bundesrepublik Deutschland einen diplomatischen " "oder konsularischen Status haben.</P>" ) assert item["footnotes"] is None assert item["documentary_footnotes"] is None assert item["parent"] is None XML_DATA = """\ <?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE dokumente SYSTEM "http://www.gesetze-im-internet.de/dtd/1.01/gii-norm.dtd"> <dokumente builddate="20200722212521" doknr="BJNR055429995"><norm builddate="20200722212521" doknr="BJNR055429995"><metadaten><jurabk>SkAufG</jurabk><amtabk>SkAufG</amtabk><ausfertigung-datum manuell="ja">1995-07-20</ausfertigung-datum><fundstelle typ="amtlich"><periodikum>BGBl II</periodikum><zitstelle>1995, 554</zitstelle></fundstelle><kurzue>Streitkräfteaufenthaltsgesetz</kurzue><langue>Gesetz über die Rechtsstellung ausländischer Streitkräfte bei vorübergehenden Aufenthalten in der Bundesrepublik Deutschland</langue><standangabe checked="ja"><standtyp>Stand</standtyp><standkommentar>Zuletzt geändert durch Art. 191 V v. 19.6.2020 I 1328</standkommentar></standangabe></metadaten><textdaten><fussnoten><Content><P><BR /> <pre xml:space="preserve">(+++ Textnachweis ab: 27.7.1995 +++)<BR /><BR /></pre></P></Content></fussnoten></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNE000600305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>000</gliederungskennzahl><gliederungsbez>-</gliederungsbez></gliederungseinheit><enbez>Eingangsformel</enbez></metadaten><textdaten><text format="XML"><Content><P>Der Bundestag hat mit Zustimmung des Bundesrates das folgende Gesetz beschlossen:</P></Content></text></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNG000100305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>010</gliederungskennzahl><gliederungsbez>Art 1</gliederungsbez></gliederungseinheit></metadaten><textdaten><text format="XML"><Content><P>(1) Die Bundesregierung wird ermächtigt, Vereinbarungen mit ausländischen Staaten über Einreise und vorübergehenden Aufenthalt ihrer Streitkräfte in der Bundesrepublik Deutschland für Übungen, Durchreise auf dem Landwege und Ausbildung von Einheiten durch Rechtsverordnung ohne Zustimmung des Bundesrates in Kraft zu setzen.</P><P>(2) Vereinbarungen dürfen nur mit solchen Staaten geschlossen werden, die auch der Bundeswehr den Aufenthalt in ihrem Hoheitsgebiet gestatten.</P><P>(3) Die betroffenen Länder werden beteiligt.</P></Content> </text></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNG000200305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>020</gliederungskennzahl><gliederungsbez>Art 2</gliederungsbez></gliederungseinheit></metadaten><textdaten><text format="XML"><Content><P>In die Vereinbarungen werden, soweit nach ihrem Gegenstand und Zweck erforderlich, Regelungen mit folgendem Inhalt aufgenommen.</P></Content></text></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNE000700305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>020</gliederungskennzahl><gliederungsbez>Art 2</gliederungsbez></gliederungseinheit><enbez>§ 1</enbez><titel format="parat">Allgemeine Voraussetzungen</titel></metadaten><textdaten><text format="XML"><Content><P>(1) Für Einreise und Aufenthalt bestimmen sich die Rechte und Pflichten der ausländischen Streitkräfte und ihrer Mitglieder nach den deutschen Gesetzen und Rechtsvorschriften.</P><P>(2) In der Vereinbarung sind die Rahmenbedingungen für den Aufenthalt der ausländischen Streitkräfte nach Art, Umfang und Dauer festzulegen.</P></Content> </text></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNE000801310"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>020</gliederungskennzahl><gliederungsbez>Art 2</gliederungsbez></gliederungseinheit><enbez>§ 2</enbez><titel format="parat">Grenzübertritt, Einreise</titel></metadaten><textdaten><text format="XML"><Content><P>(1) Ausländische Streitkräfte und deren Mitglieder sind im Rahmen dieses Gesetzes und der ausländerrechtlichen Vorschriften berechtigt, mit Land-, Wasser- und Luftfahrzeugen in die Bundesrepublik Deutschland einzureisen und sich in oder über dem Bundesgebiet aufzuhalten.</P><P>(2) Mitglieder ausländischer Streitkräfte, die zum militärischen Personal gehören, müssen beim Grenzübertritt mit sich führen entweder <DL Font="normal" Type="arabic"><DT>a)</DT><DD Font="normal"><LA Size="normal">einen gültigen Paß oder ein anerkanntes Paßersatzpapier oder</LA></DD> <DT>b)</DT><DD Font="normal"><LA Size="normal">einen amtlichen Lichtbildausweis, sofern sie in eine Sammelliste eingetragen sind und sich der Einheits- oder Verbandsführer durch einen gültigen Paß oder ein anerkanntes Paßersatzpapier ausweisen kann.</LA></DD> </DL> </P><P>(3) Mitglieder ausländischer Streitkräfte, die zum zivilen Personal gehören, müssen beim Grenzübertritt einen gültigen Paß oder ein anerkanntes Paßersatzpapier mit sich führen.</P><P>(4) Mitglieder ausländischer Streitkräfte weisen sich durch einen Paß, ein anerkanntes Paßersatzpapier oder, soweit sie zum militärischen Personal gehören, durch eine Sammelliste in Verbindung mit einem amtlichen Lichtbildausweis aus.</P><P>(5) Es gelten die internationalen und die deutschen Gesundheitsvorschriften. Bei der Einreise in die Bundesrepublik Deutschland kann die Vorlage eines von den Behörden des ausländischen Staates ausgestellten amtlichen Gesundheitszeugnisses verlangt werden, aus dem hervorgeht, daß die Mitglieder ausländischer Streitkräfte frei von ansteckenden Krankheiten sind.</P><P>(6) Wird die öffentliche Sicherheit oder Ordnung der Bundesrepublik Deutschland durch ein ziviles oder militärisches Mitglied einer ausländischen Streitkraft gefährdet, so kann die Bundesrepublik Deutschland die unverzügliche Entfernung des Mitgliedes durch die ausländischen Streitkräfte verlangen. In der Vereinbarung ist zu bestimmen, daß die Behörden des Entsendestaates solchen Entfernungsersuchen nachzukommen und die Aufnahme des betreffenden Mitgliedes im eigenen Hoheitsgebiet zu gewährleisten haben. Im übrigen bleiben die Bestimmungen des Aufenthaltsgesetzes unberührt.</P></Content> </text><fussnoten /></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNG000300305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>030</gliederungskennzahl><gliederungsbez>Art 3</gliederungsbez></gliederungseinheit></metadaten><textdaten><text format="XML"><Content><P /></Content></text></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNE002801311"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>030</gliederungskennzahl><gliederungsbez>Art 3</gliederungsbez><gliederungstitel /></gliederungseinheit><enbez>§ 1</enbez></metadaten><textdaten><text format="XML"><Content><P>Das Bundesministerium der Verteidigung erläßt im Einvernehmen mit dem Bundesministerium des Innern, für Bau und Heimat allgemeine Verwaltungsvorschriften zur Ausführung des Artikels 2 § 5 über Besitz und Führen von Schußwaffen der diesem Gesetz unterfallenden ausländischen Militärangehörigen.</P></Content></text><fussnoten /></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNE002900305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>030</gliederungskennzahl><gliederungsbez>Art 3</gliederungsbez></gliederungseinheit><enbez>§ 2</enbez></metadaten><textdaten><text format="XML"><Content><P>Der Verzicht auf die Ausübung der deutschen Gerichtsbarkeit gemäß Artikel 2 § 7 Abs. 2 wird von der Staatsanwaltschaft erklärt.</P></Content></text></textdaten></norm> <norm builddate="20200722212521" doknr="BJNR055429995BJNG000400305"><metadaten><jurabk>SkAufG</jurabk><gliederungseinheit><gliederungskennzahl>040</gliederungskennzahl><gliederungsbez>Art 4</gliederungsbez></gliederungseinheit></metadaten><textdaten><text format="XML"><Content><P>Dieses Gesetz findet keine Anwendung auf <ABWFORMAT typ="A" />Militärattaches eines ausländischen Staates in der Bundesrepublik Deutschland, die Mitglieder ihrer Stäbe sowie andere Militärpersonen, die in der Bundesrepublik Deutschland einen diplomatischen oder konsularischen Status haben.</P></Content></text></textdaten></norm> </dokumente>""" # noqa
88.25641
2,619
0.742998
2,002
17,210
6.372128
0.187313
0.054088
0.023517
0.028847
0.840245
0.815709
0.799639
0.785608
0.753077
0.693502
0
0.046697
0.141429
17,210
194
2,620
88.71134
0.81585
0.000232
0
0.280899
0
0.08427
0.800744
0.265171
0
0
0
0
0.460674
1
0.005618
false
0
0.011236
0
0.016854
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
9
022c0ab35deec5017d20ddaec7843b91c2a44c98
4,552
py
Python
strings.py
SokolAK/QAWA
97553cfe7e25927a929935ccc5999b0d253eb470
[ "MIT" ]
1
2021-09-29T13:15:08.000Z
2021-09-29T13:15:08.000Z
strings.py
SokolAK/QAWA
97553cfe7e25927a929935ccc5999b0d253eb470
[ "MIT" ]
1
2021-09-29T13:17:10.000Z
2021-09-29T13:17:10.000Z
strings.py
SokolAK/QAWA
97553cfe7e25927a929935ccc5999b0d253eb470
[ "MIT" ]
null
null
null
def get_banner(): return f"""~~~ ))) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ F\_/ QAWA Fortran-Code-Profiler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ def get_wrapper_header(): return '!start qawa wrapper ##########################################' def get_wrapper_footer(): return '!end qawa wrapper ############################################' def get_fragment_header(str=''): return f'!start qawa {str} ##################################' def get_fragment_footer(str=''): return f'!end qawa {str} ##################################' def get_prefix(): return 'qawa_' def get_wrapper_declarations(script_dir, out_file): return f""" integer :: q_sys_start, q_sys_end real(kind=8) :: q_wtime_start, q_wtime_end, q_cpu_start, q_cpu_end real(kind=8) :: cpu_rate character(len=256) :: q_file integer :: th, ths, count_rate, count_max, q_unit call system_clock(count_rate=count_rate) call system_clock(count_max=count_max) cpu_rate = real(count_rate) th = OMP_GET_THREAD_NUM() + 1 ths = OMP_GET_NUM_THREADS() write (q_file, '(A)') $'{script_dir} $/outs/ ${out_file}' """ def get_wrapper_time_start(filename, name, typ, file_mode=",position='append'"): return f""" q_wtime_start = omp_get_wtime() call cpu_time(q_cpu_start) call SYSTEM_CLOCK(q_sys_start) !$OMP CRITICAL open(newunit=q_unit,file= $q_file, $action='write'{file_mode}) write(q_unit,'(A, 2I3, 3F24.6)') $'-> {filename} ${name} {typ}', $th, ths, $q_sys_start/cpu_rate, q_cpu_start, q_wtime_start close(q_unit) !$OMP END CRITICAL""" def get_wrapper_time_end(filename, name, typ, file_mode=",position='append'"): return f""" q_wtime_end = omp_get_wtime() call cpu_time(q_cpu_end) call SYSTEM_CLOCK(q_sys_end) !$OMP CRITICAL open(newunit=q_unit,file= $q_file, $action='write'{file_mode}) write(q_unit,'(A, 2I3, 3F24.6)') $'<- {filename} ${name} {typ}', $th, ths, $q_sys_end/cpu_rate, q_cpu_end, q_wtime_end close(q_unit) !$OMP END CRITICAL""" def get_qawa_start_procedure(script_dir, out_file, file_mode=",position='append'"): return f""" subroutine qawa_S(filename, name, typ) use omp_lib character(*) :: filename, name, typ integer :: q_sys_start real(kind=8) :: q_wtime_start, q_cpu_start real(kind=8) :: cpu_rate character(len=256) :: q_file integer :: th, ths, count_rate, count_max, q_unit call system_clock(count_rate=count_rate) call system_clock(count_max=count_max) cpu_rate = real(count_rate) th = OMP_GET_THREAD_NUM() + 1 ths = OMP_GET_NUM_THREADS() write (q_file, '(A)') $'{script_dir} $/outs/ ${out_file}' q_wtime_start = omp_get_wtime() call cpu_time(q_cpu_start) call SYSTEM_CLOCK(q_sys_start) !$OMP CRITICAL open(newunit=q_unit,file= $q_file, $action='write'{file_mode}) write(q_unit,'(6A, 2I3, 3F24.3)') $'-> ', filename, ' ', name, ' ', typ, $th, ths, $q_sys_start/cpu_rate, q_cpu_start, q_wtime_start close(q_unit) !$OMP END CRITICAL end subroutine qawa_S """ def get_qawa_end_procedure(script_dir, out_file, file_mode=",position='append'"): return f""" subroutine qawa_E(filename, name, typ) use omp_lib character(*) :: filename, name, typ integer :: q_sys_end real(kind=8) :: q_wtime_end, q_cpu_end real(kind=8) :: cpu_rate character(len=256) :: q_file integer :: th, ths, count_rate, count_max, q_unit call system_clock(count_rate=count_rate) call system_clock(count_max=count_max) cpu_rate = real(count_rate) th = OMP_GET_THREAD_NUM() + 1 ths = OMP_GET_NUM_THREADS() write (q_file, '(A)') $'{script_dir} $/outs/ ${out_file}' q_wtime_end = omp_get_wtime() call cpu_time(q_cpu_end) call SYSTEM_CLOCK(q_sys_end) !$OMP CRITICAL open(newunit=q_unit,file= $q_file, $action='write'{file_mode}) write(q_unit,'(6A, 2I3, 3F24.3)') $'<- ', filename, ' ', name, ' ', typ, $th, ths, $q_sys_end/cpu_rate, q_cpu_end, q_wtime_end close(q_unit) !$OMP END CRITICAL end subroutine qawa_E """
29.367742
84
0.570958
615
4,552
3.868293
0.118699
0.031526
0.063052
0.050441
0.844052
0.837747
0.837747
0.826398
0.80454
0.790248
0
0.012979
0.255272
4,552
154
85
29.558442
0.688791
0
0
0.713178
0
0
0.854479
0.204638
0
0
0
0
0
1
0.085271
false
0
0
0.085271
0.170543
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
0256dbd51a2315f9dd234c9e6cfa30c8c8a399b8
87
py
Python
smartninja_redis/__init__.py
smartninja/smartninja-redis
5e2f8d84e3fbe5591867e04d964ce876408bc650
[ "MIT" ]
null
null
null
smartninja_redis/__init__.py
smartninja/smartninja-redis
5e2f8d84e3fbe5591867e04d964ce876408bc650
[ "MIT" ]
null
null
null
smartninja_redis/__init__.py
smartninja/smartninja-redis
5e2f8d84e3fbe5591867e04d964ce876408bc650
[ "MIT" ]
null
null
null
from smartninja_redis.client import from_url from smartninja_redis.client import Redis
29
44
0.885057
13
87
5.692308
0.461538
0.378378
0.513514
0.675676
0.837838
0
0
0
0
0
0
0
0.091954
87
2
45
43.5
0.936709
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
9
02620992c449cccb213ef11df762205faae2bda2
289,944
py
Python
tnt/tnt_lib/shipment_request.py
Purplship/purplship-carriers
dcd044320b86e9af5fe3ef15c36ebf7828b2851b
[ "MIT" ]
2
2021-04-12T22:40:28.000Z
2021-04-21T18:28:31.000Z
tnt/tnt_lib/shipment_request.py
Purplship/purplship-carriers
dcd044320b86e9af5fe3ef15c36ebf7828b2851b
[ "MIT" ]
2
2021-01-29T07:14:31.000Z
2021-02-18T18:29:23.000Z
tnt/tnt_lib/shipment_request.py
Purplship/purplship-carriers
dcd044320b86e9af5fe3ef15c36ebf7828b2851b
[ "MIT" ]
3
2020-09-09T17:04:46.000Z
2021-03-05T00:32:32.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Wed Feb 24 19:49:29 2021 by generateDS.py version 2.37.16. # Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39) [Clang 6.0 (clang-600.0.57)] # # Command line options: # ('--no-namespace-defs', '') # ('-o', './tnt_lib/shipment_request.py') # # Command line arguments: # ./schemas/shipment_request.xsd # # Command line: # /Users/danielkobina/Workspace/project/purplship-carriers/.venv/purplship-carriers/bin/generateDS --no-namespace-defs -o "./tnt_lib/shipment_request.py" ./schemas/shipment_request.xsd # # Current working directory (os.getcwd()): # tnt # import sys try: ModulenotfoundExp_ = ModuleNotFoundError except NameError: ModulenotfoundExp_ = ImportError from six.moves import zip_longest import os import re as re_ import base64 import datetime as datetime_ import decimal as decimal_ try: from lxml import etree as etree_ except ModulenotfoundExp_ : from xml.etree import ElementTree as etree_ Validate_simpletypes_ = True SaveElementTreeNode = True if sys.version_info.major == 2: BaseStrType_ = basestring else: BaseStrType_ = str def parsexml_(infile, parser=None, **kwargs): if parser is None: # Use the lxml ElementTree compatible parser so that, e.g., # we ignore comments. try: parser = etree_.ETCompatXMLParser() except AttributeError: # fallback to xml.etree parser = etree_.XMLParser() try: if isinstance(infile, os.PathLike): infile = os.path.join(infile) except AttributeError: pass doc = etree_.parse(infile, parser=parser, **kwargs) return doc def parsexmlstring_(instring, parser=None, **kwargs): if parser is None: # Use the lxml ElementTree compatible parser so that, e.g., # we ignore comments. try: parser = etree_.ETCompatXMLParser() except AttributeError: # fallback to xml.etree parser = etree_.XMLParser() element = etree_.fromstring(instring, parser=parser, **kwargs) return element # # Namespace prefix definition table (and other attributes, too) # # The module generatedsnamespaces, if it is importable, must contain # a dictionary named GeneratedsNamespaceDefs. This Python dictionary # should map element type names (strings) to XML schema namespace prefix # definitions. The export method for any class for which there is # a namespace prefix definition, will export that definition in the # XML representation of that element. See the export method of # any generated element type class for an example of the use of this # table. # A sample table is: # # # File: generatedsnamespaces.py # # GenerateDSNamespaceDefs = { # "ElementtypeA": "http://www.xxx.com/namespaceA", # "ElementtypeB": "http://www.xxx.com/namespaceB", # } # # Additionally, the generatedsnamespaces module can contain a python # dictionary named GenerateDSNamespaceTypePrefixes that associates element # types with the namespace prefixes that are to be added to the # "xsi:type" attribute value. See the exportAttributes method of # any generated element type and the generation of "xsi:type" for an # example of the use of this table. # An example table: # # # File: generatedsnamespaces.py # # GenerateDSNamespaceTypePrefixes = { # "ElementtypeC": "aaa:", # "ElementtypeD": "bbb:", # } # try: from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_ except ModulenotfoundExp_ : GenerateDSNamespaceDefs_ = {} try: from generatedsnamespaces import GenerateDSNamespaceTypePrefixes as GenerateDSNamespaceTypePrefixes_ except ModulenotfoundExp_ : GenerateDSNamespaceTypePrefixes_ = {} # # You can replace the following class definition by defining an # importable module named "generatedscollector" containing a class # named "GdsCollector". See the default class definition below for # clues about the possible content of that class. # try: from generatedscollector import GdsCollector as GdsCollector_ except ModulenotfoundExp_ : class GdsCollector_(object): def __init__(self, messages=None): if messages is None: self.messages = [] else: self.messages = messages def add_message(self, msg): self.messages.append(msg) def get_messages(self): return self.messages def clear_messages(self): self.messages = [] def print_messages(self): for msg in self.messages: print("Warning: {}".format(msg)) def write_messages(self, outstream): for msg in self.messages: outstream.write("Warning: {}\n".format(msg)) # # The super-class for enum types # try: from enum import Enum except ModulenotfoundExp_ : Enum = object # # The root super-class for element type classes # # Calls to the methods in these classes are generated by generateDS.py. # You can replace these methods by re-implementing the following class # in a module named generatedssuper.py. try: from generatedssuper import GeneratedsSuper except ModulenotfoundExp_ as exp: class GeneratedsSuper(object): __hash__ = object.__hash__ tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$') class _FixedOffsetTZ(datetime_.tzinfo): def __init__(self, offset, name): self.__offset = datetime_.timedelta(minutes=offset) self.__name = name def utcoffset(self, dt): return self.__offset def tzname(self, dt): return self.__name def dst(self, dt): return None def gds_format_string(self, input_data, input_name=''): return input_data def gds_parse_string(self, input_data, node=None, input_name=''): return input_data def gds_validate_string(self, input_data, node=None, input_name=''): if not input_data: return '' else: return input_data def gds_format_base64(self, input_data, input_name=''): return base64.b64encode(input_data) def gds_validate_base64(self, input_data, node=None, input_name=''): return input_data def gds_format_integer(self, input_data, input_name=''): return '%d' % input_data def gds_parse_integer(self, input_data, node=None, input_name=''): try: ival = int(input_data) except (TypeError, ValueError) as exp: raise_parse_error(node, 'Requires integer value: %s' % exp) return ival def gds_validate_integer(self, input_data, node=None, input_name=''): try: value = int(input_data) except (TypeError, ValueError): raise_parse_error(node, 'Requires integer value') return value def gds_format_integer_list(self, input_data, input_name=''): if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_): input_data = [str(s) for s in input_data] return '%s' % ' '.join(input_data) def gds_validate_integer_list( self, input_data, node=None, input_name=''): values = input_data.split() for value in values: try: int(value) except (TypeError, ValueError): raise_parse_error(node, 'Requires sequence of integer values') return values def gds_format_float(self, input_data, input_name=''): return ('%.15f' % input_data).rstrip('0') def gds_parse_float(self, input_data, node=None, input_name=''): try: fval_ = float(input_data) except (TypeError, ValueError) as exp: raise_parse_error(node, 'Requires float or double value: %s' % exp) return fval_ def gds_validate_float(self, input_data, node=None, input_name=''): try: value = float(input_data) except (TypeError, ValueError): raise_parse_error(node, 'Requires float value') return value def gds_format_float_list(self, input_data, input_name=''): if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_): input_data = [str(s) for s in input_data] return '%s' % ' '.join(input_data) def gds_validate_float_list( self, input_data, node=None, input_name=''): values = input_data.split() for value in values: try: float(value) except (TypeError, ValueError): raise_parse_error(node, 'Requires sequence of float values') return values def gds_format_decimal(self, input_data, input_name=''): return_value = '%s' % input_data if '.' in return_value: return_value = return_value.rstrip('0') if return_value.endswith('.'): return_value = return_value.rstrip('.') return return_value def gds_parse_decimal(self, input_data, node=None, input_name=''): try: decimal_value = decimal_.Decimal(input_data) except (TypeError, ValueError): raise_parse_error(node, 'Requires decimal value') return decimal_value def gds_validate_decimal(self, input_data, node=None, input_name=''): try: value = decimal_.Decimal(input_data) except (TypeError, ValueError): raise_parse_error(node, 'Requires decimal value') return value def gds_format_decimal_list(self, input_data, input_name=''): if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_): input_data = [str(s) for s in input_data] return ' '.join([self.gds_format_decimal(item) for item in input_data]) def gds_validate_decimal_list( self, input_data, node=None, input_name=''): values = input_data.split() for value in values: try: decimal_.Decimal(value) except (TypeError, ValueError): raise_parse_error(node, 'Requires sequence of decimal values') return values def gds_format_double(self, input_data, input_name=''): return '%s' % input_data def gds_parse_double(self, input_data, node=None, input_name=''): try: fval_ = float(input_data) except (TypeError, ValueError) as exp: raise_parse_error(node, 'Requires double or float value: %s' % exp) return fval_ def gds_validate_double(self, input_data, node=None, input_name=''): try: value = float(input_data) except (TypeError, ValueError): raise_parse_error(node, 'Requires double or float value') return value def gds_format_double_list(self, input_data, input_name=''): if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_): input_data = [str(s) for s in input_data] return '%s' % ' '.join(input_data) def gds_validate_double_list( self, input_data, node=None, input_name=''): values = input_data.split() for value in values: try: float(value) except (TypeError, ValueError): raise_parse_error( node, 'Requires sequence of double or float values') return values def gds_format_boolean(self, input_data, input_name=''): return ('%s' % input_data).lower() def gds_parse_boolean(self, input_data, node=None, input_name=''): if input_data in ('true', '1'): bval = True elif input_data in ('false', '0'): bval = False else: raise_parse_error(node, 'Requires boolean value') return bval def gds_validate_boolean(self, input_data, node=None, input_name=''): if input_data not in (True, 1, False, 0, ): raise_parse_error( node, 'Requires boolean value ' '(one of True, 1, False, 0)') return input_data def gds_format_boolean_list(self, input_data, input_name=''): if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_): input_data = [str(s) for s in input_data] return '%s' % ' '.join(input_data) def gds_validate_boolean_list( self, input_data, node=None, input_name=''): values = input_data.split() for value in values: if value not in (True, 1, False, 0, ): raise_parse_error( node, 'Requires sequence of boolean values ' '(one of True, 1, False, 0)') return values def gds_validate_datetime(self, input_data, node=None, input_name=''): return input_data def gds_format_datetime(self, input_data, input_name=''): if input_data.microsecond == 0: _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % ( input_data.year, input_data.month, input_data.day, input_data.hour, input_data.minute, input_data.second, ) else: _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % ( input_data.year, input_data.month, input_data.day, input_data.hour, input_data.minute, input_data.second, ('%f' % (float(input_data.microsecond) / 1000000))[2:], ) if input_data.tzinfo is not None: tzoff = input_data.tzinfo.utcoffset(input_data) if tzoff is not None: total_seconds = tzoff.seconds + (86400 * tzoff.days) if total_seconds == 0: _svalue += 'Z' else: if total_seconds < 0: _svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes) return _svalue @classmethod def gds_parse_datetime(cls, input_data): tz = None if input_data[-1] == 'Z': tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') input_data = input_data[:-1] else: results = GeneratedsSuper.tzoff_pattern.search(input_data) if results is not None: tzoff_parts = results.group(2).split(':') tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) if results.group(1) == '-': tzoff *= -1 tz = GeneratedsSuper._FixedOffsetTZ( tzoff, results.group(0)) input_data = input_data[:-6] time_parts = input_data.split('.') if len(time_parts) > 1: micro_seconds = int(float('0.' + time_parts[1]) * 1000000) input_data = '%s.%s' % ( time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), ) dt = datetime_.datetime.strptime( input_data, '%Y-%m-%dT%H:%M:%S.%f') else: dt = datetime_.datetime.strptime( input_data, '%Y-%m-%dT%H:%M:%S') dt = dt.replace(tzinfo=tz) return dt def gds_validate_date(self, input_data, node=None, input_name=''): return input_data def gds_format_date(self, input_data, input_name=''): _svalue = '%04d-%02d-%02d' % ( input_data.year, input_data.month, input_data.day, ) try: if input_data.tzinfo is not None: tzoff = input_data.tzinfo.utcoffset(input_data) if tzoff is not None: total_seconds = tzoff.seconds + (86400 * tzoff.days) if total_seconds == 0: _svalue += 'Z' else: if total_seconds < 0: _svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format( hours, minutes) except AttributeError: pass return _svalue @classmethod def gds_parse_date(cls, input_data): tz = None if input_data[-1] == 'Z': tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') input_data = input_data[:-1] else: results = GeneratedsSuper.tzoff_pattern.search(input_data) if results is not None: tzoff_parts = results.group(2).split(':') tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) if results.group(1) == '-': tzoff *= -1 tz = GeneratedsSuper._FixedOffsetTZ( tzoff, results.group(0)) input_data = input_data[:-6] dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d') dt = dt.replace(tzinfo=tz) return dt.date() def gds_validate_time(self, input_data, node=None, input_name=''): return input_data def gds_format_time(self, input_data, input_name=''): if input_data.microsecond == 0: _svalue = '%02d:%02d:%02d' % ( input_data.hour, input_data.minute, input_data.second, ) else: _svalue = '%02d:%02d:%02d.%s' % ( input_data.hour, input_data.minute, input_data.second, ('%f' % (float(input_data.microsecond) / 1000000))[2:], ) if input_data.tzinfo is not None: tzoff = input_data.tzinfo.utcoffset(input_data) if tzoff is not None: total_seconds = tzoff.seconds + (86400 * tzoff.days) if total_seconds == 0: _svalue += 'Z' else: if total_seconds < 0: _svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes) return _svalue def gds_validate_simple_patterns(self, patterns, target): # pat is a list of lists of strings/patterns. # The target value must match at least one of the patterns # in order for the test to succeed. found1 = True for patterns1 in patterns: found2 = False for patterns2 in patterns1: mo = re_.search(patterns2, target) if mo is not None and len(mo.group(0)) == len(target): found2 = True break if not found2: found1 = False break return found1 @classmethod def gds_parse_time(cls, input_data): tz = None if input_data[-1] == 'Z': tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC') input_data = input_data[:-1] else: results = GeneratedsSuper.tzoff_pattern.search(input_data) if results is not None: tzoff_parts = results.group(2).split(':') tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1]) if results.group(1) == '-': tzoff *= -1 tz = GeneratedsSuper._FixedOffsetTZ( tzoff, results.group(0)) input_data = input_data[:-6] if len(input_data.split('.')) > 1: dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f') else: dt = datetime_.datetime.strptime(input_data, '%H:%M:%S') dt = dt.replace(tzinfo=tz) return dt.time() def gds_check_cardinality_( self, value, input_name, min_occurs=0, max_occurs=1, required=None): if value is None: length = 0 elif isinstance(value, list): length = len(value) else: length = 1 if required is not None : if required and length < 1: self.gds_collector_.add_message( "Required value {}{} is missing".format( input_name, self.gds_get_node_lineno_())) if length < min_occurs: self.gds_collector_.add_message( "Number of values for {}{} is below " "the minimum allowed, " "expected at least {}, found {}".format( input_name, self.gds_get_node_lineno_(), min_occurs, length)) elif length > max_occurs: self.gds_collector_.add_message( "Number of values for {}{} is above " "the maximum allowed, " "expected at most {}, found {}".format( input_name, self.gds_get_node_lineno_(), max_occurs, length)) def gds_validate_builtin_ST_( self, validator, value, input_name, min_occurs=None, max_occurs=None, required=None): if value is not None: try: validator(value, input_name=input_name) except GDSParseError as parse_error: self.gds_collector_.add_message(str(parse_error)) def gds_validate_defined_ST_( self, validator, value, input_name, min_occurs=None, max_occurs=None, required=None): if value is not None: try: validator(value) except GDSParseError as parse_error: self.gds_collector_.add_message(str(parse_error)) def gds_str_lower(self, instring): return instring.lower() def get_path_(self, node): path_list = [] self.get_path_list_(node, path_list) path_list.reverse() path = '/'.join(path_list) return path Tag_strip_pattern_ = re_.compile(r'\{.*\}') def get_path_list_(self, node, path_list): if node is None: return tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) if tag: path_list.append(tag) self.get_path_list_(node.getparent(), path_list) def get_class_obj_(self, node, default_class=None): class_obj1 = default_class if 'xsi' in node.nsmap: classname = node.get('{%s}type' % node.nsmap['xsi']) if classname is not None: names = classname.split(':') if len(names) == 2: classname = names[1] class_obj2 = globals().get(classname) if class_obj2 is not None: class_obj1 = class_obj2 return class_obj1 def gds_build_any(self, node, type_name=None): # provide default value in case option --disable-xml is used. content = "" content = etree_.tostring(node, encoding="unicode") return content @classmethod def gds_reverse_node_mapping(cls, mapping): return dict(((v, k) for k, v in mapping.items())) @staticmethod def gds_encode(instring): if sys.version_info.major == 2: if ExternalEncoding: encoding = ExternalEncoding else: encoding = 'utf-8' return instring.encode(encoding) else: return instring @staticmethod def convert_unicode(instring): if isinstance(instring, str): result = quote_xml(instring) elif sys.version_info.major == 2 and isinstance(instring, unicode): result = quote_xml(instring).encode('utf8') else: result = GeneratedsSuper.gds_encode(str(instring)) return result def __eq__(self, other): def excl_select_objs_(obj): return (obj[0] != 'parent_object_' and obj[0] != 'gds_collector_') if type(self) != type(other): return False return all(x == y for x, y in zip_longest( filter(excl_select_objs_, self.__dict__.items()), filter(excl_select_objs_, other.__dict__.items()))) def __ne__(self, other): return not self.__eq__(other) # Django ETL transform hooks. def gds_djo_etl_transform(self): pass def gds_djo_etl_transform_db_obj(self, dbobj): pass # SQLAlchemy ETL transform hooks. def gds_sqa_etl_transform(self): return 0, None def gds_sqa_etl_transform_db_obj(self, dbobj): pass def gds_get_node_lineno_(self): if (hasattr(self, "gds_elementtree_node_") and self.gds_elementtree_node_ is not None): return ' near line {}'.format( self.gds_elementtree_node_.sourceline) else: return "" def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' name = class_.__name__ + 'Sub' if hasattr(module, name): return getattr(module, name) else: return None # # If you have installed IPython you can uncomment and use the following. # IPython is available from http://ipython.scipy.org/. # ## from IPython.Shell import IPShellEmbed ## args = '' ## ipshell = IPShellEmbed(args, ## banner = 'Dropping into IPython', ## exit_msg = 'Leaving Interpreter, back to program.') # Then use the following line where and when you want to drop into the # IPython shell: # ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit') # # Globals # ExternalEncoding = '' # Set this to false in order to deactivate during export, the use of # name space prefixes captured from the input document. UseCapturedNS_ = True CapturedNsmap_ = {} Tag_pattern_ = re_.compile(r'({.*})?(.*)') String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL) # Change this to redirect the generated superclass module to use a # specific subclass module. CurrentSubclassModule_ = None # # Support/utility functions. # def showIndent(outfile, level, pretty_print=True): if pretty_print: for idx in range(level): outfile.write(' ') def quote_xml(inStr): "Escape markup chars, but do not modify CDATA sections." if not inStr: return '' s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr) s2 = '' pos = 0 matchobjects = CDATA_pattern_.finditer(s1) for mo in matchobjects: s3 = s1[pos:mo.start()] s2 += quote_xml_aux(s3) s2 += s1[mo.start():mo.end()] pos = mo.end() s3 = s1[pos:] s2 += quote_xml_aux(s3) return s2 def quote_xml_aux(inStr): s1 = inStr.replace('&', '&amp;') s1 = s1.replace('<', '&lt;') s1 = s1.replace('>', '&gt;') return s1 def quote_attrib(inStr): s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr) s1 = s1.replace('&', '&amp;') s1 = s1.replace('<', '&lt;') s1 = s1.replace('>', '&gt;') if '"' in s1: if "'" in s1: s1 = '"%s"' % s1.replace('"', "&quot;") else: s1 = "'%s'" % s1 else: s1 = '"%s"' % s1 return s1 def quote_python(inStr): s1 = inStr if s1.find("'") == -1: if s1.find('\n') == -1: return "'%s'" % s1 else: return "'''%s'''" % s1 else: if s1.find('"') != -1: s1 = s1.replace('"', '\\"') if s1.find('\n') == -1: return '"%s"' % s1 else: return '"""%s"""' % s1 def get_all_text_(node): if node.text is not None: text = node.text else: text = '' for child in node: if child.tail is not None: text += child.tail return text def find_attr_value_(attr_name, node): attrs = node.attrib attr_parts = attr_name.split(':') value = None if len(attr_parts) == 1: value = attrs.get(attr_name) elif len(attr_parts) == 2: prefix, name = attr_parts if prefix == 'xml': namespace = 'http://www.w3.org/XML/1998/namespace' else: namespace = node.nsmap.get(prefix) if namespace is not None: value = attrs.get('{%s}%s' % (namespace, name, )) return value def encode_str_2_3(instr): return instr class GDSParseError(Exception): pass def raise_parse_error(node, msg): if node is not None: msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) raise GDSParseError(msg) class MixedContainer: # Constants for category: CategoryNone = 0 CategoryText = 1 CategorySimple = 2 CategoryComplex = 3 # Constants for content_type: TypeNone = 0 TypeText = 1 TypeString = 2 TypeInteger = 3 TypeFloat = 4 TypeDecimal = 5 TypeDouble = 6 TypeBoolean = 7 TypeBase64 = 8 def __init__(self, category, content_type, name, value): self.category = category self.content_type = content_type self.name = name self.value = value def getCategory(self): return self.category def getContenttype(self, content_type): return self.content_type def getValue(self): return self.value def getName(self): return self.name def export(self, outfile, level, name, namespace, pretty_print=True): if self.category == MixedContainer.CategoryText: # Prevent exporting empty content as empty lines. if self.value.strip(): outfile.write(self.value) elif self.category == MixedContainer.CategorySimple: self.exportSimple(outfile, level, name) else: # category == MixedContainer.CategoryComplex self.value.export( outfile, level, namespace, name_=name, pretty_print=pretty_print) def exportSimple(self, outfile, level, name): if self.content_type == MixedContainer.TypeString: outfile.write('<%s>%s</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeInteger or \ self.content_type == MixedContainer.TypeBoolean: outfile.write('<%s>%d</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeFloat or \ self.content_type == MixedContainer.TypeDecimal: outfile.write('<%s>%f</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeDouble: outfile.write('<%s>%g</%s>' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeBase64: outfile.write('<%s>%s</%s>' % ( self.name, base64.b64encode(self.value), self.name)) def to_etree(self, element, mapping_=None, nsmap_=None): if self.category == MixedContainer.CategoryText: # Prevent exporting empty content as empty lines. if self.value.strip(): if len(element) > 0: if element[-1].tail is None: element[-1].tail = self.value else: element[-1].tail += self.value else: if element.text is None: element.text = self.value else: element.text += self.value elif self.category == MixedContainer.CategorySimple: subelement = etree_.SubElement( element, '%s' % self.name) subelement.text = self.to_etree_simple() else: # category == MixedContainer.CategoryComplex self.value.to_etree(element) def to_etree_simple(self, mapping_=None, nsmap_=None): if self.content_type == MixedContainer.TypeString: text = self.value elif (self.content_type == MixedContainer.TypeInteger or self.content_type == MixedContainer.TypeBoolean): text = '%d' % self.value elif (self.content_type == MixedContainer.TypeFloat or self.content_type == MixedContainer.TypeDecimal): text = '%f' % self.value elif self.content_type == MixedContainer.TypeDouble: text = '%g' % self.value elif self.content_type == MixedContainer.TypeBase64: text = '%s' % base64.b64encode(self.value) return text def exportLiteral(self, outfile, level, name): if self.category == MixedContainer.CategoryText: showIndent(outfile, level) outfile.write( 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % ( self.category, self.content_type, self.name, self.value)) elif self.category == MixedContainer.CategorySimple: showIndent(outfile, level) outfile.write( 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % ( self.category, self.content_type, self.name, self.value)) else: # category == MixedContainer.CategoryComplex showIndent(outfile, level) outfile.write( 'model_.MixedContainer(%d, %d, "%s",\n' % ( self.category, self.content_type, self.name,)) self.value.exportLiteral(outfile, level + 1) showIndent(outfile, level) outfile.write(')\n') class MemberSpec_(object): def __init__(self, name='', data_type='', container=0, optional=0, child_attrs=None, choice=None): self.name = name self.data_type = data_type self.container = container self.child_attrs = child_attrs self.choice = choice self.optional = optional def set_name(self, name): self.name = name def get_name(self): return self.name def set_data_type(self, data_type): self.data_type = data_type def get_data_type_chain(self): return self.data_type def get_data_type(self): if isinstance(self.data_type, list): if len(self.data_type) > 0: return self.data_type[-1] else: return 'xs:string' else: return self.data_type def set_container(self, container): self.container = container def get_container(self): return self.container def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs def get_child_attrs(self): return self.child_attrs def set_choice(self, choice): self.choice = choice def get_choice(self): return self.choice def set_optional(self, optional): self.optional = optional def get_optional(self): return self.optional def _cast(typ, value): if typ is None or value is None: return value return typ(value) # # Data representation classes. # class ESHIPPER(GeneratedsSuper): """Generated by XML Authority""" __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, LOGIN=None, CONSIGNMENTBATCH=None, ACTIVITY=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.LOGIN = LOGIN self.LOGIN_nsprefix_ = None self.CONSIGNMENTBATCH = CONSIGNMENTBATCH self.CONSIGNMENTBATCH_nsprefix_ = None self.ACTIVITY = ACTIVITY self.ACTIVITY_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ESHIPPER) if subclass is not None: return subclass(*args_, **kwargs_) if ESHIPPER.subclass: return ESHIPPER.subclass(*args_, **kwargs_) else: return ESHIPPER(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_LOGIN(self): return self.LOGIN def set_LOGIN(self, LOGIN): self.LOGIN = LOGIN def get_CONSIGNMENTBATCH(self): return self.CONSIGNMENTBATCH def set_CONSIGNMENTBATCH(self, CONSIGNMENTBATCH): self.CONSIGNMENTBATCH = CONSIGNMENTBATCH def get_ACTIVITY(self): return self.ACTIVITY def set_ACTIVITY(self, ACTIVITY): self.ACTIVITY = ACTIVITY def hasContent_(self): if ( self.LOGIN is not None or self.CONSIGNMENTBATCH is not None or self.ACTIVITY is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ESHIPPER', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('ESHIPPER') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'ESHIPPER': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='ESHIPPER') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='ESHIPPER', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='ESHIPPER'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ESHIPPER', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.LOGIN is not None: namespaceprefix_ = self.LOGIN_nsprefix_ + ':' if (UseCapturedNS_ and self.LOGIN_nsprefix_) else '' self.LOGIN.export(outfile, level, namespaceprefix_, namespacedef_='', name_='LOGIN', pretty_print=pretty_print) if self.CONSIGNMENTBATCH is not None: namespaceprefix_ = self.CONSIGNMENTBATCH_nsprefix_ + ':' if (UseCapturedNS_ and self.CONSIGNMENTBATCH_nsprefix_) else '' self.CONSIGNMENTBATCH.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CONSIGNMENTBATCH', pretty_print=pretty_print) if self.ACTIVITY is not None: namespaceprefix_ = self.ACTIVITY_nsprefix_ + ':' if (UseCapturedNS_ and self.ACTIVITY_nsprefix_) else '' self.ACTIVITY.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ACTIVITY', pretty_print=pretty_print) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'LOGIN': obj_ = LOGIN.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.LOGIN = obj_ obj_.original_tagname_ = 'LOGIN' elif nodeName_ == 'CONSIGNMENTBATCH': obj_ = CONSIGNMENTBATCH.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.CONSIGNMENTBATCH = obj_ obj_.original_tagname_ = 'CONSIGNMENTBATCH' elif nodeName_ == 'ACTIVITY': obj_ = ACTIVITY.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.ACTIVITY = obj_ obj_.original_tagname_ = 'ACTIVITY' # end class ESHIPPER class LOGIN(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, COMPANY=None, PASSWORD=None, APPID=None, APPVERSION=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.COMPANY = COMPANY self.COMPANY_nsprefix_ = None self.PASSWORD = PASSWORD self.PASSWORD_nsprefix_ = None self.APPID = APPID self.APPID_nsprefix_ = None self.APPVERSION = APPVERSION self.APPVERSION_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, LOGIN) if subclass is not None: return subclass(*args_, **kwargs_) if LOGIN.subclass: return LOGIN.subclass(*args_, **kwargs_) else: return LOGIN(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_COMPANY(self): return self.COMPANY def set_COMPANY(self, COMPANY): self.COMPANY = COMPANY def get_PASSWORD(self): return self.PASSWORD def set_PASSWORD(self, PASSWORD): self.PASSWORD = PASSWORD def get_APPID(self): return self.APPID def set_APPID(self, APPID): self.APPID = APPID def get_APPVERSION(self): return self.APPVERSION def set_APPVERSION(self, APPVERSION): self.APPVERSION = APPVERSION def hasContent_(self): if ( self.COMPANY is not None or self.PASSWORD is not None or self.APPID is not None or self.APPVERSION is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='LOGIN', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('LOGIN') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'LOGIN': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='LOGIN') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='LOGIN', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='LOGIN'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='LOGIN', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.COMPANY is not None: namespaceprefix_ = self.COMPANY_nsprefix_ + ':' if (UseCapturedNS_ and self.COMPANY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOMPANY>%s</%sCOMPANY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COMPANY), input_name='COMPANY')), namespaceprefix_ , eol_)) if self.PASSWORD is not None: namespaceprefix_ = self.PASSWORD_nsprefix_ + ':' if (UseCapturedNS_ and self.PASSWORD_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPASSWORD>%s</%sPASSWORD>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PASSWORD), input_name='PASSWORD')), namespaceprefix_ , eol_)) if self.APPID is not None: namespaceprefix_ = self.APPID_nsprefix_ + ':' if (UseCapturedNS_ and self.APPID_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sAPPID>%s</%sAPPID>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.APPID), input_name='APPID')), namespaceprefix_ , eol_)) if self.APPVERSION is not None: namespaceprefix_ = self.APPVERSION_nsprefix_ + ':' if (UseCapturedNS_ and self.APPVERSION_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sAPPVERSION>%s</%sAPPVERSION>%s' % (namespaceprefix_ , self.gds_format_decimal(self.APPVERSION, input_name='APPVERSION'), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'COMPANY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COMPANY') value_ = self.gds_validate_string(value_, node, 'COMPANY') self.COMPANY = value_ self.COMPANY_nsprefix_ = child_.prefix elif nodeName_ == 'PASSWORD': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PASSWORD') value_ = self.gds_validate_string(value_, node, 'PASSWORD') self.PASSWORD = value_ self.PASSWORD_nsprefix_ = child_.prefix elif nodeName_ == 'APPID': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'APPID') value_ = self.gds_validate_string(value_, node, 'APPID') self.APPID = value_ self.APPID_nsprefix_ = child_.prefix elif nodeName_ == 'APPVERSION' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'APPVERSION') fval_ = self.gds_validate_decimal(fval_, node, 'APPVERSION') self.APPVERSION = fval_ self.APPVERSION_nsprefix_ = child_.prefix # end class LOGIN class CONSIGNMENTBATCH(GeneratedsSuper): """SR 7855 CONSIGNMEN is now optional, as the input document may be used purely to print a summary manifest or book a whole group""" __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, GROUPCODE=None, SENDER=None, CONSIGNMENT=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.GROUPCODE = GROUPCODE self.GROUPCODE_nsprefix_ = None self.SENDER = SENDER self.SENDER_nsprefix_ = None if CONSIGNMENT is None: self.CONSIGNMENT = [] else: self.CONSIGNMENT = CONSIGNMENT self.CONSIGNMENT_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CONSIGNMENTBATCH) if subclass is not None: return subclass(*args_, **kwargs_) if CONSIGNMENTBATCH.subclass: return CONSIGNMENTBATCH.subclass(*args_, **kwargs_) else: return CONSIGNMENTBATCH(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_GROUPCODE(self): return self.GROUPCODE def set_GROUPCODE(self, GROUPCODE): self.GROUPCODE = GROUPCODE def get_SENDER(self): return self.SENDER def set_SENDER(self, SENDER): self.SENDER = SENDER def get_CONSIGNMENT(self): return self.CONSIGNMENT def set_CONSIGNMENT(self, CONSIGNMENT): self.CONSIGNMENT = CONSIGNMENT def add_CONSIGNMENT(self, value): self.CONSIGNMENT.append(value) def insert_CONSIGNMENT_at(self, index, value): self.CONSIGNMENT.insert(index, value) def replace_CONSIGNMENT_at(self, index, value): self.CONSIGNMENT[index] = value def hasContent_(self): if ( self.GROUPCODE is not None or self.SENDER is not None or self.CONSIGNMENT ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CONSIGNMENTBATCH', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('CONSIGNMENTBATCH') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'CONSIGNMENTBATCH': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CONSIGNMENTBATCH') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CONSIGNMENTBATCH', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CONSIGNMENTBATCH'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CONSIGNMENTBATCH', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.GROUPCODE is not None: namespaceprefix_ = self.GROUPCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.GROUPCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sGROUPCODE>%s</%sGROUPCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.GROUPCODE), input_name='GROUPCODE')), namespaceprefix_ , eol_)) if self.SENDER is not None: namespaceprefix_ = self.SENDER_nsprefix_ + ':' if (UseCapturedNS_ and self.SENDER_nsprefix_) else '' self.SENDER.export(outfile, level, namespaceprefix_, namespacedef_='', name_='SENDER', pretty_print=pretty_print) for CONSIGNMENT_ in self.CONSIGNMENT: namespaceprefix_ = self.CONSIGNMENT_nsprefix_ + ':' if (UseCapturedNS_ and self.CONSIGNMENT_nsprefix_) else '' CONSIGNMENT_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CONSIGNMENT', pretty_print=pretty_print) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'GROUPCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'GROUPCODE') value_ = self.gds_validate_string(value_, node, 'GROUPCODE') self.GROUPCODE = value_ self.GROUPCODE_nsprefix_ = child_.prefix elif nodeName_ == 'SENDER': obj_ = SENDER.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.SENDER = obj_ obj_.original_tagname_ = 'SENDER' elif nodeName_ == 'CONSIGNMENT': obj_ = CONSIGNMENT.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.CONSIGNMENT.append(obj_) obj_.original_tagname_ = 'CONSIGNMENT' # end class CONSIGNMENTBATCH class SENDER(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, COMPANYNAME=None, STREETADDRESS1=None, STREETADDRESS2=None, STREETADDRESS3=None, CITY=None, PROVINCE=None, POSTCODE=None, COUNTRY=None, ACCOUNT=None, VAT=None, CONTACTNAME=None, CONTACTDIALCODE=None, CONTACTTELEPHONE=None, CONTACTEMAIL=None, COLLECTION=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.COMPANYNAME = COMPANYNAME self.COMPANYNAME_nsprefix_ = None self.STREETADDRESS1 = STREETADDRESS1 self.STREETADDRESS1_nsprefix_ = None self.STREETADDRESS2 = STREETADDRESS2 self.STREETADDRESS2_nsprefix_ = None self.STREETADDRESS3 = STREETADDRESS3 self.STREETADDRESS3_nsprefix_ = None self.CITY = CITY self.CITY_nsprefix_ = None self.PROVINCE = PROVINCE self.PROVINCE_nsprefix_ = None self.POSTCODE = POSTCODE self.POSTCODE_nsprefix_ = None self.COUNTRY = COUNTRY self.COUNTRY_nsprefix_ = None self.ACCOUNT = ACCOUNT self.ACCOUNT_nsprefix_ = None self.VAT = VAT self.VAT_nsprefix_ = None self.CONTACTNAME = CONTACTNAME self.CONTACTNAME_nsprefix_ = None self.CONTACTDIALCODE = CONTACTDIALCODE self.CONTACTDIALCODE_nsprefix_ = None self.CONTACTTELEPHONE = CONTACTTELEPHONE self.CONTACTTELEPHONE_nsprefix_ = None self.CONTACTEMAIL = CONTACTEMAIL self.CONTACTEMAIL_nsprefix_ = None self.COLLECTION = COLLECTION self.COLLECTION_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SENDER) if subclass is not None: return subclass(*args_, **kwargs_) if SENDER.subclass: return SENDER.subclass(*args_, **kwargs_) else: return SENDER(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_COMPANYNAME(self): return self.COMPANYNAME def set_COMPANYNAME(self, COMPANYNAME): self.COMPANYNAME = COMPANYNAME def get_STREETADDRESS1(self): return self.STREETADDRESS1 def set_STREETADDRESS1(self, STREETADDRESS1): self.STREETADDRESS1 = STREETADDRESS1 def get_STREETADDRESS2(self): return self.STREETADDRESS2 def set_STREETADDRESS2(self, STREETADDRESS2): self.STREETADDRESS2 = STREETADDRESS2 def get_STREETADDRESS3(self): return self.STREETADDRESS3 def set_STREETADDRESS3(self, STREETADDRESS3): self.STREETADDRESS3 = STREETADDRESS3 def get_CITY(self): return self.CITY def set_CITY(self, CITY): self.CITY = CITY def get_PROVINCE(self): return self.PROVINCE def set_PROVINCE(self, PROVINCE): self.PROVINCE = PROVINCE def get_POSTCODE(self): return self.POSTCODE def set_POSTCODE(self, POSTCODE): self.POSTCODE = POSTCODE def get_COUNTRY(self): return self.COUNTRY def set_COUNTRY(self, COUNTRY): self.COUNTRY = COUNTRY def get_ACCOUNT(self): return self.ACCOUNT def set_ACCOUNT(self, ACCOUNT): self.ACCOUNT = ACCOUNT def get_VAT(self): return self.VAT def set_VAT(self, VAT): self.VAT = VAT def get_CONTACTNAME(self): return self.CONTACTNAME def set_CONTACTNAME(self, CONTACTNAME): self.CONTACTNAME = CONTACTNAME def get_CONTACTDIALCODE(self): return self.CONTACTDIALCODE def set_CONTACTDIALCODE(self, CONTACTDIALCODE): self.CONTACTDIALCODE = CONTACTDIALCODE def get_CONTACTTELEPHONE(self): return self.CONTACTTELEPHONE def set_CONTACTTELEPHONE(self, CONTACTTELEPHONE): self.CONTACTTELEPHONE = CONTACTTELEPHONE def get_CONTACTEMAIL(self): return self.CONTACTEMAIL def set_CONTACTEMAIL(self, CONTACTEMAIL): self.CONTACTEMAIL = CONTACTEMAIL def get_COLLECTION(self): return self.COLLECTION def set_COLLECTION(self, COLLECTION): self.COLLECTION = COLLECTION def hasContent_(self): if ( self.COMPANYNAME is not None or self.STREETADDRESS1 is not None or self.STREETADDRESS2 is not None or self.STREETADDRESS3 is not None or self.CITY is not None or self.PROVINCE is not None or self.POSTCODE is not None or self.COUNTRY is not None or self.ACCOUNT is not None or self.VAT is not None or self.CONTACTNAME is not None or self.CONTACTDIALCODE is not None or self.CONTACTTELEPHONE is not None or self.CONTACTEMAIL is not None or self.COLLECTION is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SENDER', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('SENDER') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'SENDER': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SENDER') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SENDER', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='SENDER'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SENDER', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.COMPANYNAME is not None: namespaceprefix_ = self.COMPANYNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.COMPANYNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOMPANYNAME>%s</%sCOMPANYNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COMPANYNAME), input_name='COMPANYNAME')), namespaceprefix_ , eol_)) if self.STREETADDRESS1 is not None: namespaceprefix_ = self.STREETADDRESS1_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS1_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS1>%s</%sSTREETADDRESS1>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS1), input_name='STREETADDRESS1')), namespaceprefix_ , eol_)) if self.STREETADDRESS2 is not None: namespaceprefix_ = self.STREETADDRESS2_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS2_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS2>%s</%sSTREETADDRESS2>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS2), input_name='STREETADDRESS2')), namespaceprefix_ , eol_)) if self.STREETADDRESS3 is not None: namespaceprefix_ = self.STREETADDRESS3_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS3_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS3>%s</%sSTREETADDRESS3>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS3), input_name='STREETADDRESS3')), namespaceprefix_ , eol_)) if self.CITY is not None: namespaceprefix_ = self.CITY_nsprefix_ + ':' if (UseCapturedNS_ and self.CITY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCITY>%s</%sCITY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CITY), input_name='CITY')), namespaceprefix_ , eol_)) if self.PROVINCE is not None: namespaceprefix_ = self.PROVINCE_nsprefix_ + ':' if (UseCapturedNS_ and self.PROVINCE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPROVINCE>%s</%sPROVINCE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PROVINCE), input_name='PROVINCE')), namespaceprefix_ , eol_)) if self.POSTCODE is not None: namespaceprefix_ = self.POSTCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.POSTCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPOSTCODE>%s</%sPOSTCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.POSTCODE), input_name='POSTCODE')), namespaceprefix_ , eol_)) if self.COUNTRY is not None: namespaceprefix_ = self.COUNTRY_nsprefix_ + ':' if (UseCapturedNS_ and self.COUNTRY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOUNTRY>%s</%sCOUNTRY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COUNTRY), input_name='COUNTRY')), namespaceprefix_ , eol_)) if self.ACCOUNT is not None: namespaceprefix_ = self.ACCOUNT_nsprefix_ + ':' if (UseCapturedNS_ and self.ACCOUNT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sACCOUNT>%s</%sACCOUNT>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ACCOUNT), input_name='ACCOUNT')), namespaceprefix_ , eol_)) if self.VAT is not None: namespaceprefix_ = self.VAT_nsprefix_ + ':' if (UseCapturedNS_ and self.VAT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sVAT>%s</%sVAT>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.VAT), input_name='VAT')), namespaceprefix_ , eol_)) if self.CONTACTNAME is not None: namespaceprefix_ = self.CONTACTNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTNAME>%s</%sCONTACTNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTNAME), input_name='CONTACTNAME')), namespaceprefix_ , eol_)) if self.CONTACTDIALCODE is not None: namespaceprefix_ = self.CONTACTDIALCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTDIALCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTDIALCODE>%s</%sCONTACTDIALCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTDIALCODE), input_name='CONTACTDIALCODE')), namespaceprefix_ , eol_)) if self.CONTACTTELEPHONE is not None: namespaceprefix_ = self.CONTACTTELEPHONE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTTELEPHONE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTTELEPHONE>%s</%sCONTACTTELEPHONE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTTELEPHONE), input_name='CONTACTTELEPHONE')), namespaceprefix_ , eol_)) if self.CONTACTEMAIL is not None: namespaceprefix_ = self.CONTACTEMAIL_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTEMAIL_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTEMAIL>%s</%sCONTACTEMAIL>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTEMAIL), input_name='CONTACTEMAIL')), namespaceprefix_ , eol_)) if self.COLLECTION is not None: namespaceprefix_ = self.COLLECTION_nsprefix_ + ':' if (UseCapturedNS_ and self.COLLECTION_nsprefix_) else '' self.COLLECTION.export(outfile, level, namespaceprefix_, namespacedef_='', name_='COLLECTION', pretty_print=pretty_print) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'COMPANYNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COMPANYNAME') value_ = self.gds_validate_string(value_, node, 'COMPANYNAME') self.COMPANYNAME = value_ self.COMPANYNAME_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS1': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS1') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS1') self.STREETADDRESS1 = value_ self.STREETADDRESS1_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS2': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS2') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS2') self.STREETADDRESS2 = value_ self.STREETADDRESS2_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS3': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS3') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS3') self.STREETADDRESS3 = value_ self.STREETADDRESS3_nsprefix_ = child_.prefix elif nodeName_ == 'CITY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CITY') value_ = self.gds_validate_string(value_, node, 'CITY') self.CITY = value_ self.CITY_nsprefix_ = child_.prefix elif nodeName_ == 'PROVINCE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PROVINCE') value_ = self.gds_validate_string(value_, node, 'PROVINCE') self.PROVINCE = value_ self.PROVINCE_nsprefix_ = child_.prefix elif nodeName_ == 'POSTCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'POSTCODE') value_ = self.gds_validate_string(value_, node, 'POSTCODE') self.POSTCODE = value_ self.POSTCODE_nsprefix_ = child_.prefix elif nodeName_ == 'COUNTRY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COUNTRY') value_ = self.gds_validate_string(value_, node, 'COUNTRY') self.COUNTRY = value_ self.COUNTRY_nsprefix_ = child_.prefix elif nodeName_ == 'ACCOUNT': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'ACCOUNT') value_ = self.gds_validate_string(value_, node, 'ACCOUNT') self.ACCOUNT = value_ self.ACCOUNT_nsprefix_ = child_.prefix elif nodeName_ == 'VAT': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'VAT') value_ = self.gds_validate_string(value_, node, 'VAT') self.VAT = value_ self.VAT_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTNAME') value_ = self.gds_validate_string(value_, node, 'CONTACTNAME') self.CONTACTNAME = value_ self.CONTACTNAME_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTDIALCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTDIALCODE') value_ = self.gds_validate_string(value_, node, 'CONTACTDIALCODE') self.CONTACTDIALCODE = value_ self.CONTACTDIALCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTTELEPHONE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTTELEPHONE') value_ = self.gds_validate_string(value_, node, 'CONTACTTELEPHONE') self.CONTACTTELEPHONE = value_ self.CONTACTTELEPHONE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTEMAIL': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTEMAIL') value_ = self.gds_validate_string(value_, node, 'CONTACTEMAIL') self.CONTACTEMAIL = value_ self.CONTACTEMAIL_nsprefix_ = child_.prefix elif nodeName_ == 'COLLECTION': obj_ = COLLECTION.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.COLLECTION = obj_ obj_.original_tagname_ = 'COLLECTION' # end class SENDER class COLLECTION(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, COLLECTIONADDRESS=None, SHIPDATE=None, PREFCOLLECTTIME=None, ALTCOLLECTTIME=None, COLLINSTRUCTIONS=None, CONFIRMATIONEMAILADDRESS=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.COLLECTIONADDRESS = COLLECTIONADDRESS self.COLLECTIONADDRESS_nsprefix_ = None self.SHIPDATE = SHIPDATE self.SHIPDATE_nsprefix_ = None self.PREFCOLLECTTIME = PREFCOLLECTTIME self.PREFCOLLECTTIME_nsprefix_ = None self.ALTCOLLECTTIME = ALTCOLLECTTIME self.ALTCOLLECTTIME_nsprefix_ = None self.COLLINSTRUCTIONS = COLLINSTRUCTIONS self.COLLINSTRUCTIONS_nsprefix_ = None self.CONFIRMATIONEMAILADDRESS = CONFIRMATIONEMAILADDRESS self.CONFIRMATIONEMAILADDRESS_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COLLECTION) if subclass is not None: return subclass(*args_, **kwargs_) if COLLECTION.subclass: return COLLECTION.subclass(*args_, **kwargs_) else: return COLLECTION(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_COLLECTIONADDRESS(self): return self.COLLECTIONADDRESS def set_COLLECTIONADDRESS(self, COLLECTIONADDRESS): self.COLLECTIONADDRESS = COLLECTIONADDRESS def get_SHIPDATE(self): return self.SHIPDATE def set_SHIPDATE(self, SHIPDATE): self.SHIPDATE = SHIPDATE def get_PREFCOLLECTTIME(self): return self.PREFCOLLECTTIME def set_PREFCOLLECTTIME(self, PREFCOLLECTTIME): self.PREFCOLLECTTIME = PREFCOLLECTTIME def get_ALTCOLLECTTIME(self): return self.ALTCOLLECTTIME def set_ALTCOLLECTTIME(self, ALTCOLLECTTIME): self.ALTCOLLECTTIME = ALTCOLLECTTIME def get_COLLINSTRUCTIONS(self): return self.COLLINSTRUCTIONS def set_COLLINSTRUCTIONS(self, COLLINSTRUCTIONS): self.COLLINSTRUCTIONS = COLLINSTRUCTIONS def get_CONFIRMATIONEMAILADDRESS(self): return self.CONFIRMATIONEMAILADDRESS def set_CONFIRMATIONEMAILADDRESS(self, CONFIRMATIONEMAILADDRESS): self.CONFIRMATIONEMAILADDRESS = CONFIRMATIONEMAILADDRESS def hasContent_(self): if ( self.COLLECTIONADDRESS is not None or self.SHIPDATE is not None or self.PREFCOLLECTTIME is not None or self.ALTCOLLECTTIME is not None or self.COLLINSTRUCTIONS is not None or self.CONFIRMATIONEMAILADDRESS is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='COLLECTION', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('COLLECTION') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'COLLECTION': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='COLLECTION') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='COLLECTION', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='COLLECTION'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='COLLECTION', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.COLLECTIONADDRESS is not None: namespaceprefix_ = self.COLLECTIONADDRESS_nsprefix_ + ':' if (UseCapturedNS_ and self.COLLECTIONADDRESS_nsprefix_) else '' self.COLLECTIONADDRESS.export(outfile, level, namespaceprefix_, namespacedef_='', name_='COLLECTIONADDRESS', pretty_print=pretty_print) if self.SHIPDATE is not None: namespaceprefix_ = self.SHIPDATE_nsprefix_ + ':' if (UseCapturedNS_ and self.SHIPDATE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSHIPDATE>%s</%sSHIPDATE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SHIPDATE), input_name='SHIPDATE')), namespaceprefix_ , eol_)) if self.PREFCOLLECTTIME is not None: namespaceprefix_ = self.PREFCOLLECTTIME_nsprefix_ + ':' if (UseCapturedNS_ and self.PREFCOLLECTTIME_nsprefix_) else '' self.PREFCOLLECTTIME.export(outfile, level, namespaceprefix_, namespacedef_='', name_='PREFCOLLECTTIME', pretty_print=pretty_print) if self.ALTCOLLECTTIME is not None: namespaceprefix_ = self.ALTCOLLECTTIME_nsprefix_ + ':' if (UseCapturedNS_ and self.ALTCOLLECTTIME_nsprefix_) else '' self.ALTCOLLECTTIME.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ALTCOLLECTTIME', pretty_print=pretty_print) if self.COLLINSTRUCTIONS is not None: namespaceprefix_ = self.COLLINSTRUCTIONS_nsprefix_ + ':' if (UseCapturedNS_ and self.COLLINSTRUCTIONS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOLLINSTRUCTIONS>%s</%sCOLLINSTRUCTIONS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COLLINSTRUCTIONS), input_name='COLLINSTRUCTIONS')), namespaceprefix_ , eol_)) if self.CONFIRMATIONEMAILADDRESS is not None: namespaceprefix_ = self.CONFIRMATIONEMAILADDRESS_nsprefix_ + ':' if (UseCapturedNS_ and self.CONFIRMATIONEMAILADDRESS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONFIRMATIONEMAILADDRESS>%s</%sCONFIRMATIONEMAILADDRESS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONFIRMATIONEMAILADDRESS), input_name='CONFIRMATIONEMAILADDRESS')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'COLLECTIONADDRESS': obj_ = COLLECTIONADDRESS.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.COLLECTIONADDRESS = obj_ obj_.original_tagname_ = 'COLLECTIONADDRESS' elif nodeName_ == 'SHIPDATE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'SHIPDATE') value_ = self.gds_validate_string(value_, node, 'SHIPDATE') self.SHIPDATE = value_ self.SHIPDATE_nsprefix_ = child_.prefix elif nodeName_ == 'PREFCOLLECTTIME': obj_ = PREFCOLLECTTIME.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.PREFCOLLECTTIME = obj_ obj_.original_tagname_ = 'PREFCOLLECTTIME' elif nodeName_ == 'ALTCOLLECTTIME': obj_ = ALTCOLLECTTIME.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.ALTCOLLECTTIME = obj_ obj_.original_tagname_ = 'ALTCOLLECTTIME' elif nodeName_ == 'COLLINSTRUCTIONS': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COLLINSTRUCTIONS') value_ = self.gds_validate_string(value_, node, 'COLLINSTRUCTIONS') self.COLLINSTRUCTIONS = value_ self.COLLINSTRUCTIONS_nsprefix_ = child_.prefix elif nodeName_ == 'CONFIRMATIONEMAILADDRESS': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONFIRMATIONEMAILADDRESS') value_ = self.gds_validate_string(value_, node, 'CONFIRMATIONEMAILADDRESS') self.CONFIRMATIONEMAILADDRESS = value_ self.CONFIRMATIONEMAILADDRESS_nsprefix_ = child_.prefix # end class COLLECTION class COLLECTIONADDRESS(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, COMPANYNAME=None, STREETADDRESS1=None, STREETADDRESS2=None, STREETADDRESS3=None, CITY=None, PROVINCE=None, POSTCODE=None, COUNTRY=None, VAT=None, CONTACTNAME=None, CONTACTDIALCODE=None, CONTACTTELEPHONE=None, CONTACTEMAIL=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.COMPANYNAME = COMPANYNAME self.COMPANYNAME_nsprefix_ = None self.STREETADDRESS1 = STREETADDRESS1 self.STREETADDRESS1_nsprefix_ = None self.STREETADDRESS2 = STREETADDRESS2 self.STREETADDRESS2_nsprefix_ = None self.STREETADDRESS3 = STREETADDRESS3 self.STREETADDRESS3_nsprefix_ = None self.CITY = CITY self.CITY_nsprefix_ = None self.PROVINCE = PROVINCE self.PROVINCE_nsprefix_ = None self.POSTCODE = POSTCODE self.POSTCODE_nsprefix_ = None self.COUNTRY = COUNTRY self.COUNTRY_nsprefix_ = None self.VAT = VAT self.VAT_nsprefix_ = None self.CONTACTNAME = CONTACTNAME self.CONTACTNAME_nsprefix_ = None self.CONTACTDIALCODE = CONTACTDIALCODE self.CONTACTDIALCODE_nsprefix_ = None self.CONTACTTELEPHONE = CONTACTTELEPHONE self.CONTACTTELEPHONE_nsprefix_ = None self.CONTACTEMAIL = CONTACTEMAIL self.CONTACTEMAIL_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COLLECTIONADDRESS) if subclass is not None: return subclass(*args_, **kwargs_) if COLLECTIONADDRESS.subclass: return COLLECTIONADDRESS.subclass(*args_, **kwargs_) else: return COLLECTIONADDRESS(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_COMPANYNAME(self): return self.COMPANYNAME def set_COMPANYNAME(self, COMPANYNAME): self.COMPANYNAME = COMPANYNAME def get_STREETADDRESS1(self): return self.STREETADDRESS1 def set_STREETADDRESS1(self, STREETADDRESS1): self.STREETADDRESS1 = STREETADDRESS1 def get_STREETADDRESS2(self): return self.STREETADDRESS2 def set_STREETADDRESS2(self, STREETADDRESS2): self.STREETADDRESS2 = STREETADDRESS2 def get_STREETADDRESS3(self): return self.STREETADDRESS3 def set_STREETADDRESS3(self, STREETADDRESS3): self.STREETADDRESS3 = STREETADDRESS3 def get_CITY(self): return self.CITY def set_CITY(self, CITY): self.CITY = CITY def get_PROVINCE(self): return self.PROVINCE def set_PROVINCE(self, PROVINCE): self.PROVINCE = PROVINCE def get_POSTCODE(self): return self.POSTCODE def set_POSTCODE(self, POSTCODE): self.POSTCODE = POSTCODE def get_COUNTRY(self): return self.COUNTRY def set_COUNTRY(self, COUNTRY): self.COUNTRY = COUNTRY def get_VAT(self): return self.VAT def set_VAT(self, VAT): self.VAT = VAT def get_CONTACTNAME(self): return self.CONTACTNAME def set_CONTACTNAME(self, CONTACTNAME): self.CONTACTNAME = CONTACTNAME def get_CONTACTDIALCODE(self): return self.CONTACTDIALCODE def set_CONTACTDIALCODE(self, CONTACTDIALCODE): self.CONTACTDIALCODE = CONTACTDIALCODE def get_CONTACTTELEPHONE(self): return self.CONTACTTELEPHONE def set_CONTACTTELEPHONE(self, CONTACTTELEPHONE): self.CONTACTTELEPHONE = CONTACTTELEPHONE def get_CONTACTEMAIL(self): return self.CONTACTEMAIL def set_CONTACTEMAIL(self, CONTACTEMAIL): self.CONTACTEMAIL = CONTACTEMAIL def hasContent_(self): if ( self.COMPANYNAME is not None or self.STREETADDRESS1 is not None or self.STREETADDRESS2 is not None or self.STREETADDRESS3 is not None or self.CITY is not None or self.PROVINCE is not None or self.POSTCODE is not None or self.COUNTRY is not None or self.VAT is not None or self.CONTACTNAME is not None or self.CONTACTDIALCODE is not None or self.CONTACTTELEPHONE is not None or self.CONTACTEMAIL is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='COLLECTIONADDRESS', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('COLLECTIONADDRESS') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'COLLECTIONADDRESS': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='COLLECTIONADDRESS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='COLLECTIONADDRESS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='COLLECTIONADDRESS'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='COLLECTIONADDRESS', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.COMPANYNAME is not None: namespaceprefix_ = self.COMPANYNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.COMPANYNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOMPANYNAME>%s</%sCOMPANYNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COMPANYNAME), input_name='COMPANYNAME')), namespaceprefix_ , eol_)) if self.STREETADDRESS1 is not None: namespaceprefix_ = self.STREETADDRESS1_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS1_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS1>%s</%sSTREETADDRESS1>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS1), input_name='STREETADDRESS1')), namespaceprefix_ , eol_)) if self.STREETADDRESS2 is not None: namespaceprefix_ = self.STREETADDRESS2_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS2_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS2>%s</%sSTREETADDRESS2>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS2), input_name='STREETADDRESS2')), namespaceprefix_ , eol_)) if self.STREETADDRESS3 is not None: namespaceprefix_ = self.STREETADDRESS3_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS3_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS3>%s</%sSTREETADDRESS3>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS3), input_name='STREETADDRESS3')), namespaceprefix_ , eol_)) if self.CITY is not None: namespaceprefix_ = self.CITY_nsprefix_ + ':' if (UseCapturedNS_ and self.CITY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCITY>%s</%sCITY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CITY), input_name='CITY')), namespaceprefix_ , eol_)) if self.PROVINCE is not None: namespaceprefix_ = self.PROVINCE_nsprefix_ + ':' if (UseCapturedNS_ and self.PROVINCE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPROVINCE>%s</%sPROVINCE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PROVINCE), input_name='PROVINCE')), namespaceprefix_ , eol_)) if self.POSTCODE is not None: namespaceprefix_ = self.POSTCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.POSTCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPOSTCODE>%s</%sPOSTCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.POSTCODE), input_name='POSTCODE')), namespaceprefix_ , eol_)) if self.COUNTRY is not None: namespaceprefix_ = self.COUNTRY_nsprefix_ + ':' if (UseCapturedNS_ and self.COUNTRY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOUNTRY>%s</%sCOUNTRY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COUNTRY), input_name='COUNTRY')), namespaceprefix_ , eol_)) if self.VAT is not None: namespaceprefix_ = self.VAT_nsprefix_ + ':' if (UseCapturedNS_ and self.VAT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sVAT>%s</%sVAT>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.VAT), input_name='VAT')), namespaceprefix_ , eol_)) if self.CONTACTNAME is not None: namespaceprefix_ = self.CONTACTNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTNAME>%s</%sCONTACTNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTNAME), input_name='CONTACTNAME')), namespaceprefix_ , eol_)) if self.CONTACTDIALCODE is not None: namespaceprefix_ = self.CONTACTDIALCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTDIALCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTDIALCODE>%s</%sCONTACTDIALCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTDIALCODE), input_name='CONTACTDIALCODE')), namespaceprefix_ , eol_)) if self.CONTACTTELEPHONE is not None: namespaceprefix_ = self.CONTACTTELEPHONE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTTELEPHONE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTTELEPHONE>%s</%sCONTACTTELEPHONE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTTELEPHONE), input_name='CONTACTTELEPHONE')), namespaceprefix_ , eol_)) if self.CONTACTEMAIL is not None: namespaceprefix_ = self.CONTACTEMAIL_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTEMAIL_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTEMAIL>%s</%sCONTACTEMAIL>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTEMAIL), input_name='CONTACTEMAIL')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'COMPANYNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COMPANYNAME') value_ = self.gds_validate_string(value_, node, 'COMPANYNAME') self.COMPANYNAME = value_ self.COMPANYNAME_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS1': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS1') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS1') self.STREETADDRESS1 = value_ self.STREETADDRESS1_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS2': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS2') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS2') self.STREETADDRESS2 = value_ self.STREETADDRESS2_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS3': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS3') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS3') self.STREETADDRESS3 = value_ self.STREETADDRESS3_nsprefix_ = child_.prefix elif nodeName_ == 'CITY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CITY') value_ = self.gds_validate_string(value_, node, 'CITY') self.CITY = value_ self.CITY_nsprefix_ = child_.prefix elif nodeName_ == 'PROVINCE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PROVINCE') value_ = self.gds_validate_string(value_, node, 'PROVINCE') self.PROVINCE = value_ self.PROVINCE_nsprefix_ = child_.prefix elif nodeName_ == 'POSTCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'POSTCODE') value_ = self.gds_validate_string(value_, node, 'POSTCODE') self.POSTCODE = value_ self.POSTCODE_nsprefix_ = child_.prefix elif nodeName_ == 'COUNTRY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COUNTRY') value_ = self.gds_validate_string(value_, node, 'COUNTRY') self.COUNTRY = value_ self.COUNTRY_nsprefix_ = child_.prefix elif nodeName_ == 'VAT': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'VAT') value_ = self.gds_validate_string(value_, node, 'VAT') self.VAT = value_ self.VAT_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTNAME') value_ = self.gds_validate_string(value_, node, 'CONTACTNAME') self.CONTACTNAME = value_ self.CONTACTNAME_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTDIALCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTDIALCODE') value_ = self.gds_validate_string(value_, node, 'CONTACTDIALCODE') self.CONTACTDIALCODE = value_ self.CONTACTDIALCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTTELEPHONE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTTELEPHONE') value_ = self.gds_validate_string(value_, node, 'CONTACTTELEPHONE') self.CONTACTTELEPHONE = value_ self.CONTACTTELEPHONE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTEMAIL': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTEMAIL') value_ = self.gds_validate_string(value_, node, 'CONTACTEMAIL') self.CONTACTEMAIL = value_ self.CONTACTEMAIL_nsprefix_ = child_.prefix # end class COLLECTIONADDRESS class PREFCOLLECTTIME(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, FROM=None, TO=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.FROM = FROM self.FROM_nsprefix_ = None self.TO = TO self.TO_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PREFCOLLECTTIME) if subclass is not None: return subclass(*args_, **kwargs_) if PREFCOLLECTTIME.subclass: return PREFCOLLECTTIME.subclass(*args_, **kwargs_) else: return PREFCOLLECTTIME(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_FROM(self): return self.FROM def set_FROM(self, FROM): self.FROM = FROM def get_TO(self): return self.TO def set_TO(self, TO): self.TO = TO def hasContent_(self): if ( self.FROM is not None or self.TO is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PREFCOLLECTTIME', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('PREFCOLLECTTIME') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'PREFCOLLECTTIME': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PREFCOLLECTTIME') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PREFCOLLECTTIME', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='PREFCOLLECTTIME'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PREFCOLLECTTIME', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.FROM is not None: namespaceprefix_ = self.FROM_nsprefix_ + ':' if (UseCapturedNS_ and self.FROM_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sFROM>%s</%sFROM>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FROM), input_name='FROM')), namespaceprefix_ , eol_)) if self.TO is not None: namespaceprefix_ = self.TO_nsprefix_ + ':' if (UseCapturedNS_ and self.TO_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sTO>%s</%sTO>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TO), input_name='TO')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'FROM': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'FROM') value_ = self.gds_validate_string(value_, node, 'FROM') self.FROM = value_ self.FROM_nsprefix_ = child_.prefix elif nodeName_ == 'TO': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'TO') value_ = self.gds_validate_string(value_, node, 'TO') self.TO = value_ self.TO_nsprefix_ = child_.prefix # end class PREFCOLLECTTIME class ALTCOLLECTTIME(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, FROM=None, TO=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.FROM = FROM self.FROM_nsprefix_ = None self.TO = TO self.TO_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ALTCOLLECTTIME) if subclass is not None: return subclass(*args_, **kwargs_) if ALTCOLLECTTIME.subclass: return ALTCOLLECTTIME.subclass(*args_, **kwargs_) else: return ALTCOLLECTTIME(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_FROM(self): return self.FROM def set_FROM(self, FROM): self.FROM = FROM def get_TO(self): return self.TO def set_TO(self, TO): self.TO = TO def hasContent_(self): if ( self.FROM is not None or self.TO is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ALTCOLLECTTIME', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('ALTCOLLECTTIME') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'ALTCOLLECTTIME': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='ALTCOLLECTTIME') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='ALTCOLLECTTIME', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='ALTCOLLECTTIME'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ALTCOLLECTTIME', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.FROM is not None: namespaceprefix_ = self.FROM_nsprefix_ + ':' if (UseCapturedNS_ and self.FROM_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sFROM>%s</%sFROM>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FROM), input_name='FROM')), namespaceprefix_ , eol_)) if self.TO is not None: namespaceprefix_ = self.TO_nsprefix_ + ':' if (UseCapturedNS_ and self.TO_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sTO>%s</%sTO>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TO), input_name='TO')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'FROM': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'FROM') value_ = self.gds_validate_string(value_, node, 'FROM') self.FROM = value_ self.FROM_nsprefix_ = child_.prefix elif nodeName_ == 'TO': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'TO') value_ = self.gds_validate_string(value_, node, 'TO') self.TO = value_ self.TO_nsprefix_ = child_.prefix # end class ALTCOLLECTTIME class CONSIGNMENT(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, DETAILS=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.CONREF = CONREF self.CONREF_nsprefix_ = None self.DETAILS = DETAILS self.DETAILS_nsprefix_ = None self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CONSIGNMENT) if subclass is not None: return subclass(*args_, **kwargs_) if CONSIGNMENT.subclass: return CONSIGNMENT.subclass(*args_, **kwargs_) else: return CONSIGNMENT(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def get_DETAILS(self): return self.DETAILS def set_DETAILS(self, DETAILS): self.DETAILS = DETAILS def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def hasContent_(self): if ( self.CONREF is not None or self.DETAILS is not None or self.CONNUMBER is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CONSIGNMENT', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('CONSIGNMENT') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'CONSIGNMENT': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CONSIGNMENT') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CONSIGNMENT', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CONSIGNMENT'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CONSIGNMENT', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.CONREF is not None: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONREF), input_name='CONREF')), namespaceprefix_ , eol_)) if self.DETAILS is not None: namespaceprefix_ = self.DETAILS_nsprefix_ + ':' if (UseCapturedNS_ and self.DETAILS_nsprefix_) else '' self.DETAILS.export(outfile, level, namespaceprefix_, namespacedef_='', name_='DETAILS', pretty_print=pretty_print) if self.CONNUMBER is not None: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONNUMBER), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF = value_ self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'DETAILS': obj_ = DETAILS.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.DETAILS = obj_ obj_.original_tagname_ = 'DETAILS' elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER = value_ self.CONNUMBER_nsprefix_ = child_.prefix # end class CONSIGNMENT class DETAILS(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, RECEIVER=None, DELIVERY=None, CONNUMBER=None, CUSTOMERREF=None, CONTYPE=None, PAYMENTIND=None, ITEMS=None, TOTALWEIGHT=None, TOTALVOLUME=None, CURRENCY=None, GOODSVALUE=None, INSURANCEVALUE=None, INSURANCECURRENCY=None, DIVISION=None, SERVICE=None, OPTION=None, DESCRIPTION=None, DELIVERYINST=None, CUSTOMCONTROLIN=None, HAZARDOUS=None, UNNUMBER=None, PACKINGGROUP=None, PACKAGE=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.RECEIVER = RECEIVER self.RECEIVER_nsprefix_ = None self.DELIVERY = DELIVERY self.DELIVERY_nsprefix_ = None self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None self.CUSTOMERREF = CUSTOMERREF self.CUSTOMERREF_nsprefix_ = None self.CONTYPE = CONTYPE self.CONTYPE_nsprefix_ = None self.PAYMENTIND = PAYMENTIND self.PAYMENTIND_nsprefix_ = None self.ITEMS = ITEMS self.ITEMS_nsprefix_ = None self.TOTALWEIGHT = TOTALWEIGHT self.TOTALWEIGHT_nsprefix_ = None self.TOTALVOLUME = TOTALVOLUME self.TOTALVOLUME_nsprefix_ = None self.CURRENCY = CURRENCY self.CURRENCY_nsprefix_ = None self.GOODSVALUE = GOODSVALUE self.GOODSVALUE_nsprefix_ = None self.INSURANCEVALUE = INSURANCEVALUE self.INSURANCEVALUE_nsprefix_ = None self.INSURANCECURRENCY = INSURANCECURRENCY self.INSURANCECURRENCY_nsprefix_ = None self.DIVISION = DIVISION self.DIVISION_nsprefix_ = None self.SERVICE = SERVICE self.SERVICE_nsprefix_ = None if OPTION is None: self.OPTION = [] else: self.OPTION = OPTION self.OPTION_nsprefix_ = None self.DESCRIPTION = DESCRIPTION self.DESCRIPTION_nsprefix_ = None self.DELIVERYINST = DELIVERYINST self.DELIVERYINST_nsprefix_ = None self.CUSTOMCONTROLIN = CUSTOMCONTROLIN self.CUSTOMCONTROLIN_nsprefix_ = None self.HAZARDOUS = HAZARDOUS self.HAZARDOUS_nsprefix_ = None self.UNNUMBER = UNNUMBER self.UNNUMBER_nsprefix_ = None self.PACKINGGROUP = PACKINGGROUP self.PACKINGGROUP_nsprefix_ = None if PACKAGE is None: self.PACKAGE = [] else: self.PACKAGE = PACKAGE self.PACKAGE_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, DETAILS) if subclass is not None: return subclass(*args_, **kwargs_) if DETAILS.subclass: return DETAILS.subclass(*args_, **kwargs_) else: return DETAILS(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_RECEIVER(self): return self.RECEIVER def set_RECEIVER(self, RECEIVER): self.RECEIVER = RECEIVER def get_DELIVERY(self): return self.DELIVERY def set_DELIVERY(self, DELIVERY): self.DELIVERY = DELIVERY def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def get_CUSTOMERREF(self): return self.CUSTOMERREF def set_CUSTOMERREF(self, CUSTOMERREF): self.CUSTOMERREF = CUSTOMERREF def get_CONTYPE(self): return self.CONTYPE def set_CONTYPE(self, CONTYPE): self.CONTYPE = CONTYPE def get_PAYMENTIND(self): return self.PAYMENTIND def set_PAYMENTIND(self, PAYMENTIND): self.PAYMENTIND = PAYMENTIND def get_ITEMS(self): return self.ITEMS def set_ITEMS(self, ITEMS): self.ITEMS = ITEMS def get_TOTALWEIGHT(self): return self.TOTALWEIGHT def set_TOTALWEIGHT(self, TOTALWEIGHT): self.TOTALWEIGHT = TOTALWEIGHT def get_TOTALVOLUME(self): return self.TOTALVOLUME def set_TOTALVOLUME(self, TOTALVOLUME): self.TOTALVOLUME = TOTALVOLUME def get_CURRENCY(self): return self.CURRENCY def set_CURRENCY(self, CURRENCY): self.CURRENCY = CURRENCY def get_GOODSVALUE(self): return self.GOODSVALUE def set_GOODSVALUE(self, GOODSVALUE): self.GOODSVALUE = GOODSVALUE def get_INSURANCEVALUE(self): return self.INSURANCEVALUE def set_INSURANCEVALUE(self, INSURANCEVALUE): self.INSURANCEVALUE = INSURANCEVALUE def get_INSURANCECURRENCY(self): return self.INSURANCECURRENCY def set_INSURANCECURRENCY(self, INSURANCECURRENCY): self.INSURANCECURRENCY = INSURANCECURRENCY def get_DIVISION(self): return self.DIVISION def set_DIVISION(self, DIVISION): self.DIVISION = DIVISION def get_SERVICE(self): return self.SERVICE def set_SERVICE(self, SERVICE): self.SERVICE = SERVICE def get_OPTION(self): return self.OPTION def set_OPTION(self, OPTION): self.OPTION = OPTION def add_OPTION(self, value): self.OPTION.append(value) def insert_OPTION_at(self, index, value): self.OPTION.insert(index, value) def replace_OPTION_at(self, index, value): self.OPTION[index] = value def get_DESCRIPTION(self): return self.DESCRIPTION def set_DESCRIPTION(self, DESCRIPTION): self.DESCRIPTION = DESCRIPTION def get_DELIVERYINST(self): return self.DELIVERYINST def set_DELIVERYINST(self, DELIVERYINST): self.DELIVERYINST = DELIVERYINST def get_CUSTOMCONTROLIN(self): return self.CUSTOMCONTROLIN def set_CUSTOMCONTROLIN(self, CUSTOMCONTROLIN): self.CUSTOMCONTROLIN = CUSTOMCONTROLIN def get_HAZARDOUS(self): return self.HAZARDOUS def set_HAZARDOUS(self, HAZARDOUS): self.HAZARDOUS = HAZARDOUS def get_UNNUMBER(self): return self.UNNUMBER def set_UNNUMBER(self, UNNUMBER): self.UNNUMBER = UNNUMBER def get_PACKINGGROUP(self): return self.PACKINGGROUP def set_PACKINGGROUP(self, PACKINGGROUP): self.PACKINGGROUP = PACKINGGROUP def get_PACKAGE(self): return self.PACKAGE def set_PACKAGE(self, PACKAGE): self.PACKAGE = PACKAGE def add_PACKAGE(self, value): self.PACKAGE.append(value) def insert_PACKAGE_at(self, index, value): self.PACKAGE.insert(index, value) def replace_PACKAGE_at(self, index, value): self.PACKAGE[index] = value def hasContent_(self): if ( self.RECEIVER is not None or self.DELIVERY is not None or self.CONNUMBER is not None or self.CUSTOMERREF is not None or self.CONTYPE is not None or self.PAYMENTIND is not None or self.ITEMS is not None or self.TOTALWEIGHT is not None or self.TOTALVOLUME is not None or self.CURRENCY is not None or self.GOODSVALUE is not None or self.INSURANCEVALUE is not None or self.INSURANCECURRENCY is not None or self.DIVISION is not None or self.SERVICE is not None or self.OPTION or self.DESCRIPTION is not None or self.DELIVERYINST is not None or self.CUSTOMCONTROLIN is not None or self.HAZARDOUS is not None or self.UNNUMBER is not None or self.PACKINGGROUP is not None or self.PACKAGE ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DETAILS', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('DETAILS') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'DETAILS': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DETAILS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DETAILS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='DETAILS'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DETAILS', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.RECEIVER is not None: namespaceprefix_ = self.RECEIVER_nsprefix_ + ':' if (UseCapturedNS_ and self.RECEIVER_nsprefix_) else '' self.RECEIVER.export(outfile, level, namespaceprefix_, namespacedef_='', name_='RECEIVER', pretty_print=pretty_print) if self.DELIVERY is not None: namespaceprefix_ = self.DELIVERY_nsprefix_ + ':' if (UseCapturedNS_ and self.DELIVERY_nsprefix_) else '' self.DELIVERY.export(outfile, level, namespaceprefix_, namespacedef_='', name_='DELIVERY', pretty_print=pretty_print) if self.CONNUMBER is not None: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONNUMBER), input_name='CONNUMBER')), namespaceprefix_ , eol_)) if self.CUSTOMERREF is not None: namespaceprefix_ = self.CUSTOMERREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CUSTOMERREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCUSTOMERREF>%s</%sCUSTOMERREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CUSTOMERREF), input_name='CUSTOMERREF')), namespaceprefix_ , eol_)) if self.CONTYPE is not None: namespaceprefix_ = self.CONTYPE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTYPE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTYPE>%s</%sCONTYPE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTYPE), input_name='CONTYPE')), namespaceprefix_ , eol_)) if self.PAYMENTIND is not None: namespaceprefix_ = self.PAYMENTIND_nsprefix_ + ':' if (UseCapturedNS_ and self.PAYMENTIND_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPAYMENTIND>%s</%sPAYMENTIND>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PAYMENTIND), input_name='PAYMENTIND')), namespaceprefix_ , eol_)) if self.ITEMS is not None: namespaceprefix_ = self.ITEMS_nsprefix_ + ':' if (UseCapturedNS_ and self.ITEMS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sITEMS>%s</%sITEMS>%s' % (namespaceprefix_ , self.gds_format_integer(self.ITEMS, input_name='ITEMS'), namespaceprefix_ , eol_)) if self.TOTALWEIGHT is not None: namespaceprefix_ = self.TOTALWEIGHT_nsprefix_ + ':' if (UseCapturedNS_ and self.TOTALWEIGHT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sTOTALWEIGHT>%s</%sTOTALWEIGHT>%s' % (namespaceprefix_ , self.gds_format_decimal(self.TOTALWEIGHT, input_name='TOTALWEIGHT'), namespaceprefix_ , eol_)) if self.TOTALVOLUME is not None: namespaceprefix_ = self.TOTALVOLUME_nsprefix_ + ':' if (UseCapturedNS_ and self.TOTALVOLUME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sTOTALVOLUME>%s</%sTOTALVOLUME>%s' % (namespaceprefix_ , self.gds_format_decimal(self.TOTALVOLUME, input_name='TOTALVOLUME'), namespaceprefix_ , eol_)) if self.CURRENCY is not None: namespaceprefix_ = self.CURRENCY_nsprefix_ + ':' if (UseCapturedNS_ and self.CURRENCY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCURRENCY>%s</%sCURRENCY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CURRENCY), input_name='CURRENCY')), namespaceprefix_ , eol_)) if self.GOODSVALUE is not None: namespaceprefix_ = self.GOODSVALUE_nsprefix_ + ':' if (UseCapturedNS_ and self.GOODSVALUE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sGOODSVALUE>%s</%sGOODSVALUE>%s' % (namespaceprefix_ , self.gds_format_decimal(self.GOODSVALUE, input_name='GOODSVALUE'), namespaceprefix_ , eol_)) if self.INSURANCEVALUE is not None: namespaceprefix_ = self.INSURANCEVALUE_nsprefix_ + ':' if (UseCapturedNS_ and self.INSURANCEVALUE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sINSURANCEVALUE>%s</%sINSURANCEVALUE>%s' % (namespaceprefix_ , self.gds_format_decimal(self.INSURANCEVALUE, input_name='INSURANCEVALUE'), namespaceprefix_ , eol_)) if self.INSURANCECURRENCY is not None: namespaceprefix_ = self.INSURANCECURRENCY_nsprefix_ + ':' if (UseCapturedNS_ and self.INSURANCECURRENCY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sINSURANCECURRENCY>%s</%sINSURANCECURRENCY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.INSURANCECURRENCY), input_name='INSURANCECURRENCY')), namespaceprefix_ , eol_)) if self.DIVISION is not None: namespaceprefix_ = self.DIVISION_nsprefix_ + ':' if (UseCapturedNS_ and self.DIVISION_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sDIVISION>%s</%sDIVISION>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DIVISION), input_name='DIVISION')), namespaceprefix_ , eol_)) if self.SERVICE is not None: namespaceprefix_ = self.SERVICE_nsprefix_ + ':' if (UseCapturedNS_ and self.SERVICE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSERVICE>%s</%sSERVICE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SERVICE), input_name='SERVICE')), namespaceprefix_ , eol_)) for OPTION_ in self.OPTION: namespaceprefix_ = self.OPTION_nsprefix_ + ':' if (UseCapturedNS_ and self.OPTION_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sOPTION>%s</%sOPTION>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(OPTION_), input_name='OPTION')), namespaceprefix_ , eol_)) if self.DESCRIPTION is not None: namespaceprefix_ = self.DESCRIPTION_nsprefix_ + ':' if (UseCapturedNS_ and self.DESCRIPTION_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sDESCRIPTION>%s</%sDESCRIPTION>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DESCRIPTION), input_name='DESCRIPTION')), namespaceprefix_ , eol_)) if self.DELIVERYINST is not None: namespaceprefix_ = self.DELIVERYINST_nsprefix_ + ':' if (UseCapturedNS_ and self.DELIVERYINST_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sDELIVERYINST>%s</%sDELIVERYINST>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DELIVERYINST), input_name='DELIVERYINST')), namespaceprefix_ , eol_)) if self.CUSTOMCONTROLIN is not None: namespaceprefix_ = self.CUSTOMCONTROLIN_nsprefix_ + ':' if (UseCapturedNS_ and self.CUSTOMCONTROLIN_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCUSTOMCONTROLIN>%s</%sCUSTOMCONTROLIN>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CUSTOMCONTROLIN), input_name='CUSTOMCONTROLIN')), namespaceprefix_ , eol_)) if self.HAZARDOUS is not None: namespaceprefix_ = self.HAZARDOUS_nsprefix_ + ':' if (UseCapturedNS_ and self.HAZARDOUS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sHAZARDOUS>%s</%sHAZARDOUS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.HAZARDOUS), input_name='HAZARDOUS')), namespaceprefix_ , eol_)) if self.UNNUMBER is not None: namespaceprefix_ = self.UNNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.UNNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sUNNUMBER>%s</%sUNNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UNNUMBER), input_name='UNNUMBER')), namespaceprefix_ , eol_)) if self.PACKINGGROUP is not None: namespaceprefix_ = self.PACKINGGROUP_nsprefix_ + ':' if (UseCapturedNS_ and self.PACKINGGROUP_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPACKINGGROUP>%s</%sPACKINGGROUP>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PACKINGGROUP), input_name='PACKINGGROUP')), namespaceprefix_ , eol_)) for PACKAGE_ in self.PACKAGE: namespaceprefix_ = self.PACKAGE_nsprefix_ + ':' if (UseCapturedNS_ and self.PACKAGE_nsprefix_) else '' PACKAGE_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='PACKAGE', pretty_print=pretty_print) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'RECEIVER': obj_ = RECEIVER.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.RECEIVER = obj_ obj_.original_tagname_ = 'RECEIVER' elif nodeName_ == 'DELIVERY': obj_ = DELIVERY.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.DELIVERY = obj_ obj_.original_tagname_ = 'DELIVERY' elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER = value_ self.CONNUMBER_nsprefix_ = child_.prefix elif nodeName_ == 'CUSTOMERREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CUSTOMERREF') value_ = self.gds_validate_string(value_, node, 'CUSTOMERREF') self.CUSTOMERREF = value_ self.CUSTOMERREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONTYPE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTYPE') value_ = self.gds_validate_string(value_, node, 'CONTYPE') self.CONTYPE = value_ self.CONTYPE_nsprefix_ = child_.prefix elif nodeName_ == 'PAYMENTIND': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PAYMENTIND') value_ = self.gds_validate_string(value_, node, 'PAYMENTIND') self.PAYMENTIND = value_ self.PAYMENTIND_nsprefix_ = child_.prefix elif nodeName_ == 'ITEMS' and child_.text: sval_ = child_.text ival_ = self.gds_parse_integer(sval_, node, 'ITEMS') ival_ = self.gds_validate_integer(ival_, node, 'ITEMS') self.ITEMS = ival_ self.ITEMS_nsprefix_ = child_.prefix elif nodeName_ == 'TOTALWEIGHT' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'TOTALWEIGHT') fval_ = self.gds_validate_decimal(fval_, node, 'TOTALWEIGHT') self.TOTALWEIGHT = fval_ self.TOTALWEIGHT_nsprefix_ = child_.prefix elif nodeName_ == 'TOTALVOLUME' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'TOTALVOLUME') fval_ = self.gds_validate_decimal(fval_, node, 'TOTALVOLUME') self.TOTALVOLUME = fval_ self.TOTALVOLUME_nsprefix_ = child_.prefix elif nodeName_ == 'CURRENCY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CURRENCY') value_ = self.gds_validate_string(value_, node, 'CURRENCY') self.CURRENCY = value_ self.CURRENCY_nsprefix_ = child_.prefix elif nodeName_ == 'GOODSVALUE' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'GOODSVALUE') fval_ = self.gds_validate_decimal(fval_, node, 'GOODSVALUE') self.GOODSVALUE = fval_ self.GOODSVALUE_nsprefix_ = child_.prefix elif nodeName_ == 'INSURANCEVALUE' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'INSURANCEVALUE') fval_ = self.gds_validate_decimal(fval_, node, 'INSURANCEVALUE') self.INSURANCEVALUE = fval_ self.INSURANCEVALUE_nsprefix_ = child_.prefix elif nodeName_ == 'INSURANCECURRENCY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'INSURANCECURRENCY') value_ = self.gds_validate_string(value_, node, 'INSURANCECURRENCY') self.INSURANCECURRENCY = value_ self.INSURANCECURRENCY_nsprefix_ = child_.prefix elif nodeName_ == 'DIVISION': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'DIVISION') value_ = self.gds_validate_string(value_, node, 'DIVISION') self.DIVISION = value_ self.DIVISION_nsprefix_ = child_.prefix elif nodeName_ == 'SERVICE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'SERVICE') value_ = self.gds_validate_string(value_, node, 'SERVICE') self.SERVICE = value_ self.SERVICE_nsprefix_ = child_.prefix elif nodeName_ == 'OPTION': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'OPTION') value_ = self.gds_validate_string(value_, node, 'OPTION') self.OPTION.append(value_) self.OPTION_nsprefix_ = child_.prefix elif nodeName_ == 'DESCRIPTION': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'DESCRIPTION') value_ = self.gds_validate_string(value_, node, 'DESCRIPTION') self.DESCRIPTION = value_ self.DESCRIPTION_nsprefix_ = child_.prefix elif nodeName_ == 'DELIVERYINST': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'DELIVERYINST') value_ = self.gds_validate_string(value_, node, 'DELIVERYINST') self.DELIVERYINST = value_ self.DELIVERYINST_nsprefix_ = child_.prefix elif nodeName_ == 'CUSTOMCONTROLIN': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CUSTOMCONTROLIN') value_ = self.gds_validate_string(value_, node, 'CUSTOMCONTROLIN') self.CUSTOMCONTROLIN = value_ self.CUSTOMCONTROLIN_nsprefix_ = child_.prefix elif nodeName_ == 'HAZARDOUS': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'HAZARDOUS') value_ = self.gds_validate_string(value_, node, 'HAZARDOUS') self.HAZARDOUS = value_ self.HAZARDOUS_nsprefix_ = child_.prefix elif nodeName_ == 'UNNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'UNNUMBER') value_ = self.gds_validate_string(value_, node, 'UNNUMBER') self.UNNUMBER = value_ self.UNNUMBER_nsprefix_ = child_.prefix elif nodeName_ == 'PACKINGGROUP': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PACKINGGROUP') value_ = self.gds_validate_string(value_, node, 'PACKINGGROUP') self.PACKINGGROUP = value_ self.PACKINGGROUP_nsprefix_ = child_.prefix elif nodeName_ == 'PACKAGE': obj_ = PACKAGE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.PACKAGE.append(obj_) obj_.original_tagname_ = 'PACKAGE' # end class DETAILS class RECEIVER(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, COMPANYNAME=None, STREETADDRESS1=None, STREETADDRESS2=None, STREETADDRESS3=None, CITY=None, PROVINCE=None, POSTCODE=None, COUNTRY=None, VAT=None, CONTACTNAME=None, CONTACTDIALCODE=None, CONTACTTELEPHONE=None, CONTACTEMAIL=None, ACCOUNT=None, ACCOUNTCOUNTRY=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.COMPANYNAME = COMPANYNAME self.COMPANYNAME_nsprefix_ = None self.STREETADDRESS1 = STREETADDRESS1 self.STREETADDRESS1_nsprefix_ = None self.STREETADDRESS2 = STREETADDRESS2 self.STREETADDRESS2_nsprefix_ = None self.STREETADDRESS3 = STREETADDRESS3 self.STREETADDRESS3_nsprefix_ = None self.CITY = CITY self.CITY_nsprefix_ = None self.PROVINCE = PROVINCE self.PROVINCE_nsprefix_ = None self.POSTCODE = POSTCODE self.POSTCODE_nsprefix_ = None self.COUNTRY = COUNTRY self.COUNTRY_nsprefix_ = None self.VAT = VAT self.VAT_nsprefix_ = None self.CONTACTNAME = CONTACTNAME self.CONTACTNAME_nsprefix_ = None self.CONTACTDIALCODE = CONTACTDIALCODE self.CONTACTDIALCODE_nsprefix_ = None self.CONTACTTELEPHONE = CONTACTTELEPHONE self.CONTACTTELEPHONE_nsprefix_ = None self.CONTACTEMAIL = CONTACTEMAIL self.CONTACTEMAIL_nsprefix_ = None self.ACCOUNT = ACCOUNT self.ACCOUNT_nsprefix_ = None self.ACCOUNTCOUNTRY = ACCOUNTCOUNTRY self.ACCOUNTCOUNTRY_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RECEIVER) if subclass is not None: return subclass(*args_, **kwargs_) if RECEIVER.subclass: return RECEIVER.subclass(*args_, **kwargs_) else: return RECEIVER(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_COMPANYNAME(self): return self.COMPANYNAME def set_COMPANYNAME(self, COMPANYNAME): self.COMPANYNAME = COMPANYNAME def get_STREETADDRESS1(self): return self.STREETADDRESS1 def set_STREETADDRESS1(self, STREETADDRESS1): self.STREETADDRESS1 = STREETADDRESS1 def get_STREETADDRESS2(self): return self.STREETADDRESS2 def set_STREETADDRESS2(self, STREETADDRESS2): self.STREETADDRESS2 = STREETADDRESS2 def get_STREETADDRESS3(self): return self.STREETADDRESS3 def set_STREETADDRESS3(self, STREETADDRESS3): self.STREETADDRESS3 = STREETADDRESS3 def get_CITY(self): return self.CITY def set_CITY(self, CITY): self.CITY = CITY def get_PROVINCE(self): return self.PROVINCE def set_PROVINCE(self, PROVINCE): self.PROVINCE = PROVINCE def get_POSTCODE(self): return self.POSTCODE def set_POSTCODE(self, POSTCODE): self.POSTCODE = POSTCODE def get_COUNTRY(self): return self.COUNTRY def set_COUNTRY(self, COUNTRY): self.COUNTRY = COUNTRY def get_VAT(self): return self.VAT def set_VAT(self, VAT): self.VAT = VAT def get_CONTACTNAME(self): return self.CONTACTNAME def set_CONTACTNAME(self, CONTACTNAME): self.CONTACTNAME = CONTACTNAME def get_CONTACTDIALCODE(self): return self.CONTACTDIALCODE def set_CONTACTDIALCODE(self, CONTACTDIALCODE): self.CONTACTDIALCODE = CONTACTDIALCODE def get_CONTACTTELEPHONE(self): return self.CONTACTTELEPHONE def set_CONTACTTELEPHONE(self, CONTACTTELEPHONE): self.CONTACTTELEPHONE = CONTACTTELEPHONE def get_CONTACTEMAIL(self): return self.CONTACTEMAIL def set_CONTACTEMAIL(self, CONTACTEMAIL): self.CONTACTEMAIL = CONTACTEMAIL def get_ACCOUNT(self): return self.ACCOUNT def set_ACCOUNT(self, ACCOUNT): self.ACCOUNT = ACCOUNT def get_ACCOUNTCOUNTRY(self): return self.ACCOUNTCOUNTRY def set_ACCOUNTCOUNTRY(self, ACCOUNTCOUNTRY): self.ACCOUNTCOUNTRY = ACCOUNTCOUNTRY def hasContent_(self): if ( self.COMPANYNAME is not None or self.STREETADDRESS1 is not None or self.STREETADDRESS2 is not None or self.STREETADDRESS3 is not None or self.CITY is not None or self.PROVINCE is not None or self.POSTCODE is not None or self.COUNTRY is not None or self.VAT is not None or self.CONTACTNAME is not None or self.CONTACTDIALCODE is not None or self.CONTACTTELEPHONE is not None or self.CONTACTEMAIL is not None or self.ACCOUNT is not None or self.ACCOUNTCOUNTRY is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RECEIVER', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('RECEIVER') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'RECEIVER': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='RECEIVER') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='RECEIVER', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RECEIVER'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RECEIVER', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.COMPANYNAME is not None: namespaceprefix_ = self.COMPANYNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.COMPANYNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOMPANYNAME>%s</%sCOMPANYNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COMPANYNAME), input_name='COMPANYNAME')), namespaceprefix_ , eol_)) if self.STREETADDRESS1 is not None: namespaceprefix_ = self.STREETADDRESS1_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS1_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS1>%s</%sSTREETADDRESS1>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS1), input_name='STREETADDRESS1')), namespaceprefix_ , eol_)) if self.STREETADDRESS2 is not None: namespaceprefix_ = self.STREETADDRESS2_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS2_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS2>%s</%sSTREETADDRESS2>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS2), input_name='STREETADDRESS2')), namespaceprefix_ , eol_)) if self.STREETADDRESS3 is not None: namespaceprefix_ = self.STREETADDRESS3_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS3_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS3>%s</%sSTREETADDRESS3>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS3), input_name='STREETADDRESS3')), namespaceprefix_ , eol_)) if self.CITY is not None: namespaceprefix_ = self.CITY_nsprefix_ + ':' if (UseCapturedNS_ and self.CITY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCITY>%s</%sCITY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CITY), input_name='CITY')), namespaceprefix_ , eol_)) if self.PROVINCE is not None: namespaceprefix_ = self.PROVINCE_nsprefix_ + ':' if (UseCapturedNS_ and self.PROVINCE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPROVINCE>%s</%sPROVINCE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PROVINCE), input_name='PROVINCE')), namespaceprefix_ , eol_)) if self.POSTCODE is not None: namespaceprefix_ = self.POSTCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.POSTCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPOSTCODE>%s</%sPOSTCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.POSTCODE), input_name='POSTCODE')), namespaceprefix_ , eol_)) if self.COUNTRY is not None: namespaceprefix_ = self.COUNTRY_nsprefix_ + ':' if (UseCapturedNS_ and self.COUNTRY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOUNTRY>%s</%sCOUNTRY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COUNTRY), input_name='COUNTRY')), namespaceprefix_ , eol_)) if self.VAT is not None: namespaceprefix_ = self.VAT_nsprefix_ + ':' if (UseCapturedNS_ and self.VAT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sVAT>%s</%sVAT>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.VAT), input_name='VAT')), namespaceprefix_ , eol_)) if self.CONTACTNAME is not None: namespaceprefix_ = self.CONTACTNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTNAME>%s</%sCONTACTNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTNAME), input_name='CONTACTNAME')), namespaceprefix_ , eol_)) if self.CONTACTDIALCODE is not None: namespaceprefix_ = self.CONTACTDIALCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTDIALCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTDIALCODE>%s</%sCONTACTDIALCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTDIALCODE), input_name='CONTACTDIALCODE')), namespaceprefix_ , eol_)) if self.CONTACTTELEPHONE is not None: namespaceprefix_ = self.CONTACTTELEPHONE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTTELEPHONE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTTELEPHONE>%s</%sCONTACTTELEPHONE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTTELEPHONE), input_name='CONTACTTELEPHONE')), namespaceprefix_ , eol_)) if self.CONTACTEMAIL is not None: namespaceprefix_ = self.CONTACTEMAIL_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTEMAIL_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTEMAIL>%s</%sCONTACTEMAIL>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTEMAIL), input_name='CONTACTEMAIL')), namespaceprefix_ , eol_)) if self.ACCOUNT is not None: namespaceprefix_ = self.ACCOUNT_nsprefix_ + ':' if (UseCapturedNS_ and self.ACCOUNT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sACCOUNT>%s</%sACCOUNT>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ACCOUNT), input_name='ACCOUNT')), namespaceprefix_ , eol_)) if self.ACCOUNTCOUNTRY is not None: namespaceprefix_ = self.ACCOUNTCOUNTRY_nsprefix_ + ':' if (UseCapturedNS_ and self.ACCOUNTCOUNTRY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sACCOUNTCOUNTRY>%s</%sACCOUNTCOUNTRY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ACCOUNTCOUNTRY), input_name='ACCOUNTCOUNTRY')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'COMPANYNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COMPANYNAME') value_ = self.gds_validate_string(value_, node, 'COMPANYNAME') self.COMPANYNAME = value_ self.COMPANYNAME_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS1': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS1') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS1') self.STREETADDRESS1 = value_ self.STREETADDRESS1_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS2': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS2') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS2') self.STREETADDRESS2 = value_ self.STREETADDRESS2_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS3': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS3') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS3') self.STREETADDRESS3 = value_ self.STREETADDRESS3_nsprefix_ = child_.prefix elif nodeName_ == 'CITY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CITY') value_ = self.gds_validate_string(value_, node, 'CITY') self.CITY = value_ self.CITY_nsprefix_ = child_.prefix elif nodeName_ == 'PROVINCE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PROVINCE') value_ = self.gds_validate_string(value_, node, 'PROVINCE') self.PROVINCE = value_ self.PROVINCE_nsprefix_ = child_.prefix elif nodeName_ == 'POSTCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'POSTCODE') value_ = self.gds_validate_string(value_, node, 'POSTCODE') self.POSTCODE = value_ self.POSTCODE_nsprefix_ = child_.prefix elif nodeName_ == 'COUNTRY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COUNTRY') value_ = self.gds_validate_string(value_, node, 'COUNTRY') self.COUNTRY = value_ self.COUNTRY_nsprefix_ = child_.prefix elif nodeName_ == 'VAT': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'VAT') value_ = self.gds_validate_string(value_, node, 'VAT') self.VAT = value_ self.VAT_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTNAME') value_ = self.gds_validate_string(value_, node, 'CONTACTNAME') self.CONTACTNAME = value_ self.CONTACTNAME_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTDIALCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTDIALCODE') value_ = self.gds_validate_string(value_, node, 'CONTACTDIALCODE') self.CONTACTDIALCODE = value_ self.CONTACTDIALCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTTELEPHONE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTTELEPHONE') value_ = self.gds_validate_string(value_, node, 'CONTACTTELEPHONE') self.CONTACTTELEPHONE = value_ self.CONTACTTELEPHONE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTEMAIL': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTEMAIL') value_ = self.gds_validate_string(value_, node, 'CONTACTEMAIL') self.CONTACTEMAIL = value_ self.CONTACTEMAIL_nsprefix_ = child_.prefix elif nodeName_ == 'ACCOUNT': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'ACCOUNT') value_ = self.gds_validate_string(value_, node, 'ACCOUNT') self.ACCOUNT = value_ self.ACCOUNT_nsprefix_ = child_.prefix elif nodeName_ == 'ACCOUNTCOUNTRY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'ACCOUNTCOUNTRY') value_ = self.gds_validate_string(value_, node, 'ACCOUNTCOUNTRY') self.ACCOUNTCOUNTRY = value_ self.ACCOUNTCOUNTRY_nsprefix_ = child_.prefix # end class RECEIVER class DELIVERY(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, COMPANYNAME=None, STREETADDRESS1=None, STREETADDRESS2=None, STREETADDRESS3=None, CITY=None, PROVINCE=None, POSTCODE=None, COUNTRY=None, VAT=None, CONTACTNAME=None, CONTACTDIALCODE=None, CONTACTTELEPHONE=None, CONTACTEMAIL=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.COMPANYNAME = COMPANYNAME self.COMPANYNAME_nsprefix_ = None self.STREETADDRESS1 = STREETADDRESS1 self.STREETADDRESS1_nsprefix_ = None self.STREETADDRESS2 = STREETADDRESS2 self.STREETADDRESS2_nsprefix_ = None self.STREETADDRESS3 = STREETADDRESS3 self.STREETADDRESS3_nsprefix_ = None self.CITY = CITY self.CITY_nsprefix_ = None self.PROVINCE = PROVINCE self.PROVINCE_nsprefix_ = None self.POSTCODE = POSTCODE self.POSTCODE_nsprefix_ = None self.COUNTRY = COUNTRY self.COUNTRY_nsprefix_ = None self.VAT = VAT self.VAT_nsprefix_ = None self.CONTACTNAME = CONTACTNAME self.CONTACTNAME_nsprefix_ = None self.CONTACTDIALCODE = CONTACTDIALCODE self.CONTACTDIALCODE_nsprefix_ = None self.CONTACTTELEPHONE = CONTACTTELEPHONE self.CONTACTTELEPHONE_nsprefix_ = None self.CONTACTEMAIL = CONTACTEMAIL self.CONTACTEMAIL_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, DELIVERY) if subclass is not None: return subclass(*args_, **kwargs_) if DELIVERY.subclass: return DELIVERY.subclass(*args_, **kwargs_) else: return DELIVERY(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_COMPANYNAME(self): return self.COMPANYNAME def set_COMPANYNAME(self, COMPANYNAME): self.COMPANYNAME = COMPANYNAME def get_STREETADDRESS1(self): return self.STREETADDRESS1 def set_STREETADDRESS1(self, STREETADDRESS1): self.STREETADDRESS1 = STREETADDRESS1 def get_STREETADDRESS2(self): return self.STREETADDRESS2 def set_STREETADDRESS2(self, STREETADDRESS2): self.STREETADDRESS2 = STREETADDRESS2 def get_STREETADDRESS3(self): return self.STREETADDRESS3 def set_STREETADDRESS3(self, STREETADDRESS3): self.STREETADDRESS3 = STREETADDRESS3 def get_CITY(self): return self.CITY def set_CITY(self, CITY): self.CITY = CITY def get_PROVINCE(self): return self.PROVINCE def set_PROVINCE(self, PROVINCE): self.PROVINCE = PROVINCE def get_POSTCODE(self): return self.POSTCODE def set_POSTCODE(self, POSTCODE): self.POSTCODE = POSTCODE def get_COUNTRY(self): return self.COUNTRY def set_COUNTRY(self, COUNTRY): self.COUNTRY = COUNTRY def get_VAT(self): return self.VAT def set_VAT(self, VAT): self.VAT = VAT def get_CONTACTNAME(self): return self.CONTACTNAME def set_CONTACTNAME(self, CONTACTNAME): self.CONTACTNAME = CONTACTNAME def get_CONTACTDIALCODE(self): return self.CONTACTDIALCODE def set_CONTACTDIALCODE(self, CONTACTDIALCODE): self.CONTACTDIALCODE = CONTACTDIALCODE def get_CONTACTTELEPHONE(self): return self.CONTACTTELEPHONE def set_CONTACTTELEPHONE(self, CONTACTTELEPHONE): self.CONTACTTELEPHONE = CONTACTTELEPHONE def get_CONTACTEMAIL(self): return self.CONTACTEMAIL def set_CONTACTEMAIL(self, CONTACTEMAIL): self.CONTACTEMAIL = CONTACTEMAIL def hasContent_(self): if ( self.COMPANYNAME is not None or self.STREETADDRESS1 is not None or self.STREETADDRESS2 is not None or self.STREETADDRESS3 is not None or self.CITY is not None or self.PROVINCE is not None or self.POSTCODE is not None or self.COUNTRY is not None or self.VAT is not None or self.CONTACTNAME is not None or self.CONTACTDIALCODE is not None or self.CONTACTTELEPHONE is not None or self.CONTACTEMAIL is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DELIVERY', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('DELIVERY') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'DELIVERY': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DELIVERY') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DELIVERY', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='DELIVERY'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DELIVERY', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.COMPANYNAME is not None: namespaceprefix_ = self.COMPANYNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.COMPANYNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOMPANYNAME>%s</%sCOMPANYNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COMPANYNAME), input_name='COMPANYNAME')), namespaceprefix_ , eol_)) if self.STREETADDRESS1 is not None: namespaceprefix_ = self.STREETADDRESS1_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS1_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS1>%s</%sSTREETADDRESS1>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS1), input_name='STREETADDRESS1')), namespaceprefix_ , eol_)) if self.STREETADDRESS2 is not None: namespaceprefix_ = self.STREETADDRESS2_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS2_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS2>%s</%sSTREETADDRESS2>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS2), input_name='STREETADDRESS2')), namespaceprefix_ , eol_)) if self.STREETADDRESS3 is not None: namespaceprefix_ = self.STREETADDRESS3_nsprefix_ + ':' if (UseCapturedNS_ and self.STREETADDRESS3_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sSTREETADDRESS3>%s</%sSTREETADDRESS3>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.STREETADDRESS3), input_name='STREETADDRESS3')), namespaceprefix_ , eol_)) if self.CITY is not None: namespaceprefix_ = self.CITY_nsprefix_ + ':' if (UseCapturedNS_ and self.CITY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCITY>%s</%sCITY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CITY), input_name='CITY')), namespaceprefix_ , eol_)) if self.PROVINCE is not None: namespaceprefix_ = self.PROVINCE_nsprefix_ + ':' if (UseCapturedNS_ and self.PROVINCE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPROVINCE>%s</%sPROVINCE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.PROVINCE), input_name='PROVINCE')), namespaceprefix_ , eol_)) if self.POSTCODE is not None: namespaceprefix_ = self.POSTCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.POSTCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sPOSTCODE>%s</%sPOSTCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.POSTCODE), input_name='POSTCODE')), namespaceprefix_ , eol_)) if self.COUNTRY is not None: namespaceprefix_ = self.COUNTRY_nsprefix_ + ':' if (UseCapturedNS_ and self.COUNTRY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOUNTRY>%s</%sCOUNTRY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COUNTRY), input_name='COUNTRY')), namespaceprefix_ , eol_)) if self.VAT is not None: namespaceprefix_ = self.VAT_nsprefix_ + ':' if (UseCapturedNS_ and self.VAT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sVAT>%s</%sVAT>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.VAT), input_name='VAT')), namespaceprefix_ , eol_)) if self.CONTACTNAME is not None: namespaceprefix_ = self.CONTACTNAME_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTNAME_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTNAME>%s</%sCONTACTNAME>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTNAME), input_name='CONTACTNAME')), namespaceprefix_ , eol_)) if self.CONTACTDIALCODE is not None: namespaceprefix_ = self.CONTACTDIALCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTDIALCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTDIALCODE>%s</%sCONTACTDIALCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTDIALCODE), input_name='CONTACTDIALCODE')), namespaceprefix_ , eol_)) if self.CONTACTTELEPHONE is not None: namespaceprefix_ = self.CONTACTTELEPHONE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTTELEPHONE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTTELEPHONE>%s</%sCONTACTTELEPHONE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTTELEPHONE), input_name='CONTACTTELEPHONE')), namespaceprefix_ , eol_)) if self.CONTACTEMAIL is not None: namespaceprefix_ = self.CONTACTEMAIL_nsprefix_ + ':' if (UseCapturedNS_ and self.CONTACTEMAIL_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONTACTEMAIL>%s</%sCONTACTEMAIL>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CONTACTEMAIL), input_name='CONTACTEMAIL')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'COMPANYNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COMPANYNAME') value_ = self.gds_validate_string(value_, node, 'COMPANYNAME') self.COMPANYNAME = value_ self.COMPANYNAME_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS1': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS1') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS1') self.STREETADDRESS1 = value_ self.STREETADDRESS1_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS2': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS2') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS2') self.STREETADDRESS2 = value_ self.STREETADDRESS2_nsprefix_ = child_.prefix elif nodeName_ == 'STREETADDRESS3': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'STREETADDRESS3') value_ = self.gds_validate_string(value_, node, 'STREETADDRESS3') self.STREETADDRESS3 = value_ self.STREETADDRESS3_nsprefix_ = child_.prefix elif nodeName_ == 'CITY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CITY') value_ = self.gds_validate_string(value_, node, 'CITY') self.CITY = value_ self.CITY_nsprefix_ = child_.prefix elif nodeName_ == 'PROVINCE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'PROVINCE') value_ = self.gds_validate_string(value_, node, 'PROVINCE') self.PROVINCE = value_ self.PROVINCE_nsprefix_ = child_.prefix elif nodeName_ == 'POSTCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'POSTCODE') value_ = self.gds_validate_string(value_, node, 'POSTCODE') self.POSTCODE = value_ self.POSTCODE_nsprefix_ = child_.prefix elif nodeName_ == 'COUNTRY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COUNTRY') value_ = self.gds_validate_string(value_, node, 'COUNTRY') self.COUNTRY = value_ self.COUNTRY_nsprefix_ = child_.prefix elif nodeName_ == 'VAT': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'VAT') value_ = self.gds_validate_string(value_, node, 'VAT') self.VAT = value_ self.VAT_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTNAME': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTNAME') value_ = self.gds_validate_string(value_, node, 'CONTACTNAME') self.CONTACTNAME = value_ self.CONTACTNAME_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTDIALCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTDIALCODE') value_ = self.gds_validate_string(value_, node, 'CONTACTDIALCODE') self.CONTACTDIALCODE = value_ self.CONTACTDIALCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTTELEPHONE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTTELEPHONE') value_ = self.gds_validate_string(value_, node, 'CONTACTTELEPHONE') self.CONTACTTELEPHONE = value_ self.CONTACTTELEPHONE_nsprefix_ = child_.prefix elif nodeName_ == 'CONTACTEMAIL': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONTACTEMAIL') value_ = self.gds_validate_string(value_, node, 'CONTACTEMAIL') self.CONTACTEMAIL = value_ self.CONTACTEMAIL_nsprefix_ = child_.prefix # end class DELIVERY class PACKAGE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, ITEMS=None, DESCRIPTION=None, LENGTH=None, HEIGHT=None, WIDTH=None, WEIGHT=None, ARTICLE=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.ITEMS = ITEMS self.ITEMS_nsprefix_ = None self.DESCRIPTION = DESCRIPTION self.DESCRIPTION_nsprefix_ = None self.LENGTH = LENGTH self.LENGTH_nsprefix_ = None self.HEIGHT = HEIGHT self.HEIGHT_nsprefix_ = None self.WIDTH = WIDTH self.WIDTH_nsprefix_ = None self.WEIGHT = WEIGHT self.WEIGHT_nsprefix_ = None if ARTICLE is None: self.ARTICLE = [] else: self.ARTICLE = ARTICLE self.ARTICLE_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PACKAGE) if subclass is not None: return subclass(*args_, **kwargs_) if PACKAGE.subclass: return PACKAGE.subclass(*args_, **kwargs_) else: return PACKAGE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_ITEMS(self): return self.ITEMS def set_ITEMS(self, ITEMS): self.ITEMS = ITEMS def get_DESCRIPTION(self): return self.DESCRIPTION def set_DESCRIPTION(self, DESCRIPTION): self.DESCRIPTION = DESCRIPTION def get_LENGTH(self): return self.LENGTH def set_LENGTH(self, LENGTH): self.LENGTH = LENGTH def get_HEIGHT(self): return self.HEIGHT def set_HEIGHT(self, HEIGHT): self.HEIGHT = HEIGHT def get_WIDTH(self): return self.WIDTH def set_WIDTH(self, WIDTH): self.WIDTH = WIDTH def get_WEIGHT(self): return self.WEIGHT def set_WEIGHT(self, WEIGHT): self.WEIGHT = WEIGHT def get_ARTICLE(self): return self.ARTICLE def set_ARTICLE(self, ARTICLE): self.ARTICLE = ARTICLE def add_ARTICLE(self, value): self.ARTICLE.append(value) def insert_ARTICLE_at(self, index, value): self.ARTICLE.insert(index, value) def replace_ARTICLE_at(self, index, value): self.ARTICLE[index] = value def hasContent_(self): if ( self.ITEMS is not None or self.DESCRIPTION is not None or self.LENGTH is not None or self.HEIGHT is not None or self.WIDTH is not None or self.WEIGHT is not None or self.ARTICLE ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PACKAGE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('PACKAGE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'PACKAGE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PACKAGE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PACKAGE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='PACKAGE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PACKAGE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.ITEMS is not None: namespaceprefix_ = self.ITEMS_nsprefix_ + ':' if (UseCapturedNS_ and self.ITEMS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sITEMS>%s</%sITEMS>%s' % (namespaceprefix_ , self.gds_format_integer(self.ITEMS, input_name='ITEMS'), namespaceprefix_ , eol_)) if self.DESCRIPTION is not None: namespaceprefix_ = self.DESCRIPTION_nsprefix_ + ':' if (UseCapturedNS_ and self.DESCRIPTION_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sDESCRIPTION>%s</%sDESCRIPTION>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DESCRIPTION), input_name='DESCRIPTION')), namespaceprefix_ , eol_)) if self.LENGTH is not None: namespaceprefix_ = self.LENGTH_nsprefix_ + ':' if (UseCapturedNS_ and self.LENGTH_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sLENGTH>%s</%sLENGTH>%s' % (namespaceprefix_ , self.gds_format_decimal(self.LENGTH, input_name='LENGTH'), namespaceprefix_ , eol_)) if self.HEIGHT is not None: namespaceprefix_ = self.HEIGHT_nsprefix_ + ':' if (UseCapturedNS_ and self.HEIGHT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sHEIGHT>%s</%sHEIGHT>%s' % (namespaceprefix_ , self.gds_format_decimal(self.HEIGHT, input_name='HEIGHT'), namespaceprefix_ , eol_)) if self.WIDTH is not None: namespaceprefix_ = self.WIDTH_nsprefix_ + ':' if (UseCapturedNS_ and self.WIDTH_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sWIDTH>%s</%sWIDTH>%s' % (namespaceprefix_ , self.gds_format_decimal(self.WIDTH, input_name='WIDTH'), namespaceprefix_ , eol_)) if self.WEIGHT is not None: namespaceprefix_ = self.WEIGHT_nsprefix_ + ':' if (UseCapturedNS_ and self.WEIGHT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sWEIGHT>%s</%sWEIGHT>%s' % (namespaceprefix_ , self.gds_format_decimal(self.WEIGHT, input_name='WEIGHT'), namespaceprefix_ , eol_)) for ARTICLE_ in self.ARTICLE: namespaceprefix_ = self.ARTICLE_nsprefix_ + ':' if (UseCapturedNS_ and self.ARTICLE_nsprefix_) else '' ARTICLE_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ARTICLE', pretty_print=pretty_print) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'ITEMS' and child_.text: sval_ = child_.text ival_ = self.gds_parse_integer(sval_, node, 'ITEMS') ival_ = self.gds_validate_integer(ival_, node, 'ITEMS') self.ITEMS = ival_ self.ITEMS_nsprefix_ = child_.prefix elif nodeName_ == 'DESCRIPTION': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'DESCRIPTION') value_ = self.gds_validate_string(value_, node, 'DESCRIPTION') self.DESCRIPTION = value_ self.DESCRIPTION_nsprefix_ = child_.prefix elif nodeName_ == 'LENGTH' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'LENGTH') fval_ = self.gds_validate_decimal(fval_, node, 'LENGTH') self.LENGTH = fval_ self.LENGTH_nsprefix_ = child_.prefix elif nodeName_ == 'HEIGHT' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'HEIGHT') fval_ = self.gds_validate_decimal(fval_, node, 'HEIGHT') self.HEIGHT = fval_ self.HEIGHT_nsprefix_ = child_.prefix elif nodeName_ == 'WIDTH' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'WIDTH') fval_ = self.gds_validate_decimal(fval_, node, 'WIDTH') self.WIDTH = fval_ self.WIDTH_nsprefix_ = child_.prefix elif nodeName_ == 'WEIGHT' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'WEIGHT') fval_ = self.gds_validate_decimal(fval_, node, 'WEIGHT') self.WEIGHT = fval_ self.WEIGHT_nsprefix_ = child_.prefix elif nodeName_ == 'ARTICLE': obj_ = ARTICLE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.ARTICLE.append(obj_) obj_.original_tagname_ = 'ARTICLE' # end class PACKAGE class ARTICLE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, ITEMS=None, DESCRIPTION=None, WEIGHT=None, INVOICEVALUE=None, INVOICEDESC=None, HTS=None, COUNTRY=None, EMRN=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.ITEMS = ITEMS self.ITEMS_nsprefix_ = None self.DESCRIPTION = DESCRIPTION self.DESCRIPTION_nsprefix_ = None self.WEIGHT = WEIGHT self.WEIGHT_nsprefix_ = None self.INVOICEVALUE = INVOICEVALUE self.INVOICEVALUE_nsprefix_ = None self.INVOICEDESC = INVOICEDESC self.INVOICEDESC_nsprefix_ = None self.HTS = HTS self.HTS_nsprefix_ = None self.COUNTRY = COUNTRY self.COUNTRY_nsprefix_ = None self.EMRN = EMRN self.EMRN_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ARTICLE) if subclass is not None: return subclass(*args_, **kwargs_) if ARTICLE.subclass: return ARTICLE.subclass(*args_, **kwargs_) else: return ARTICLE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_ITEMS(self): return self.ITEMS def set_ITEMS(self, ITEMS): self.ITEMS = ITEMS def get_DESCRIPTION(self): return self.DESCRIPTION def set_DESCRIPTION(self, DESCRIPTION): self.DESCRIPTION = DESCRIPTION def get_WEIGHT(self): return self.WEIGHT def set_WEIGHT(self, WEIGHT): self.WEIGHT = WEIGHT def get_INVOICEVALUE(self): return self.INVOICEVALUE def set_INVOICEVALUE(self, INVOICEVALUE): self.INVOICEVALUE = INVOICEVALUE def get_INVOICEDESC(self): return self.INVOICEDESC def set_INVOICEDESC(self, INVOICEDESC): self.INVOICEDESC = INVOICEDESC def get_HTS(self): return self.HTS def set_HTS(self, HTS): self.HTS = HTS def get_COUNTRY(self): return self.COUNTRY def set_COUNTRY(self, COUNTRY): self.COUNTRY = COUNTRY def get_EMRN(self): return self.EMRN def set_EMRN(self, EMRN): self.EMRN = EMRN def hasContent_(self): if ( self.ITEMS is not None or self.DESCRIPTION is not None or self.WEIGHT is not None or self.INVOICEVALUE is not None or self.INVOICEDESC is not None or self.HTS is not None or self.COUNTRY is not None or self.EMRN is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ARTICLE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('ARTICLE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'ARTICLE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='ARTICLE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='ARTICLE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='ARTICLE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ARTICLE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.ITEMS is not None: namespaceprefix_ = self.ITEMS_nsprefix_ + ':' if (UseCapturedNS_ and self.ITEMS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sITEMS>%s</%sITEMS>%s' % (namespaceprefix_ , self.gds_format_integer(self.ITEMS, input_name='ITEMS'), namespaceprefix_ , eol_)) if self.DESCRIPTION is not None: namespaceprefix_ = self.DESCRIPTION_nsprefix_ + ':' if (UseCapturedNS_ and self.DESCRIPTION_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sDESCRIPTION>%s</%sDESCRIPTION>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.DESCRIPTION), input_name='DESCRIPTION')), namespaceprefix_ , eol_)) if self.WEIGHT is not None: namespaceprefix_ = self.WEIGHT_nsprefix_ + ':' if (UseCapturedNS_ and self.WEIGHT_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sWEIGHT>%s</%sWEIGHT>%s' % (namespaceprefix_ , self.gds_format_decimal(self.WEIGHT, input_name='WEIGHT'), namespaceprefix_ , eol_)) if self.INVOICEVALUE is not None: namespaceprefix_ = self.INVOICEVALUE_nsprefix_ + ':' if (UseCapturedNS_ and self.INVOICEVALUE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sINVOICEVALUE>%s</%sINVOICEVALUE>%s' % (namespaceprefix_ , self.gds_format_decimal(self.INVOICEVALUE, input_name='INVOICEVALUE'), namespaceprefix_ , eol_)) if self.INVOICEDESC is not None: namespaceprefix_ = self.INVOICEDESC_nsprefix_ + ':' if (UseCapturedNS_ and self.INVOICEDESC_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sINVOICEDESC>%s</%sINVOICEDESC>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.INVOICEDESC), input_name='INVOICEDESC')), namespaceprefix_ , eol_)) if self.HTS is not None: namespaceprefix_ = self.HTS_nsprefix_ + ':' if (UseCapturedNS_ and self.HTS_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sHTS>%s</%sHTS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.HTS), input_name='HTS')), namespaceprefix_ , eol_)) if self.COUNTRY is not None: namespaceprefix_ = self.COUNTRY_nsprefix_ + ':' if (UseCapturedNS_ and self.COUNTRY_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCOUNTRY>%s</%sCOUNTRY>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.COUNTRY), input_name='COUNTRY')), namespaceprefix_ , eol_)) if self.EMRN is not None: namespaceprefix_ = self.EMRN_nsprefix_ + ':' if (UseCapturedNS_ and self.EMRN_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sEMRN>%s</%sEMRN>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EMRN), input_name='EMRN')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'ITEMS' and child_.text: sval_ = child_.text ival_ = self.gds_parse_integer(sval_, node, 'ITEMS') ival_ = self.gds_validate_integer(ival_, node, 'ITEMS') self.ITEMS = ival_ self.ITEMS_nsprefix_ = child_.prefix elif nodeName_ == 'DESCRIPTION': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'DESCRIPTION') value_ = self.gds_validate_string(value_, node, 'DESCRIPTION') self.DESCRIPTION = value_ self.DESCRIPTION_nsprefix_ = child_.prefix elif nodeName_ == 'WEIGHT' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'WEIGHT') fval_ = self.gds_validate_decimal(fval_, node, 'WEIGHT') self.WEIGHT = fval_ self.WEIGHT_nsprefix_ = child_.prefix elif nodeName_ == 'INVOICEVALUE' and child_.text: sval_ = child_.text fval_ = self.gds_parse_decimal(sval_, node, 'INVOICEVALUE') fval_ = self.gds_validate_decimal(fval_, node, 'INVOICEVALUE') self.INVOICEVALUE = fval_ self.INVOICEVALUE_nsprefix_ = child_.prefix elif nodeName_ == 'INVOICEDESC': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'INVOICEDESC') value_ = self.gds_validate_string(value_, node, 'INVOICEDESC') self.INVOICEDESC = value_ self.INVOICEDESC_nsprefix_ = child_.prefix elif nodeName_ == 'HTS': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'HTS') value_ = self.gds_validate_string(value_, node, 'HTS') self.HTS = value_ self.HTS_nsprefix_ = child_.prefix elif nodeName_ == 'COUNTRY': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'COUNTRY') value_ = self.gds_validate_string(value_, node, 'COUNTRY') self.COUNTRY = value_ self.COUNTRY_nsprefix_ = child_.prefix elif nodeName_ == 'EMRN': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'EMRN') value_ = self.gds_validate_string(value_, node, 'EMRN') self.EMRN = value_ self.EMRN_nsprefix_ = child_.prefix # end class ARTICLE class ACTIVITY(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CREATE=None, RATE=None, BOOK=None, SHIP=None, PRINT=None, SHOW_GROUPCODE=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.CREATE = CREATE self.CREATE_nsprefix_ = None self.RATE = RATE self.RATE_nsprefix_ = None self.BOOK = BOOK self.BOOK_nsprefix_ = None self.SHIP = SHIP self.SHIP_nsprefix_ = None self.PRINT = PRINT self.PRINT_nsprefix_ = None self.SHOW_GROUPCODE = SHOW_GROUPCODE self.SHOW_GROUPCODE_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ACTIVITY) if subclass is not None: return subclass(*args_, **kwargs_) if ACTIVITY.subclass: return ACTIVITY.subclass(*args_, **kwargs_) else: return ACTIVITY(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CREATE(self): return self.CREATE def set_CREATE(self, CREATE): self.CREATE = CREATE def get_RATE(self): return self.RATE def set_RATE(self, RATE): self.RATE = RATE def get_BOOK(self): return self.BOOK def set_BOOK(self, BOOK): self.BOOK = BOOK def get_SHIP(self): return self.SHIP def set_SHIP(self, SHIP): self.SHIP = SHIP def get_PRINT(self): return self.PRINT def set_PRINT(self, PRINT): self.PRINT = PRINT def get_SHOW_GROUPCODE(self): return self.SHOW_GROUPCODE def set_SHOW_GROUPCODE(self, SHOW_GROUPCODE): self.SHOW_GROUPCODE = SHOW_GROUPCODE def hasContent_(self): if ( self.CREATE is not None or self.RATE is not None or self.BOOK is not None or self.SHIP is not None or self.PRINT is not None or self.SHOW_GROUPCODE is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ACTIVITY', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('ACTIVITY') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'ACTIVITY': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='ACTIVITY') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='ACTIVITY', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='ACTIVITY'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='ACTIVITY', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.CREATE is not None: namespaceprefix_ = self.CREATE_nsprefix_ + ':' if (UseCapturedNS_ and self.CREATE_nsprefix_) else '' self.CREATE.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CREATE', pretty_print=pretty_print) if self.RATE is not None: namespaceprefix_ = self.RATE_nsprefix_ + ':' if (UseCapturedNS_ and self.RATE_nsprefix_) else '' self.RATE.export(outfile, level, namespaceprefix_, namespacedef_='', name_='RATE', pretty_print=pretty_print) if self.BOOK is not None: namespaceprefix_ = self.BOOK_nsprefix_ + ':' if (UseCapturedNS_ and self.BOOK_nsprefix_) else '' self.BOOK.export(outfile, level, namespaceprefix_, namespacedef_='', name_='BOOK', pretty_print=pretty_print) if self.SHIP is not None: namespaceprefix_ = self.SHIP_nsprefix_ + ':' if (UseCapturedNS_ and self.SHIP_nsprefix_) else '' self.SHIP.export(outfile, level, namespaceprefix_, namespacedef_='', name_='SHIP', pretty_print=pretty_print) if self.PRINT is not None: namespaceprefix_ = self.PRINT_nsprefix_ + ':' if (UseCapturedNS_ and self.PRINT_nsprefix_) else '' self.PRINT.export(outfile, level, namespaceprefix_, namespacedef_='', name_='PRINT', pretty_print=pretty_print) if self.SHOW_GROUPCODE is not None: namespaceprefix_ = self.SHOW_GROUPCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.SHOW_GROUPCODE_nsprefix_) else '' self.SHOW_GROUPCODE.export(outfile, level, namespaceprefix_, namespacedef_='', name_='SHOW_GROUPCODE', pretty_print=pretty_print) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CREATE': obj_ = CREATE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.CREATE = obj_ obj_.original_tagname_ = 'CREATE' elif nodeName_ == 'RATE': obj_ = RATE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.RATE = obj_ obj_.original_tagname_ = 'RATE' elif nodeName_ == 'BOOK': obj_ = BOOK.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.BOOK = obj_ obj_.original_tagname_ = 'BOOK' elif nodeName_ == 'SHIP': obj_ = SHIP.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.SHIP = obj_ obj_.original_tagname_ = 'SHIP' elif nodeName_ == 'PRINT': obj_ = PRINT.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.PRINT = obj_ obj_.original_tagname_ = 'PRINT' elif nodeName_ == 'SHOW_GROUPCODE': obj_ = SHOW_GROUPCODE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.SHOW_GROUPCODE = obj_ obj_.original_tagname_ = 'SHOW_GROUPCODE' # end class ACTIVITY class CREATE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CREATE) if subclass is not None: return subclass(*args_, **kwargs_) if CREATE.subclass: return CREATE.subclass(*args_, **kwargs_) else: return CREATE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def hasContent_(self): if ( self.CONREF ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CREATE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('CREATE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'CREATE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CREATE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CREATE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CREATE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CREATE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix # end class CREATE class RATE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RATE) if subclass is not None: return subclass(*args_, **kwargs_) if RATE.subclass: return RATE.subclass(*args_, **kwargs_) else: return RATE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RATE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('RATE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'RATE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='RATE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='RATE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RATE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RATE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class RATE class BOOK(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, EMAILREQD=None, ShowBookingRef=None, FaxNumber=None, LanguageId=None, PrintAtDepot=None, GROUPCODE=None, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.EMAILREQD = _cast(None, EMAILREQD) self.EMAILREQD_nsprefix_ = None self.ShowBookingRef = _cast(None, ShowBookingRef) self.ShowBookingRef_nsprefix_ = None self.FaxNumber = _cast(None, FaxNumber) self.FaxNumber_nsprefix_ = None self.LanguageId = _cast(None, LanguageId) self.LanguageId_nsprefix_ = None self.PrintAtDepot = _cast(None, PrintAtDepot) self.PrintAtDepot_nsprefix_ = None self.GROUPCODE = GROUPCODE self.GROUPCODE_nsprefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, BOOK) if subclass is not None: return subclass(*args_, **kwargs_) if BOOK.subclass: return BOOK.subclass(*args_, **kwargs_) else: return BOOK(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_GROUPCODE(self): return self.GROUPCODE def set_GROUPCODE(self, GROUPCODE): self.GROUPCODE = GROUPCODE def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def get_EMAILREQD(self): return self.EMAILREQD def set_EMAILREQD(self, EMAILREQD): self.EMAILREQD = EMAILREQD def get_ShowBookingRef(self): return self.ShowBookingRef def set_ShowBookingRef(self, ShowBookingRef): self.ShowBookingRef = ShowBookingRef def get_FaxNumber(self): return self.FaxNumber def set_FaxNumber(self, FaxNumber): self.FaxNumber = FaxNumber def get_LanguageId(self): return self.LanguageId def set_LanguageId(self, LanguageId): self.LanguageId = LanguageId def get_PrintAtDepot(self): return self.PrintAtDepot def set_PrintAtDepot(self, PrintAtDepot): self.PrintAtDepot = PrintAtDepot def hasContent_(self): if ( self.GROUPCODE is not None or self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='BOOK', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('BOOK') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'BOOK': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='BOOK') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='BOOK', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='BOOK'): if self.EMAILREQD is not None and 'EMAILREQD' not in already_processed: already_processed.add('EMAILREQD') outfile.write(' EMAILREQD=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.EMAILREQD), input_name='EMAILREQD')), )) if self.ShowBookingRef is not None and 'ShowBookingRef' not in already_processed: already_processed.add('ShowBookingRef') outfile.write(' ShowBookingRef=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ShowBookingRef), input_name='ShowBookingRef')), )) if self.FaxNumber is not None and 'FaxNumber' not in already_processed: already_processed.add('FaxNumber') outfile.write(' FaxNumber=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.FaxNumber), input_name='FaxNumber')), )) if self.LanguageId is not None and 'LanguageId' not in already_processed: already_processed.add('LanguageId') outfile.write(' LanguageId=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.LanguageId), input_name='LanguageId')), )) if self.PrintAtDepot is not None and 'PrintAtDepot' not in already_processed: already_processed.add('PrintAtDepot') outfile.write(' PrintAtDepot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.PrintAtDepot), input_name='PrintAtDepot')), )) def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='BOOK', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.GROUPCODE is not None: namespaceprefix_ = self.GROUPCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.GROUPCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sGROUPCODE>%s</%sGROUPCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.GROUPCODE), input_name='GROUPCODE')), namespaceprefix_ , eol_)) for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('EMAILREQD', node) if value is not None and 'EMAILREQD' not in already_processed: already_processed.add('EMAILREQD') self.EMAILREQD = value value = find_attr_value_('ShowBookingRef', node) if value is not None and 'ShowBookingRef' not in already_processed: already_processed.add('ShowBookingRef') self.ShowBookingRef = value value = find_attr_value_('FaxNumber', node) if value is not None and 'FaxNumber' not in already_processed: already_processed.add('FaxNumber') self.FaxNumber = value value = find_attr_value_('LanguageId', node) if value is not None and 'LanguageId' not in already_processed: already_processed.add('LanguageId') self.LanguageId = value value = find_attr_value_('PrintAtDepot', node) if value is not None and 'PrintAtDepot' not in already_processed: already_processed.add('PrintAtDepot') self.PrintAtDepot = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'GROUPCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'GROUPCODE') value_ = self.gds_validate_string(value_, node, 'GROUPCODE') self.GROUPCODE = value_ self.GROUPCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class BOOK class SHIP(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, GROUPCODE=None, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.GROUPCODE = GROUPCODE self.GROUPCODE_nsprefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SHIP) if subclass is not None: return subclass(*args_, **kwargs_) if SHIP.subclass: return SHIP.subclass(*args_, **kwargs_) else: return SHIP(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_GROUPCODE(self): return self.GROUPCODE def set_GROUPCODE(self, GROUPCODE): self.GROUPCODE = GROUPCODE def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.GROUPCODE is not None or self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SHIP', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('SHIP') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'SHIP': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SHIP') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SHIP', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='SHIP'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SHIP', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.GROUPCODE is not None: namespaceprefix_ = self.GROUPCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.GROUPCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sGROUPCODE>%s</%sGROUPCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.GROUPCODE), input_name='GROUPCODE')), namespaceprefix_ , eol_)) for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'GROUPCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'GROUPCODE') value_ = self.gds_validate_string(value_, node, 'GROUPCODE') self.GROUPCODE = value_ self.GROUPCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class SHIP class PRINT(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, REQUIRED=None, CONNOTE=None, LABEL=None, MANIFEST=None, INVOICE=None, EMAILTO=None, EMAILFROM=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.REQUIRED = REQUIRED self.REQUIRED_nsprefix_ = None self.CONNOTE = CONNOTE self.CONNOTE_nsprefix_ = None self.LABEL = LABEL self.LABEL_nsprefix_ = None self.MANIFEST = MANIFEST self.MANIFEST_nsprefix_ = None self.INVOICE = INVOICE self.INVOICE_nsprefix_ = None self.EMAILTO = EMAILTO self.EMAILTO_nsprefix_ = None self.EMAILFROM = EMAILFROM self.EMAILFROM_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PRINT) if subclass is not None: return subclass(*args_, **kwargs_) if PRINT.subclass: return PRINT.subclass(*args_, **kwargs_) else: return PRINT(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_REQUIRED(self): return self.REQUIRED def set_REQUIRED(self, REQUIRED): self.REQUIRED = REQUIRED def get_CONNOTE(self): return self.CONNOTE def set_CONNOTE(self, CONNOTE): self.CONNOTE = CONNOTE def get_LABEL(self): return self.LABEL def set_LABEL(self, LABEL): self.LABEL = LABEL def get_MANIFEST(self): return self.MANIFEST def set_MANIFEST(self, MANIFEST): self.MANIFEST = MANIFEST def get_INVOICE(self): return self.INVOICE def set_INVOICE(self, INVOICE): self.INVOICE = INVOICE def get_EMAILTO(self): return self.EMAILTO def set_EMAILTO(self, EMAILTO): self.EMAILTO = EMAILTO def get_EMAILFROM(self): return self.EMAILFROM def set_EMAILFROM(self, EMAILFROM): self.EMAILFROM = EMAILFROM def hasContent_(self): if ( self.REQUIRED is not None or self.CONNOTE is not None or self.LABEL is not None or self.MANIFEST is not None or self.INVOICE is not None or self.EMAILTO is not None or self.EMAILFROM is not None ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PRINT', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('PRINT') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'PRINT': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PRINT') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PRINT', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='PRINT'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PRINT', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.REQUIRED is not None: namespaceprefix_ = self.REQUIRED_nsprefix_ + ':' if (UseCapturedNS_ and self.REQUIRED_nsprefix_) else '' self.REQUIRED.export(outfile, level, namespaceprefix_, namespacedef_='', name_='REQUIRED', pretty_print=pretty_print) if self.CONNOTE is not None: namespaceprefix_ = self.CONNOTE_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNOTE_nsprefix_) else '' self.CONNOTE.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CONNOTE', pretty_print=pretty_print) if self.LABEL is not None: namespaceprefix_ = self.LABEL_nsprefix_ + ':' if (UseCapturedNS_ and self.LABEL_nsprefix_) else '' self.LABEL.export(outfile, level, namespaceprefix_, namespacedef_='', name_='LABEL', pretty_print=pretty_print) if self.MANIFEST is not None: namespaceprefix_ = self.MANIFEST_nsprefix_ + ':' if (UseCapturedNS_ and self.MANIFEST_nsprefix_) else '' self.MANIFEST.export(outfile, level, namespaceprefix_, namespacedef_='', name_='MANIFEST', pretty_print=pretty_print) if self.INVOICE is not None: namespaceprefix_ = self.INVOICE_nsprefix_ + ':' if (UseCapturedNS_ and self.INVOICE_nsprefix_) else '' self.INVOICE.export(outfile, level, namespaceprefix_, namespacedef_='', name_='INVOICE', pretty_print=pretty_print) if self.EMAILTO is not None: namespaceprefix_ = self.EMAILTO_nsprefix_ + ':' if (UseCapturedNS_ and self.EMAILTO_nsprefix_) else '' self.EMAILTO.export(outfile, level, namespaceprefix_, namespacedef_='', name_='EMAILTO', pretty_print=pretty_print) if self.EMAILFROM is not None: namespaceprefix_ = self.EMAILFROM_nsprefix_ + ':' if (UseCapturedNS_ and self.EMAILFROM_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sEMAILFROM>%s</%sEMAILFROM>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EMAILFROM), input_name='EMAILFROM')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'REQUIRED': obj_ = REQUIRED.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.REQUIRED = obj_ obj_.original_tagname_ = 'REQUIRED' elif nodeName_ == 'CONNOTE': obj_ = CONNOTE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.CONNOTE = obj_ obj_.original_tagname_ = 'CONNOTE' elif nodeName_ == 'LABEL': obj_ = LABEL.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.LABEL = obj_ obj_.original_tagname_ = 'LABEL' elif nodeName_ == 'MANIFEST': obj_ = MANIFEST.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.MANIFEST = obj_ obj_.original_tagname_ = 'MANIFEST' elif nodeName_ == 'INVOICE': obj_ = INVOICE.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.INVOICE = obj_ obj_.original_tagname_ = 'INVOICE' elif nodeName_ == 'EMAILTO': obj_ = EMAILTO.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.EMAILTO = obj_ obj_.original_tagname_ = 'EMAILTO' elif nodeName_ == 'EMAILFROM': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'EMAILFROM') value_ = self.gds_validate_string(value_, node, 'EMAILFROM') self.EMAILFROM = value_ self.EMAILFROM_nsprefix_ = child_.prefix # end class PRINT class SHOW_GROUPCODE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SHOW_GROUPCODE) if subclass is not None: return subclass(*args_, **kwargs_) if SHOW_GROUPCODE.subclass: return SHOW_GROUPCODE.subclass(*args_, **kwargs_) else: return SHOW_GROUPCODE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SHOW_GROUPCODE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('SHOW_GROUPCODE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'SHOW_GROUPCODE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SHOW_GROUPCODE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SHOW_GROUPCODE', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='SHOW_GROUPCODE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SHOW_GROUPCODE', fromsubclass_=False, pretty_print=True): pass def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): pass # end class SHOW_GROUPCODE class REQUIRED(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, REQUIRED) if subclass is not None: return subclass(*args_, **kwargs_) if REQUIRED.subclass: return REQUIRED.subclass(*args_, **kwargs_) else: return REQUIRED(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='REQUIRED', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('REQUIRED') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'REQUIRED': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='REQUIRED') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='REQUIRED', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='REQUIRED'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='REQUIRED', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class REQUIRED class CONNOTE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CONNOTE) if subclass is not None: return subclass(*args_, **kwargs_) if CONNOTE.subclass: return CONNOTE.subclass(*args_, **kwargs_) else: return CONNOTE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CONNOTE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('CONNOTE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'CONNOTE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CONNOTE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CONNOTE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CONNOTE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CONNOTE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class CONNOTE class LABEL(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, LABEL) if subclass is not None: return subclass(*args_, **kwargs_) if LABEL.subclass: return LABEL.subclass(*args_, **kwargs_) else: return LABEL(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='LABEL', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('LABEL') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'LABEL': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='LABEL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='LABEL', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='LABEL'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='LABEL', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class LABEL class MANIFEST(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, GROUPCODE=None, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.GROUPCODE = GROUPCODE self.GROUPCODE_nsprefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, MANIFEST) if subclass is not None: return subclass(*args_, **kwargs_) if MANIFEST.subclass: return MANIFEST.subclass(*args_, **kwargs_) else: return MANIFEST(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_GROUPCODE(self): return self.GROUPCODE def set_GROUPCODE(self, GROUPCODE): self.GROUPCODE = GROUPCODE def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.GROUPCODE is not None or self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='MANIFEST', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('MANIFEST') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'MANIFEST': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='MANIFEST') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='MANIFEST', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='MANIFEST'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='MANIFEST', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.GROUPCODE is not None: namespaceprefix_ = self.GROUPCODE_nsprefix_ + ':' if (UseCapturedNS_ and self.GROUPCODE_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sGROUPCODE>%s</%sGROUPCODE>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.GROUPCODE), input_name='GROUPCODE')), namespaceprefix_ , eol_)) for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'GROUPCODE': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'GROUPCODE') value_ = self.gds_validate_string(value_, node, 'GROUPCODE') self.GROUPCODE = value_ self.GROUPCODE_nsprefix_ = child_.prefix elif nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class MANIFEST class INVOICE(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, CONREF=None, CONNUMBER=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None if CONREF is None: self.CONREF = [] else: self.CONREF = CONREF self.CONREF_nsprefix_ = None if CONNUMBER is None: self.CONNUMBER = [] else: self.CONNUMBER = CONNUMBER self.CONNUMBER_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, INVOICE) if subclass is not None: return subclass(*args_, **kwargs_) if INVOICE.subclass: return INVOICE.subclass(*args_, **kwargs_) else: return INVOICE(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_CONREF(self): return self.CONREF def set_CONREF(self, CONREF): self.CONREF = CONREF def add_CONREF(self, value): self.CONREF.append(value) def insert_CONREF_at(self, index, value): self.CONREF.insert(index, value) def replace_CONREF_at(self, index, value): self.CONREF[index] = value def get_CONNUMBER(self): return self.CONNUMBER def set_CONNUMBER(self, CONNUMBER): self.CONNUMBER = CONNUMBER def add_CONNUMBER(self, value): self.CONNUMBER.append(value) def insert_CONNUMBER_at(self, index, value): self.CONNUMBER.insert(index, value) def replace_CONNUMBER_at(self, index, value): self.CONNUMBER[index] = value def hasContent_(self): if ( self.CONREF or self.CONNUMBER ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='INVOICE', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('INVOICE') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'INVOICE': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='INVOICE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='INVOICE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='INVOICE'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='INVOICE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for CONREF_ in self.CONREF: namespaceprefix_ = self.CONREF_nsprefix_ + ':' if (UseCapturedNS_ and self.CONREF_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONREF>%s</%sCONREF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONREF_), input_name='CONREF')), namespaceprefix_ , eol_)) for CONNUMBER_ in self.CONNUMBER: namespaceprefix_ = self.CONNUMBER_nsprefix_ + ':' if (UseCapturedNS_ and self.CONNUMBER_nsprefix_) else '' showIndent(outfile, level, pretty_print) outfile.write('<%sCONNUMBER>%s</%sCONNUMBER>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(CONNUMBER_), input_name='CONNUMBER')), namespaceprefix_ , eol_)) def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): if nodeName_ == 'CONREF': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONREF') value_ = self.gds_validate_string(value_, node, 'CONREF') self.CONREF.append(value_) self.CONREF_nsprefix_ = child_.prefix elif nodeName_ == 'CONNUMBER': value_ = child_.text value_ = self.gds_parse_string(value_, node, 'CONNUMBER') value_ = self.gds_validate_string(value_, node, 'CONNUMBER') self.CONNUMBER.append(value_) self.CONNUMBER_nsprefix_ = child_.prefix # end class INVOICE class EMAILTO(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ subclass = None superclass = None def __init__(self, type_=None, valueOf_=None, gds_collector_=None, **kwargs_): self.gds_collector_ = gds_collector_ self.gds_elementtree_node_ = None self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.ns_prefix_ = None self.type_ = _cast(None, type_) self.type__nsprefix_ = None self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EMAILTO) if subclass is not None: return subclass(*args_, **kwargs_) if EMAILTO.subclass: return EMAILTO.subclass(*args_, **kwargs_) else: return EMAILTO(*args_, **kwargs_) factory = staticmethod(factory) def get_ns_prefix_(self): return self.ns_prefix_ def set_ns_prefix_(self, ns_prefix): self.ns_prefix_ = ns_prefix def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( (1 if type(self.valueOf_) in [int,float] else self.valueOf_) ): return True else: return False def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='EMAILTO', pretty_print=True): imported_ns_def_ = GenerateDSNamespaceDefs_.get('EMAILTO') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None and name_ == 'EMAILTO': name_ = self.original_tagname_ if UseCapturedNS_ and self.ns_prefix_: namespaceprefix_ = self.ns_prefix_ + ':' showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='EMAILTO') if self.hasContent_(): outfile.write('>') outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='EMAILTO', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='EMAILTO'): if self.type_ is not None and 'type_' not in already_processed: already_processed.add('type_') outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), )) def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='EMAILTO', fromsubclass_=False, pretty_print=True): pass def build(self, node, gds_collector_=None): self.gds_collector_ = gds_collector_ if SaveElementTreeNode: self.gds_elementtree_node_ = node already_processed = set() self.ns_prefix_ = node.prefix self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) return self def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('type', node) if value is not None and 'type' not in already_processed: already_processed.add('type') self.type_ = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): pass # end class EMAILTO GDSClassesMapping = { } USAGE_TEXT = """ Usage: python <Parser>.py [ -s ] <in_xml_file> """ def usage(): print(USAGE_TEXT) sys.exit(1) def get_root_tag(node): tag = Tag_pattern_.match(node.tag).groups()[-1] rootClass = GDSClassesMapping.get(tag) if rootClass is None: rootClass = globals().get(tag) return tag, rootClass def get_required_ns_prefix_defs(rootNode): '''Get all name space prefix definitions required in this XML doc. Return a dictionary of definitions and a char string of definitions. ''' nsmap = { prefix: uri for node in rootNode.iter() for (prefix, uri) in node.nsmap.items() if prefix is not None } namespacedefs = ' '.join([ 'xmlns:{}="{}"'.format(prefix, uri) for prefix, uri in nsmap.items() ]) return nsmap, namespacedefs def parse(inFileName, silence=False, print_warnings=True): global CapturedNsmap_ gds_collector = GdsCollector_() parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'ESHIPPER' rootClass = ESHIPPER rootObj = rootClass.factory() rootObj.build(rootNode, gds_collector_=gds_collector) CapturedNsmap_, namespacedefs = get_required_ns_prefix_defs(rootNode) if not SaveElementTreeNode: doc = None rootNode = None if not silence: sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_=namespacedefs, pretty_print=True) if print_warnings and len(gds_collector.get_messages()) > 0: separator = ('-' * 50) + '\n' sys.stderr.write(separator) sys.stderr.write('----- Warnings -- count: {} -----\n'.format( len(gds_collector.get_messages()), )) gds_collector.write_messages(sys.stderr) sys.stderr.write(separator) return rootObj def parseEtree(inFileName, silence=False, print_warnings=True, mapping=None, nsmap=None): parser = None doc = parsexml_(inFileName, parser) gds_collector = GdsCollector_() rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'ESHIPPER' rootClass = ESHIPPER rootObj = rootClass.factory() rootObj.build(rootNode, gds_collector_=gds_collector) # Enable Python to collect the space used by the DOM. if mapping is None: mapping = {} rootElement = rootObj.to_etree( None, name_=rootTag, mapping_=mapping, nsmap_=nsmap) reverse_mapping = rootObj.gds_reverse_node_mapping(mapping) if not SaveElementTreeNode: doc = None rootNode = None if not silence: content = etree_.tostring( rootElement, pretty_print=True, xml_declaration=True, encoding="utf-8") sys.stdout.write(str(content)) sys.stdout.write('\n') if print_warnings and len(gds_collector.get_messages()) > 0: separator = ('-' * 50) + '\n' sys.stderr.write(separator) sys.stderr.write('----- Warnings -- count: {} -----\n'.format( len(gds_collector.get_messages()), )) gds_collector.write_messages(sys.stderr) sys.stderr.write(separator) return rootObj, rootElement, mapping, reverse_mapping def parseString(inString, silence=False, print_warnings=True): '''Parse a string, create the object tree, and export it. Arguments: - inString -- A string. This XML fragment should not start with an XML declaration containing an encoding. - silence -- A boolean. If False, export the object. Returns -- The root object in the tree. ''' parser = None rootNode= parsexmlstring_(inString, parser) gds_collector = GdsCollector_() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'ESHIPPER' rootClass = ESHIPPER rootObj = rootClass.factory() rootObj.build(rootNode, gds_collector_=gds_collector) if not SaveElementTreeNode: rootNode = None if not silence: sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='') if print_warnings and len(gds_collector.get_messages()) > 0: separator = ('-' * 50) + '\n' sys.stderr.write(separator) sys.stderr.write('----- Warnings -- count: {} -----\n'.format( len(gds_collector.get_messages()), )) gds_collector.write_messages(sys.stderr) sys.stderr.write(separator) return rootObj def parseLiteral(inFileName, silence=False, print_warnings=True): parser = None doc = parsexml_(inFileName, parser) gds_collector = GdsCollector_() rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'ESHIPPER' rootClass = ESHIPPER rootObj = rootClass.factory() rootObj.build(rootNode, gds_collector_=gds_collector) # Enable Python to collect the space used by the DOM. if not SaveElementTreeNode: doc = None rootNode = None if not silence: sys.stdout.write('#from shipment_request import *\n\n') sys.stdout.write('import shipment_request as model_\n\n') sys.stdout.write('rootObj = model_.rootClass(\n') rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) sys.stdout.write(')\n') if print_warnings and len(gds_collector.get_messages()) > 0: separator = ('-' * 50) + '\n' sys.stderr.write(separator) sys.stderr.write('----- Warnings -- count: {} -----\n'.format( len(gds_collector.get_messages()), )) gds_collector.write_messages(sys.stderr) sys.stderr.write(separator) return rootObj def main(): args = sys.argv[1:] if len(args) == 1: parse(args[0]) else: usage() if __name__ == '__main__': #import pdb; pdb.set_trace() main() RenameMappings_ = { } # # Mapping of namespaces to types defined in them # and the file in which each is defined. # simpleTypes are marked "ST" and complexTypes "CT". NamespaceToDefMappings_ = {} __all__ = [ "ACTIVITY", "ALTCOLLECTTIME", "ARTICLE", "BOOK", "COLLECTION", "COLLECTIONADDRESS", "CONNOTE", "CONSIGNMENT", "CONSIGNMENTBATCH", "CREATE", "DELIVERY", "DETAILS", "EMAILTO", "ESHIPPER", "INVOICE", "LABEL", "LOGIN", "MANIFEST", "PACKAGE", "PREFCOLLECTTIME", "PRINT", "RATE", "RECEIVER", "REQUIRED", "SENDER", "SHIP", "SHOW_GROUPCODE" ]
47.806101
440
0.639082
30,676
289,944
5.712283
0.024677
0.024568
0.020493
0.023364
0.815814
0.770633
0.760389
0.741717
0.718616
0.692302
0
0.003581
0.263275
289,944
6,064
441
47.813984
0.816749
0.01821
0
0.700434
1
0.000173
0.051848
0.014316
0
0
0
0
0
1
0.136687
false
0.013183
0.016999
0.037294
0.256722
0.061058
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
027101b326a9fa5b0693bc78ebb4f52296945792
703
py
Python
test_junkie/errors.py
nityagautam/test_junkie
f60a9d71b9a8670f6272a79e2dcc5ac2d64b0512
[ "MIT" ]
1
2019-04-05T10:51:24.000Z
2019-04-05T10:51:24.000Z
test_junkie/errors.py
nityagautam/test_junkie
f60a9d71b9a8670f6272a79e2dcc5ac2d64b0512
[ "MIT" ]
null
null
null
test_junkie/errors.py
nityagautam/test_junkie
f60a9d71b9a8670f6272a79e2dcc5ac2d64b0512
[ "MIT" ]
null
null
null
# TODO overhaul errors and add documentation links class TestJunkieExecutionError(Exception): def __init__(self, message): Exception.__init__(self, message) class TestListenerError(TestJunkieExecutionError): def __init__(self, message): TestJunkieExecutionError.__init__(self, message) class ConfigError(TestJunkieExecutionError): def __init__(self, message): TestJunkieExecutionError.__init__(self, message) class BadParameters(TestJunkieExecutionError): def __init__(self, message): TestJunkieExecutionError.__init__(self, message) class BadSignature(Exception): def __init__(self, message): Exception.__init__(self, message)
21.96875
56
0.752489
62
703
7.887097
0.290323
0.163599
0.306748
0.184049
0.736196
0.736196
0.736196
0.736196
0.736196
0.527607
0
0
0.167852
703
31
57
22.677419
0.835897
0.068279
0
0.666667
0
0
0
0
0
0
0
0.032258
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
0
1
1
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
1
0
0
9
5a0ff7e534a37c4d9a42088774ed8916d22a97c3
276
py
Python
af_scripts/tmp/addRmDeformerInfluence.py
aaronfang/small-Scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
1
2018-03-08T16:34:00.000Z
2018-03-08T16:34:00.000Z
af_scripts/tmp/addRmDeformerInfluence.py
aaronfang/personal_scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
null
null
null
af_scripts/tmp/addRmDeformerInfluence.py
aaronfang/personal_scripts
890b10ab19fa9cdf2415aaf2dc08b81cc64fc79d
[ "MIT" ]
null
null
null
# Add objects from selected deformer curSel = cmds.ls(sl=1, fl=1) for sel in curSel[0:-1]: cmds.deformer(curSel[-1], e=1, g=sel) # Remove objects from selected deformer curSel = cmds.ls(sl=1, fl=1) for sel in curSel[0:-1]: cmds.deformer(curSel[-1], e=1, g=sel, rm=1)
27.6
47
0.666667
54
276
3.407407
0.351852
0.304348
0.206522
0.293478
0.934783
0.934783
0.934783
0.934783
0.934783
0.934783
0
0.056034
0.15942
276
9
48
30.666667
0.737069
0.26087
0
0.666667
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
1
1
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
5a2890722585bc2997bc3126e6553f6e9e939b25
91,421
py
Python
import_export_ballotpedia/views_admin.py
ericchavez831/WeVoteServer
da082517a3bd9bf5f0f83edcfde5be265a7615fc
[ "MIT" ]
null
null
null
import_export_ballotpedia/views_admin.py
ericchavez831/WeVoteServer
da082517a3bd9bf5f0f83edcfde5be265a7615fc
[ "MIT" ]
null
null
null
import_export_ballotpedia/views_admin.py
ericchavez831/WeVoteServer
da082517a3bd9bf5f0f83edcfde5be265a7615fc
[ "MIT" ]
null
null
null
# import_export_ballotpedia/views_admin.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import attach_ballotpedia_election_by_district_from_api, \ retrieve_ballot_items_for_one_voter_api_v4, \ retrieve_ballot_items_from_polling_location, retrieve_ballot_items_from_polling_location_api_v4, \ retrieve_ballotpedia_candidates_by_district_from_api, retrieve_ballotpedia_measures_by_district_from_api, \ retrieve_ballotpedia_district_id_list_for_polling_location, retrieve_ballotpedia_offices_by_district_from_api from admin_tools.views import redirect_to_sign_in_page from ballot.models import BallotReturnedListManager, BallotReturnedManager from config.base import get_environment_variable from datetime import date from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.messages import get_messages from django.urls import reverse from django.db.models import Q from django.http import HttpResponseRedirect from django.shortcuts import redirect, render from election.models import Election, ElectionManager from exception.models import handle_exception from import_export_batches.controllers_batch_process import \ schedule_retrieve_ballotpedia_ballots_for_polling_locations_api_v4, \ schedule_refresh_ballotpedia_ballots_for_voters_api_v4 from import_export_batches.models import BatchProcessManager, BatchSet, \ BATCH_SET_SOURCE_IMPORT_BALLOTPEDIA_BALLOT_ITEMS, REFRESH_BALLOT_ITEMS_FROM_POLLING_LOCATIONS, \ REFRESH_BALLOT_ITEMS_FROM_VOTERS, RETRIEVE_BALLOT_ITEMS_FROM_POLLING_LOCATIONS from polling_location.models import PollingLocation import random from voter.models import voter_has_authority import wevote_functions.admin from wevote_functions.functions import convert_to_int, is_valid_state_code, positive_value_exists logger = wevote_functions.admin.get_logger(__name__) BALLOTPEDIA_API_CONTAINS_URL = get_environment_variable("BALLOTPEDIA_API_CONTAINS_URL") BALLOTPEDIA_API_SAMPLE_BALLOT_RESULTS_URL = "https://api4.ballotpedia.org/sample_ballot_results" CANDIDATE = 'CANDIDATE' CONTEST_OFFICE = 'CONTEST_OFFICE' ELECTED_OFFICE = 'ELECTED_OFFICE' IMPORT_BALLOT_ITEM = 'IMPORT_BALLOT_ITEM' IMPORT_VOTER = 'IMPORT_VOTER' MEASURE = 'MEASURE' POLITICIAN = 'POLITICIAN' MAP_POINTS_RETRIEVED_EACH_BATCH_CHUNK = 125 # 125. Formerly 250 and 111 @login_required def import_ballot_items_for_location_view(request): """ Reach out to Ballotpedia API to retrieve a short list of districts the voter can vote in. """ status = "" success = True # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) polling_location_we_vote_id = request.GET.get('polling_location_we_vote_id', "") state_code = request.GET.get('state_code', "") if not positive_value_exists(google_civic_election_id): messages.add_message(request, messages.ERROR, 'Google Civic Election Id missing.') return HttpResponseRedirect(reverse('election:election_list', args=())) election_manager = ElectionManager() election_day_text = "" results = election_manager.retrieve_election(google_civic_election_id=google_civic_election_id) if results['election_found']: election = results['election'] election_day_text = election.election_day_text results = retrieve_ballot_items_from_polling_location_api_v4( google_civic_election_id, election_day_text=election_day_text, polling_location_we_vote_id=polling_location_we_vote_id, state_code=state_code, ) kind_of_batch = "" if 'kind_of_batch' in results: kind_of_batch = results['kind_of_batch'] if not positive_value_exists(kind_of_batch): kind_of_batch = IMPORT_BALLOT_ITEM batch_header_id = 0 if 'batch_saved' in results and results['batch_saved']: messages.add_message(request, messages.INFO, 'Ballot items import batch for {google_civic_election_id} ' 'election saved.' ''.format(google_civic_election_id=google_civic_election_id)) batch_header_id = results['batch_header_id'] elif 'batch_header_id' in results and results['batch_header_id']: messages.add_message(request, messages.INFO, 'Ballot items import batch for {google_civic_election_id} ' 'election saved, batch_header_id.' ''.format(google_civic_election_id=google_civic_election_id)) batch_header_id = results['batch_header_id'] else: messages.add_message(request, messages.ERROR, results['status']) if positive_value_exists(batch_header_id): # Go straight to the new batch return HttpResponseRedirect(reverse('import_export_batches:batch_action_list', args=()) + "?batch_header_id=" + str(batch_header_id) + "&kind_of_batch=" + str(kind_of_batch) + "&google_civic_election_id=" + str(google_civic_election_id)) else: # Go to the ballot_item_list_edit page if positive_value_exists(polling_location_we_vote_id): return HttpResponseRedirect(reverse('ballot:ballot_item_list_by_polling_location_edit', args=(polling_location_we_vote_id,)) + "?google_civic_election_id=" + str(google_civic_election_id) + "&polling_location_we_vote_id=" + str(polling_location_we_vote_id) + "&state_code=" + str(state_code) ) else: messages.add_message(request, messages.ERROR, "Missing polling_location_we_vote_id.") return HttpResponseRedirect(reverse('election:election_list', args=()) + "?google_civic_election_id=" + str(google_civic_election_id) + "&polling_location_we_vote_id=" + str(polling_location_we_vote_id) + "&state_code=" + str(state_code) ) @login_required def import_export_ballotpedia_index_view(request): """ Provide an index of import/export actions (for We Vote data maintenance) """ messages_on_stage = get_messages(request) template_values = { 'messages_on_stage': messages_on_stage, } return render(request, 'import_export_ballotpedia/index.html', template_values) @login_required def attach_ballotpedia_election_view(request, election_local_id=0): """ Reach out to Ballotpedia and retrieve the details about this election needed to make other API calls. :param request: :param election_local_id: :return: """ # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) state_code = request.GET.get('state_code', '') force_district_retrieve_from_ballotpedia = request.GET.get('force_district_retrieve_from_ballotpedia', False) polling_location_list = [] status = "" try: election_on_stage = Election.objects.get(id=election_local_id) google_civic_election_id = election_on_stage.google_civic_election_id election_state_code = election_on_stage.get_election_state() election_name = election_on_stage.election_name is_national_election = election_on_stage.is_national_election except Election.MultipleObjectsReturned as e: messages.add_message(request, messages.ERROR, 'Could not retrieve election data. More than one election found.') return HttpResponseRedirect(reverse('election:election_list', args=())) except Election.DoesNotExist: messages.add_message(request, messages.ERROR, 'Could not retrieve election data. Election could not be found.') return HttpResponseRedirect(reverse('election:election_list', args=())) # Check to see if we have polling location data related to the region(s) covered by this election # We request the ballot data for each polling location as a way to build up our local data if not positive_value_exists(state_code) and positive_value_exists(google_civic_election_id): state_code = election_state_code if positive_value_exists(is_national_election) and not positive_value_exists(state_code): messages.add_message(request, messages.ERROR, 'For National elections, a State Code is required in order to run any ' 'Ballotpedia data preparation.') return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) if not is_valid_state_code(state_code): messages.add_message(request, messages.ERROR, '{state_code} is not a valid State Code'.format(state_code=state_code)) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) try: polling_location_count_query = PollingLocation.objects.all() polling_location_count_query = polling_location_count_query.filter(state__iexact=state_code) polling_location_count_query = polling_location_count_query.exclude(polling_location_deleted=True) polling_location_count_query = polling_location_count_query.exclude( Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_count_query = polling_location_count_query.exclude( Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) polling_location_count = polling_location_count_query.count() if positive_value_exists(polling_location_count): polling_location_limited_count = 1000 polling_location_query = PollingLocation.objects.all() polling_location_query = polling_location_query.filter(state__iexact=state_code) polling_location_query = polling_location_query.exclude(polling_location_deleted=True) polling_location_query = polling_location_query.exclude( Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_query = polling_location_query.exclude( Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) # Ordering by "line1" creates a bit of (locational) random order polling_location_list = polling_location_query.order_by('line1')[:polling_location_limited_count] except PollingLocation.DoesNotExist: messages.add_message(request, messages.INFO, 'Could not retrieve polling location data for the {election_name}. ' 'No polling locations exist for the state \'{state}\'. ' 'Data needed from VIP.'.format( election_name=election_name, state=state_code)) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,)) + "?state_code=" + str(state_code)) if polling_location_count == 0: messages.add_message(request, messages.ERROR, 'Could not retrieve ballot data for the {election_name}. ' 'No polling locations returned for the state \'{state}\'. ' '(error 2 - attach_ballotpedia_election_view)'.format( election_name=election_name, state=state_code)) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,)) + "?state_code=" + str(state_code)) # If here, we know that we have some polling_locations to use in order to retrieve ballotpedia districts could_not_retrieve_district_id_list_for_polling_location_count = 0 merged_district_list = [] for polling_location in polling_location_list: one_ballot_results = retrieve_ballotpedia_district_id_list_for_polling_location( google_civic_election_id, polling_location=polling_location, force_district_retrieve_from_ballotpedia=force_district_retrieve_from_ballotpedia) if one_ballot_results['success']: ballotpedia_district_id_list = one_ballot_results['ballotpedia_district_id_list'] if len(ballotpedia_district_id_list): for one_ballotpedia_district_id in ballotpedia_district_id_list: if one_ballotpedia_district_id not in merged_district_list: # Build up a list of ballotpedia districts that we need to retrieve races for merged_district_list.append(one_ballotpedia_district_id) else: could_not_retrieve_district_id_list_for_polling_location_count += 1 if positive_value_exists(could_not_retrieve_district_id_list_for_polling_location_count): messages.add_message(request, messages.ERROR, 'Could not retrieve district_id list for this many Map Points: ' + str(could_not_retrieve_district_id_list_for_polling_location_count)) # Once we have a summary of all ballotpedia districts, we want to request all of the races if not len(merged_district_list): messages.add_message(request, messages.ERROR, 'Could not find Ballotpedia districts. ') return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,)) + '?google_civic_election_id=' + str(google_civic_election_id) + "&state_code=" + str(state_code)) results = attach_ballotpedia_election_by_district_from_api(election_on_stage, google_civic_election_id, merged_district_list, state_code) status += results['status'] status = status[:1000] if positive_value_exists(results['election_found']): messages.add_message(request, messages.INFO, 'Ballotpedia election information attached. status: {status} '.format(status=status)) else: # We limit the number of status characters we print to the screen to 2000 so we don't get # the error "Not all temporary messages could be stored." messages.add_message(request, messages.ERROR, 'Ballotpedia election information not attached. status: {status} ' .format(status=status)) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,)) + '?google_civic_election_id=' + str(google_civic_election_id) + '&state_code=' + str(state_code)) @login_required def refresh_ballotpedia_districts_for_polling_locations_view(request): """ This function refreshes the Ballotpedia districts used with subsequent calls to Ballotpedia: 1) Retrieve (internally) polling locations (so we can use those addresses to retrieve a representative set of ballots) 2) Cycle through a portion of those polling locations, enough that we are caching all of the possible ballot items 3) Ask for Ballotpedia districts for each of the polling locations being analyzed :param request: :return: """ # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) state_code = request.GET.get('state_code', '') # This is 500 because we're looking for districts import_limit = convert_to_int(request.GET.get('import_limit', 500)) polling_location_list = [] polling_location_count = 0 status = "" if not positive_value_exists(state_code): messages.add_message(request, messages.ERROR, 'Could not retrieve Ballotpedia data. Missing state_code.') return HttpResponseRedirect(reverse('electoral_district:electoral_district_list', args=())) try: polling_location_count_query = PollingLocation.objects.all() polling_location_count_query = polling_location_count_query.filter(state__iexact=state_code) polling_location_count_query = polling_location_count_query.filter(use_for_bulk_retrieve=True) polling_location_count_query = polling_location_count_query.exclude(polling_location_deleted=True) polling_location_count = polling_location_count_query.count() if positive_value_exists(polling_location_count): polling_location_query = PollingLocation.objects.all() polling_location_query = polling_location_query.filter(state__iexact=state_code) polling_location_query = polling_location_query.filter(use_for_bulk_retrieve=True) polling_location_query = polling_location_query.exclude(polling_location_deleted=True) # We used to have a limit of 500 ballots to pull per election, but now retrieve all # Ordering by "line1" creates a bit of (locational) random order polling_location_list = polling_location_query.order_by('line1')[:import_limit] except Exception as e: status += "ELECTORAL_DISTRICT-COULD_NOT_FIND_POLLING_LOCATION_LIST " + str(e) + " " if polling_location_count == 0: # We didn't find any polling locations marked for bulk retrieve, so just retrieve up to the import_limit try: polling_location_count_query = PollingLocation.objects.all() polling_location_count_query = \ polling_location_count_query.exclude(Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_count_query = \ polling_location_count_query.exclude(Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) polling_location_count_query = polling_location_count_query.filter(state__iexact=state_code) polling_location_count_query = polling_location_count_query.exclude(polling_location_deleted=True) polling_location_count = polling_location_count_query.count() if positive_value_exists(polling_location_count): polling_location_query = PollingLocation.objects.all() polling_location_query = \ polling_location_query.exclude(Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_query = \ polling_location_query.exclude(Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) polling_location_query = polling_location_query.filter(state__iexact=state_code) polling_location_query = polling_location_query.exclude(polling_location_deleted=True) # Ordering by "line1" creates a bit of (locational) random order polling_location_list = polling_location_query.order_by('line1')[:import_limit] except PollingLocation.DoesNotExist: messages.add_message(request, messages.INFO, 'Could not retrieve ballot data. ' 'No polling locations exist for the state \'{state}\'. ' 'Data needed from VIP.'.format( state=state_code)) return HttpResponseRedirect(reverse('electoral_district:electoral_district_list', args=())) if polling_location_count == 0: messages.add_message(request, messages.ERROR, 'Could not retrieve ballot data. ' 'No polling locations returned for the state \'{state}\'. ' '(error 2 - refresh_ballotpedia_districts_for_polling_locations_view)'.format( state=state_code)) return HttpResponseRedirect(reverse('electoral_district:electoral_district_list', args=())) # If here, we know that we have some polling_locations to use in order to retrieve ballotpedia districts # Step though our set of polling locations, until we find one that contains a ballot. Some won't contain ballots # due to data quality issues. polling_locations_with_data = 0 polling_locations_without_data = 0 # If here we just want to retrieve the races for this election merged_district_list = [] google_civic_election_id = 0 force_district_retrieve_from_ballotpedia = True for polling_location in polling_location_list: one_ballot_results = retrieve_ballotpedia_district_id_list_for_polling_location( google_civic_election_id, polling_location=polling_location, force_district_retrieve_from_ballotpedia=force_district_retrieve_from_ballotpedia) success = False if one_ballot_results['success']: success = True ballotpedia_district_id_list = one_ballot_results['ballotpedia_district_id_list'] if len(ballotpedia_district_id_list): for one_ballotpedia_district_id in ballotpedia_district_id_list: if one_ballotpedia_district_id not in merged_district_list: # Build up a list of ballotpedia districts that we need to retrieve races for merged_district_list.append(one_ballotpedia_district_id) if success: polling_locations_with_data += 1 else: polling_locations_without_data += 1 messages.add_message(request, messages.INFO, 'Electoral data retrieved from Ballotpedia. ' 'polling_locations_with_data: {polling_locations_with_data}, ' 'polling_locations_without_data: {polling_locations_without_data}. ' ''.format( polling_locations_with_data=polling_locations_with_data, polling_locations_without_data=polling_locations_without_data)) return HttpResponseRedirect(reverse('electoral_district:electoral_district_list', args=()) + '?state_code=' + str(state_code) + '&google_civic_election_id=' + str(google_civic_election_id)) @login_required def retrieve_ballotpedia_candidates_by_district_from_api_view(request): """ Reach out to Ballotpedia API to retrieve candidates. """ # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) only_retrieve_if_zero_candidates = request.GET.get('only_retrieve_if_zero_candidates', False) state_code = request.GET.get('state_code', "") election_manager = ElectionManager() election_local_id = 0 is_national_election = False results = election_manager.retrieve_election(google_civic_election_id) if results['election_found']: election = results['election'] election_local_id = election.id is_national_election = election.is_national_election if positive_value_exists(is_national_election) and not positive_value_exists(state_code): messages.add_message(request, messages.ERROR, 'For National elections, a State Code is required in order to run any ' 'Ballotpedia data preparation.') return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) results = retrieve_ballotpedia_candidates_by_district_from_api(google_civic_election_id, state_code, only_retrieve_if_zero_candidates) kind_of_batch = "" if 'kind_of_batch' in results: kind_of_batch = results['kind_of_batch'] if not positive_value_exists(kind_of_batch): kind_of_batch = CANDIDATE batch_header_id = 0 if 'batch_saved' in results and results['batch_saved']: messages.add_message(request, messages.INFO, 'Import batch for {google_civic_election_id} election saved.' ''.format(google_civic_election_id=google_civic_election_id)) batch_header_id = results['batch_header_id'] elif 'batch_header_id' in results and results['batch_header_id']: messages.add_message(request, messages.INFO, 'Import batch for {google_civic_election_id} election saved, ' 'batch_header_id.' ''.format(google_civic_election_id=google_civic_election_id)) batch_header_id = results['batch_header_id'] else: messages.add_message(request, messages.ERROR, results['status']) if positive_value_exists(batch_header_id): # Go straight to the new batch return HttpResponseRedirect(reverse('import_export_batches:batch_action_list', args=()) + "?batch_header_id=" + str(batch_header_id) + "&kind_of_batch=" + str(kind_of_batch) + "&google_civic_election_id=" + str(google_civic_election_id)) else: # Go to the office listing page return HttpResponseRedirect(reverse('office:office_list', args=()) + "?google_civic_election_id=" + str(google_civic_election_id)) @login_required def retrieve_ballotpedia_ballots_for_entire_election_api_v4_view(request): # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) state_code_list = [] status = '' batch_process_manager = BatchProcessManager() if not positive_value_exists(google_civic_election_id): status += "GOOGLE_CIVIC_ELECTION_ID_MISSING " messages.add_message(request, messages.INFO, status) return HttpResponseRedirect(reverse('import_export_batches:batch_process_list', args=())) # Retrieve list of states in this election, and then loop through each state election_manager = ElectionManager() election_results = election_manager.retrieve_election(google_civic_election_id) if election_results['election_found']: election = election_results['election'] state_code_list = election.state_code_list() status += "STATE_CODE_LIST: " + str(state_code_list) + " " if not positive_value_exists(len(state_code_list)): status += "STATE_CODE_LIST_MISSING " messages.add_message(request, messages.INFO, status) return HttpResponseRedirect(reverse('import_export_batches:batch_process_list', args=())) for state_code in state_code_list: # Refresh based on polling locations if batch_process_manager.is_batch_process_currently_scheduled( google_civic_election_id=google_civic_election_id, state_code=state_code, kind_of_process=REFRESH_BALLOT_ITEMS_FROM_POLLING_LOCATIONS): status += "(" + str(state_code) + ")-ALREADY_SCHEDULED_REFRESH_BALLOT_ITEMS_FROM_POLLING_LOCATIONS " else: results = schedule_retrieve_ballotpedia_ballots_for_polling_locations_api_v4( google_civic_election_id=google_civic_election_id, state_code=state_code, refresh_ballot_returned=True) if not positive_value_exists(results['success']): status += results['status'] # Refresh based on voter's who requested their own address if batch_process_manager.is_batch_process_currently_scheduled( google_civic_election_id=google_civic_election_id, state_code=state_code, kind_of_process=REFRESH_BALLOT_ITEMS_FROM_VOTERS): status += "(" + str(state_code) + ")-ALREADY_SCHEDULED_REFRESH_BALLOT_ITEMS_FROM_VOTERS " else: results = schedule_refresh_ballotpedia_ballots_for_voters_api_v4( google_civic_election_id=google_civic_election_id, state_code=state_code) if not positive_value_exists(results['success']): status += results['status'] # Retrieve first time for each polling location if batch_process_manager.is_batch_process_currently_scheduled( google_civic_election_id=google_civic_election_id, state_code=state_code, kind_of_process=RETRIEVE_BALLOT_ITEMS_FROM_POLLING_LOCATIONS): status += "(" + str(state_code) + ")-ALREADY_SCHEDULED_RETRIEVE_BALLOT_ITEMS_FROM_POLLING_LOCATIONS " else: results = schedule_retrieve_ballotpedia_ballots_for_polling_locations_api_v4( google_civic_election_id=google_civic_election_id, state_code=state_code, refresh_ballot_returned=False) if not positive_value_exists(results['success']): status += results['status'] messages.add_message(request, messages.INFO, status) return HttpResponseRedirect(reverse('import_export_batches:batch_process_list', args=())) @login_required def retrieve_ballotpedia_ballots_for_polling_locations_api_v4_view(request): """ This is different than retrieve_ballotpedia_data_for_polling_locations_view because it is getting the districts from lat/long, and then the ballot items. Ballotpedia API v4 Reach out to Ballotpedia and retrieve (for one election): 1) Polling locations (so we can use those addresses to retrieve a representative set of ballots) 2) Cycle through a portion of those polling locations, enough that we are caching all of the possible ballot items :param request: :return: """ status = "" # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) state_code = request.GET.get('state_code', '') refresh_ballot_returned = request.GET.get('refresh_ballot_returned', False) use_batch_process = request.GET.get('use_batch_process', False) # import_limit = convert_to_int(request.GET.get('import_limit', 1000)) # If > 1000, we get error 414 (url too long) if positive_value_exists(use_batch_process): results = schedule_retrieve_ballotpedia_ballots_for_polling_locations_api_v4( google_civic_election_id=google_civic_election_id, state_code=state_code, refresh_ballot_returned=refresh_ballot_returned) messages.add_message(request, messages.INFO, results['status']) return HttpResponseRedirect(reverse('import_export_batches:batch_process_list', args=()) + '?google_civic_election_id=' + str(google_civic_election_id) + '&state_code=' + str(state_code) ) else: return retrieve_ballotpedia_ballots_for_polling_locations_api_v4_internal_view( request=request, from_browser=True, google_civic_election_id=google_civic_election_id, state_code=state_code, refresh_ballot_returned=refresh_ballot_returned) def retrieve_ballotpedia_ballots_for_polling_locations_api_v4_internal_view( request=None, from_browser=False, google_civic_election_id="", state_code="", refresh_ballot_returned=False, date_last_updated_should_not_exceed=None, batch_process_ballot_item_chunk=None): status = "" success = True batch_process_id = 0 batch_process_ballot_item_chunk_id = 0 batch_set_id = 0 retrieve_row_count = 0 ballot_returned_manager = BallotReturnedManager() try: if positive_value_exists(google_civic_election_id): election_on_stage = Election.objects.using('readonly').get(google_civic_election_id=google_civic_election_id) ballotpedia_election_id = election_on_stage.ballotpedia_election_id election_day_text = election_on_stage.election_day_text election_local_id = election_on_stage.id election_state_code = election_on_stage.get_election_state() election_name = election_on_stage.election_name is_national_election = election_on_stage.is_national_election else: message = 'Could not retrieve (as opposed to refresh) Ballotpedia ballots. ' \ 'Missing google_civic_election_id. ' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results except Election.MultipleObjectsReturned as e: message = 'Could not retrieve (as opposed to refresh) Ballotpedia ballots. ' \ 'More than one election found. ' + str(e) + ' ' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results except Election.DoesNotExist: message = 'Could not retrieve (as opposed to refresh) Ballotpedia ballots. Election could not be found. ' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results except Exception as e: message = 'Could not retrieve (as opposed to refresh) Ballotpedia ballots. ERROR: ' + str(e) + ' ' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results # Check to see if we have polling location data related to the region(s) covered by this election # We request the ballot data for each polling location as a way to build up our local data if not positive_value_exists(state_code) and positive_value_exists(google_civic_election_id): state_code = election_state_code if positive_value_exists(is_national_election) and not positive_value_exists(state_code): message = \ 'For National elections, a State Code is required in order to run any Ballotpedia ballots preparation. ' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results try: ballot_returned_list_manager = BallotReturnedListManager() if positive_value_exists(refresh_ballot_returned): limit_polling_locations_retrieved = MAP_POINTS_RETRIEVED_EACH_BATCH_CHUNK # 125. Formerly 250 and 111 else: limit_polling_locations_retrieved = 0 # Retrieve polling locations already in ballot_returned table if positive_value_exists(is_national_election) and positive_value_exists(state_code): status += "NATIONAL_WITH_STATE (" + str(state_code) + ") " status += "date_last_updated_should_not_exceed: " + str(date_last_updated_should_not_exceed) + ' ' results = ballot_returned_list_manager.retrieve_polling_location_we_vote_id_list_from_ballot_returned( google_civic_election_id=google_civic_election_id, state_code=state_code, limit=limit_polling_locations_retrieved, date_last_updated_should_not_exceed=date_last_updated_should_not_exceed, ) else: status += "WITHOUT_STATE " status += "date_last_updated_should_not_exceed: " + str(date_last_updated_should_not_exceed) + ' ' results = ballot_returned_list_manager.retrieve_polling_location_we_vote_id_list_from_ballot_returned( google_civic_election_id=google_civic_election_id, limit=limit_polling_locations_retrieved, date_last_updated_should_not_exceed=date_last_updated_should_not_exceed, ) status += results['status'] if results['polling_location_we_vote_id_list_found']: polling_location_we_vote_id_list = results['polling_location_we_vote_id_list'] else: polling_location_we_vote_id_list = [] status += "REFRESH_BALLOT_RETURNED: " + str(refresh_ballot_returned) + " " if positive_value_exists(refresh_ballot_returned): polling_location_query = PollingLocation.objects.using('readonly').all() polling_location_query = polling_location_query.filter(we_vote_id__in=polling_location_we_vote_id_list) # We don't exclude the deleted polling locations because we need to know to delete the ballot returned entry # polling_location_query = polling_location_query.exclude(polling_location_deleted=True) polling_location_list = list(polling_location_query) polling_location_count = len(polling_location_list) else: polling_location_query = PollingLocation.objects.using('readonly').all() polling_location_query = \ polling_location_query.exclude(Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_query = \ polling_location_query.exclude(Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) polling_location_query = polling_location_query.filter(state__iexact=state_code) # Exclude polling locations already retrieved polling_location_query = polling_location_query.exclude(we_vote_id__in=polling_location_we_vote_id_list) # We don't exclude the deleted polling locations because we need to know to delete the ballot returned entry # polling_location_query = polling_location_query.exclude(polling_location_deleted=True) # Randomly change the sort order so we over time load different polling locations (before timeout) random_sorting = random.randint(1, 5) first_retrieve_limit = MAP_POINTS_RETRIEVED_EACH_BATCH_CHUNK # 125. Formerly 250 and 111 if random_sorting == 1: # Ordering by "line1" creates a bit of (locational) random order polling_location_list = polling_location_query.order_by('line1')[:first_retrieve_limit] status += "RANDOM_SORTING-LINE1-ASC: " + str(random_sorting) + " " elif random_sorting == 2: polling_location_list = polling_location_query.order_by('-line1')[:first_retrieve_limit] status += "RANDOM_SORTING-LINE1-DESC: " + str(random_sorting) + " " elif random_sorting == 3: polling_location_list = polling_location_query.order_by('city')[:first_retrieve_limit] status += "RANDOM_SORTING-CITY-ASC: " + str(random_sorting) + " " else: polling_location_list = polling_location_query.order_by('-city')[:first_retrieve_limit] status += "RANDOM_SORTING-CITY-DESC: " + str(random_sorting) + " " polling_location_count = len(polling_location_list) # Cycle through -- if the polling_location is deleted, delete the associated ballot_returned, # and then remove the polling_location from the list modified_polling_location = [] for one_polling_location in polling_location_list: if positive_value_exists(one_polling_location.polling_location_deleted): delete_results = ballot_returned_manager.delete_ballot_returned_by_identifier( google_civic_election_id=google_civic_election_id, polling_location_we_vote_id=one_polling_location.we_vote_id) if delete_results['ballot_deleted']: status += "BR_PL_DELETED (" + str(one_polling_location.we_vote_id) + ") " else: status += "BR_PL_NOT_DELETED (" + str(one_polling_location.we_vote_id) + ") " else: modified_polling_location.append(one_polling_location) polling_location_list = modified_polling_location polling_location_count = len(polling_location_list) except PollingLocation.DoesNotExist: message = 'Could not retrieve (as opposed to refresh) ballot data for the {election_name}. ' \ 'Ballotpedia Ballots-No polling locations exist for the state \'{state}\'. ' \ ''.format( election_name=election_name, state=state_code) if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results except Exception as e: message = 'Could not retrieve (as opposed to refresh) ballot data for the {election_name}. ' \ 'Ballotpedia Ballots-No polling locations exist for the state \'{state}\'. ERROR: {error}' \ ''.format( election_name=election_name, error=str(e), state=state_code) if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results if polling_location_count == 0: message = 'Did not retrieve (as opposed to refresh) ballot data for the {election_name}. ' \ 'Data for all polling locations for the state \'{state}\' has been retrieved once ' \ 'date_last_updated_should_not_exceed: \'{date_last_updated_should_not_exceed}\'. ' \ '(result 2 - retrieve_ballotpedia_ballots_for_polling_locations_api_v4_view)'.format( election_name=election_name, date_last_updated_should_not_exceed=date_last_updated_should_not_exceed, state=state_code) if from_browser: messages.add_message(request, messages.INFO, message) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) else: status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results # If here, we know that we have some polling_locations to use in order to retrieve ballotpedia districts ballots_retrieved = 0 ballots_not_retrieved = 0 # If here, we assume we have already retrieved races for this election, and now we want to # put ballot items for this location onto a ballot existing_offices_by_election_dict = {} existing_office_objects_dict = {} existing_candidate_objects_dict = {} existing_measure_objects_dict = {} new_office_we_vote_ids_list = [] new_candidate_we_vote_ids_list = [] new_measure_we_vote_ids_list = [] batch_set_id = 0 if len(polling_location_list) > 0: status += "POLLING_LOCATIONS_FOR_THIS_BATCH_SET: " + str(len(polling_location_list)) + " " # Create Batch Set for ballot items import_date = date.today() batch_set_name = "Ballot items (from Map Points v4) for " + election_name if positive_value_exists(state_code): batch_set_name += " (state " + str(state_code.upper()) + ")" if positive_value_exists(ballotpedia_election_id): batch_set_name += " - ballotpedia: " + str(ballotpedia_election_id) batch_set_name += " - " + str(import_date) try: batch_process_ballot_item_chunk_id = batch_process_ballot_item_chunk.id batch_process_id = batch_process_ballot_item_chunk.batch_process_id batch_set_id = batch_process_ballot_item_chunk.batch_set_id except Exception as e: status += "BATCH_PROCESS_BALLOT_ITEM_CHUNK: " + str(e) + ' ' if not positive_value_exists(batch_set_id): # create batch_set object try: batch_set = BatchSet.objects.create( batch_set_description_text="", batch_set_name=batch_set_name, batch_set_source=BATCH_SET_SOURCE_IMPORT_BALLOTPEDIA_BALLOT_ITEMS, batch_process_id=batch_process_id, batch_process_ballot_item_chunk_id=batch_process_ballot_item_chunk_id, google_civic_election_id=google_civic_election_id, source_uri=BALLOTPEDIA_API_SAMPLE_BALLOT_RESULTS_URL, import_date=import_date, state_code=state_code) batch_set_id = batch_set.id status += " BATCH_SET_CREATED-BALLOTS_FOR_POLLING_LOCATIONS " except Exception as e: # Stop trying to save rows -- break out of the for loop status += " EXCEPTION_BATCH_SET " + str(e) + " " handle_exception(e, logger=logger, exception_message=status) success = False try: if positive_value_exists(batch_process_ballot_item_chunk_id) and positive_value_exists(batch_set_id): batch_process_ballot_item_chunk.batch_set_id = batch_set_id batch_process_ballot_item_chunk.save() except Exception as e: status += "UNABLE_TO_SAVE_BATCH_SET_ID_EARLY " + str(e) + " " handle_exception(e, logger=logger, exception_message=status) if success: for polling_location in polling_location_list: one_ballot_results = retrieve_ballot_items_from_polling_location_api_v4( google_civic_election_id, election_day_text=election_day_text, polling_location_we_vote_id=polling_location.we_vote_id, polling_location=polling_location, state_code=state_code, batch_set_id=batch_set_id, existing_offices_by_election_dict=existing_offices_by_election_dict, existing_office_objects_dict=existing_office_objects_dict, existing_candidate_objects_dict=existing_candidate_objects_dict, existing_measure_objects_dict=existing_measure_objects_dict, new_office_we_vote_ids_list=new_office_we_vote_ids_list, new_candidate_we_vote_ids_list=new_candidate_we_vote_ids_list, new_measure_we_vote_ids_list=new_measure_we_vote_ids_list ) if one_ballot_results['success']: success = True existing_offices_by_election_dict = one_ballot_results['existing_offices_by_election_dict'] existing_office_objects_dict = one_ballot_results['existing_office_objects_dict'] existing_candidate_objects_dict = one_ballot_results['existing_candidate_objects_dict'] existing_measure_objects_dict = one_ballot_results['existing_measure_objects_dict'] new_office_we_vote_ids_list = one_ballot_results['new_office_we_vote_ids_list'] new_candidate_we_vote_ids_list = one_ballot_results['new_candidate_we_vote_ids_list'] new_measure_we_vote_ids_list = one_ballot_results['new_measure_we_vote_ids_list'] if one_ballot_results['batch_header_id']: ballots_retrieved += 1 if ballots_retrieved < 5: status += "BALLOT_ITEMS_RETRIEVED: [[[" + one_ballot_results['status'] + "]]] " else: ballots_not_retrieved += 1 if ballots_not_retrieved < 5: status += "BALLOT_ITEMS_NOT_RETRIEVED: [[[" + one_ballot_results['status'] + "]]] " else: status += "CANNOT_CALL_RETRIEVE_BECAUSE_OF_ERRORS [retrieve_ballot_items_from_polling_location_api_v4] " retrieve_row_count = ballots_retrieved if google_civic_election_id in existing_offices_by_election_dict: existing_offices_found = len(existing_offices_by_election_dict[google_civic_election_id]) else: existing_offices_found = len(existing_office_objects_dict) existing_candidates_found = len(existing_candidate_objects_dict) existing_measures_found = len(existing_measure_objects_dict) new_offices_found = len(new_office_we_vote_ids_list) new_candidates_found = len(new_candidate_we_vote_ids_list) new_measures_found = len(new_measure_we_vote_ids_list) if from_browser: messages.add_message(request, messages.INFO, 'Ballot data retrieved from Ballotpedia (Map Points) for the {election_name}. ' 'ballots retrieved: {ballots_retrieved}, ' 'ballots NOT retrieved: {ballots_not_retrieved}. ' 'new offices: {new_offices_found} (existing: {existing_offices_found}) ' 'new candidates: {new_candidates_found} (existing: {existing_candidates_found}) ' 'new measures: {new_measures_found} (existing: {existing_measures_found}) ' ''.format( ballots_retrieved=ballots_retrieved, ballots_not_retrieved=ballots_not_retrieved, election_name=election_name, existing_offices_found=existing_offices_found, existing_candidates_found=existing_candidates_found, existing_measures_found=existing_measures_found, new_offices_found=new_offices_found, new_candidates_found=new_candidates_found, new_measures_found=new_measures_found, )) messages.add_message(request, messages.INFO, 'status: {status}'.format(status=status)) return HttpResponseRedirect(reverse('import_export_batches:batch_set_list', args=()) + '?kind_of_batch=IMPORT_BALLOTPEDIA_BALLOT_ITEMS' + '&google_civic_election_id=' + str(google_civic_election_id)) else: status += \ 'Ballot data retrieved from Ballotpedia (Map Points) for the {election_name}. ' \ 'ballots retrieved: {ballots_retrieved}. ' \ 'ballots NOT retrieved: {ballots_not_retrieved}. ' \ 'new offices: {new_offices_found} (existing: {existing_offices_found}) ' \ 'new candidates: {new_candidates_found} (existing: {existing_candidates_found}) ' \ 'new measures: {new_measures_found} (existing: {existing_measures_found}) ' \ ''.format( ballots_retrieved=ballots_retrieved, ballots_not_retrieved=ballots_not_retrieved, election_name=election_name, existing_offices_found=existing_offices_found, existing_candidates_found=existing_candidates_found, existing_measures_found=existing_measures_found, new_offices_found=new_offices_found, new_candidates_found=new_candidates_found, new_measures_found=new_measures_found, ) results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, 'batch_process_ballot_item_chunk': batch_process_ballot_item_chunk, } return results @login_required def refresh_ballotpedia_ballots_for_voters_api_v4_view(request): """ :param request: :return: """ # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) state_code = request.GET.get('state_code', '') use_batch_process = request.GET.get('use_batch_process', False) if positive_value_exists(use_batch_process): results = schedule_refresh_ballotpedia_ballots_for_voters_api_v4( google_civic_election_id=google_civic_election_id, state_code=state_code) messages.add_message(request, messages.INFO, results['status']) return HttpResponseRedirect(reverse('import_export_batches:batch_process_list', args=()) + '?google_civic_election_id=' + str(google_civic_election_id) + '&state_code=' + str(state_code) ) else: return refresh_ballotpedia_ballots_for_voters_api_v4_internal_view( request=request, from_browser=True, google_civic_election_id=google_civic_election_id, state_code=state_code) def refresh_ballotpedia_ballots_for_voters_api_v4_internal_view( request=None, from_browser=False, google_civic_election_id="", state_code="", date_last_updated_should_not_exceed=None, batch_process_ballot_item_chunk=None): status = "" success = True batch_process_id = 0 batch_process_ballot_item_chunk_id = 0 batch_set_id = 0 retrieve_row_count = 0 try: if positive_value_exists(google_civic_election_id): election_on_stage = Election.objects.using('readonly').get(google_civic_election_id=google_civic_election_id) ballotpedia_election_id = election_on_stage.ballotpedia_election_id election_day_text = election_on_stage.election_day_text election_local_id = election_on_stage.id election_state_code = election_on_stage.get_election_state() election_name = election_on_stage.election_name is_national_election = election_on_stage.is_national_election else: message = 'Could not retrieve Ballotpedia ballots. Missing google_civic_election_id.' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results except Election.MultipleObjectsReturned as e: message = 'Could not retrieve Ballotpedia ballots. More than one election found.' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results except Election.DoesNotExist: message = 'Could not retrieve Ballotpedia ballots. Election could not be found.' if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_list', args=())) else: success = False status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results # Check to see if we have polling location data related to the region(s) covered by this election # We request the ballot data for each polling location as a way to build up our local data if not positive_value_exists(state_code) and positive_value_exists(google_civic_election_id): state_code = election_state_code # if positive_value_exists(is_national_election) and not positive_value_exists(state_code): # messages.add_message(request, messages.ERROR, # 'For National elections, a State Code is required in order to run any ' # 'Ballotpedia ballots preparation.') # return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) ballot_returned_list_manager = BallotReturnedListManager() limit_voters_retrieved = MAP_POINTS_RETRIEVED_EACH_BATCH_CHUNK # 125. Formerly 250 and 111 # Retrieve voter_id entries from ballot_returned table, from oldest to newest if positive_value_exists(is_national_election) and positive_value_exists(state_code): results = ballot_returned_list_manager.retrieve_ballot_returned_list( google_civic_election_id=google_civic_election_id, for_voters=True, state_code=state_code, date_last_updated_should_not_exceed=date_last_updated_should_not_exceed, limit=limit_voters_retrieved) else: results = ballot_returned_list_manager.retrieve_ballot_returned_list( google_civic_election_id=google_civic_election_id, for_voters=True, date_last_updated_should_not_exceed=date_last_updated_should_not_exceed, limit=limit_voters_retrieved) if results['ballot_returned_list_found']: ballot_returned_list = results['ballot_returned_list'] else: ballot_returned_list = [] if len(ballot_returned_list) == 0: message = 'No ballot_returned items found for {election_name} for the state \'{state}\' earlier than ' \ 'date_last_updated_should_not_exceed: \'{date_last_updated_should_not_exceed}\'. ' \ '(refresh_ballotpedia_ballots_for_voters_api_v4_internal_view)'.format( election_name=election_name, date_last_updated_should_not_exceed=date_last_updated_should_not_exceed, state=state_code) if from_browser: messages.add_message(request, messages.ERROR, message) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) else: status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, } return results # If here, we know that we have some polling_locations to use in order to retrieve ballotpedia districts ballots_retrieved = 0 ballots_not_retrieved = 0 # If here, we assume we have already retrieved races for this election, and now we want to # put ballot items for this location onto a ballot existing_offices_by_election_dict = {} existing_office_objects_dict = {} existing_candidate_objects_dict = {} existing_measure_objects_dict = {} new_office_we_vote_ids_list = [] new_candidate_we_vote_ids_list = [] new_measure_we_vote_ids_list = [] batch_set_id = 0 # Create Batch Set for ballot items import_date = date.today() batch_set_name = "Ballot items (from Voters v4) for " + election_name if positive_value_exists(state_code): batch_set_name += " (state " + str(state_code.upper()) + ")" if positive_value_exists(ballotpedia_election_id): batch_set_name += " - ballotpedia: " + str(ballotpedia_election_id) batch_set_name += " - " + str(import_date) try: batch_process_ballot_item_chunk_id = batch_process_ballot_item_chunk.id batch_process_id = batch_process_ballot_item_chunk.batch_process_id batch_set_id = batch_process_ballot_item_chunk.batch_set_id except Exception as e: pass if not positive_value_exists(batch_set_id): # create batch_set object try: batch_set = BatchSet.objects.create(batch_set_description_text="", batch_set_name=batch_set_name, batch_set_source=BATCH_SET_SOURCE_IMPORT_BALLOTPEDIA_BALLOT_ITEMS, batch_process_ballot_item_chunk_id=batch_process_ballot_item_chunk_id, batch_process_id=batch_process_id, google_civic_election_id=google_civic_election_id, source_uri=BALLOTPEDIA_API_SAMPLE_BALLOT_RESULTS_URL, import_date=import_date, state_code=state_code) batch_set_id = batch_set.id if positive_value_exists(batch_set_id): status += " BATCH_SET_SAVED-BALLOTS_FOR_VOTERS " except Exception as e: # Stop trying to save rows -- break out of the for loop status += " EXCEPTION_BATCH_SET " + str(e) + " " try: if positive_value_exists(batch_process_ballot_item_chunk_id): batch_process_ballot_item_chunk.batch_set_id = batch_set_id batch_process_ballot_item_chunk.save() except Exception as e: status += "UNABLE_TO_SAVE_BATCH_SET_ID_EARLY " + str(e) + " " for ballot_returned in ballot_returned_list: one_ballot_results = retrieve_ballot_items_for_one_voter_api_v4( google_civic_election_id, election_day_text=election_day_text, ballot_returned=ballot_returned, state_code=state_code, batch_set_id=batch_set_id, existing_offices_by_election_dict=existing_offices_by_election_dict, existing_office_objects_dict=existing_office_objects_dict, existing_candidate_objects_dict=existing_candidate_objects_dict, existing_measure_objects_dict=existing_measure_objects_dict, new_office_we_vote_ids_list=new_office_we_vote_ids_list, new_candidate_we_vote_ids_list=new_candidate_we_vote_ids_list, new_measure_we_vote_ids_list=new_measure_we_vote_ids_list ) success = False if one_ballot_results['success']: success = True if len(status) < 1024: status += one_ballot_results['status'] existing_offices_by_election_dict = one_ballot_results['existing_offices_by_election_dict'] existing_office_objects_dict = one_ballot_results['existing_office_objects_dict'] existing_candidate_objects_dict = one_ballot_results['existing_candidate_objects_dict'] existing_measure_objects_dict = one_ballot_results['existing_measure_objects_dict'] new_office_we_vote_ids_list = one_ballot_results['new_office_we_vote_ids_list'] new_candidate_we_vote_ids_list = one_ballot_results['new_candidate_we_vote_ids_list'] new_measure_we_vote_ids_list = one_ballot_results['new_measure_we_vote_ids_list'] if success: ballots_retrieved += 1 else: ballots_not_retrieved += 1 existing_offices_found = 0 if google_civic_election_id in existing_offices_by_election_dict: existing_offices_found = len(existing_offices_by_election_dict[google_civic_election_id]) existing_offices_found = len(existing_office_objects_dict) existing_candidates_found = len(existing_candidate_objects_dict) existing_measures_found = len(existing_measure_objects_dict) new_offices_found = len(new_office_we_vote_ids_list) new_candidates_found = len(new_candidate_we_vote_ids_list) new_measures_found = len(new_measure_we_vote_ids_list) retrieve_row_count = ballots_retrieved message = \ 'Ballot data retrieved from Ballotpedia (Voters) for the {election_name}. ' \ 'ballots retrieved: {ballots_retrieved}. ' \ 'ballots not retrieved: {ballots_not_retrieved}. ' \ 'new offices: {new_offices_found} (existing: {existing_offices_found}) ' \ 'new candidates: {new_candidates_found} (existing: {existing_candidates_found}) ' \ 'new measures: {new_measures_found} (existing: {existing_measures_found}) ' \ ''.format( ballots_retrieved=ballots_retrieved, ballots_not_retrieved=ballots_not_retrieved, election_name=election_name, existing_offices_found=existing_offices_found, existing_candidates_found=existing_candidates_found, existing_measures_found=existing_measures_found, new_offices_found=new_offices_found, new_candidates_found=new_candidates_found, new_measures_found=new_measures_found, ) if from_browser: messages.add_message(request, messages.INFO, message) messages.add_message(request, messages.INFO, 'status: {status}'.format(status=status)) return HttpResponseRedirect(reverse('import_export_batches:batch_set_list', args=()) + '?kind_of_batch=IMPORT_BALLOTPEDIA_BALLOT_ITEMS' + '&google_civic_election_id=' + str(google_civic_election_id)) else: status += message + " " results = { 'status': status, 'success': success, 'batch_set_id': batch_set_id, 'retrieve_row_count': retrieve_row_count, 'batch_process_ballot_item_chunk': batch_process_ballot_item_chunk, } return results @login_required def retrieve_ballotpedia_data_for_polling_locations_view(request, election_local_id=0): """ Reach out to Ballotpedia and retrieve (for one election): 1) Polling locations (so we can use those addresses to retrieve a representative set of ballots) 2) Cycle through a portion of those polling locations, enough that we are caching all of the possible ballot items :param request: :param election_local_id: :return: """ # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer authority_required = {'political_data_manager'} if not voter_has_authority(request, authority_required): return redirect_to_sign_in_page(request, authority_required) force_district_retrieve_from_ballotpedia = request.GET.get('force_district_retrieve_from_ballotpedia', False) state_code = request.GET.get('state_code', '') retrieve_races = positive_value_exists(request.GET.get('retrieve_races', False)) retrieve_measures = positive_value_exists(request.GET.get('retrieve_measures', False)) import_limit = convert_to_int(request.GET.get('import_limit', 1000)) # If > 1000, we get error 414 (url too long) polling_location_list = [] polling_location_count = 0 status = "" try: if positive_value_exists(election_local_id): election_on_stage = Election.objects.get(id=election_local_id) ballotpedia_election_id = election_on_stage.ballotpedia_election_id google_civic_election_id = election_on_stage.google_civic_election_id election_state_code = election_on_stage.get_election_state() election_name = election_on_stage.election_name is_national_election = election_on_stage.is_national_election else: messages.add_message(request, messages.ERROR, 'Could not retrieve Ballotpedia data. Missing election_local_id.') return HttpResponseRedirect(reverse('election:election_list', args=())) except Election.MultipleObjectsReturned as e: messages.add_message(request, messages.ERROR, 'Could not retrieve Ballotpedia data. ' 'More than one election found.') return HttpResponseRedirect(reverse('election:election_list', args=())) except Election.DoesNotExist: messages.add_message(request, messages.ERROR, 'Could not retrieve Ballotpedia data. ' 'Election could not be found.') return HttpResponseRedirect(reverse('election:election_list', args=())) # Check to see if we have polling location data related to the region(s) covered by this election # We request the ballot data for each polling location as a way to build up our local data if not positive_value_exists(state_code) and positive_value_exists(google_civic_election_id): state_code = election_state_code if positive_value_exists(is_national_election) and not positive_value_exists(state_code): messages.add_message(request, messages.ERROR, 'For National elections, a State Code is required in order to run any ' 'Ballotpedia data preparation.') return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) try: polling_location_count_query = PollingLocation.objects.all() polling_location_count_query = polling_location_count_query.filter(state__iexact=state_code) polling_location_count_query = polling_location_count_query.filter(use_for_bulk_retrieve=True) polling_location_count_query = polling_location_count_query.exclude(polling_location_deleted=True) polling_location_count = polling_location_count_query.count() if positive_value_exists(polling_location_count): polling_location_query = PollingLocation.objects.all() polling_location_query = polling_location_query.filter(state__iexact=state_code) polling_location_query = polling_location_query.filter(use_for_bulk_retrieve=True) polling_location_query = polling_location_query.exclude(polling_location_deleted=True) # We used to have a limit of 500 ballots to pull per election, but now retrieve all # Ordering by "line1" creates a bit of (locational) random order polling_location_list = polling_location_query.order_by('line1')[:import_limit] except Exception as e: status += "COULD_NOT_FIND_POLLING_LOCATION_LIST " + str(e) + " " if polling_location_count == 0: # We didn't find any polling locations marked for bulk retrieve, so just retrieve up to the import_limit try: polling_location_count_query = PollingLocation.objects.all() polling_location_count_query = \ polling_location_count_query.exclude(Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_count_query = \ polling_location_count_query.exclude(Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) polling_location_count_query = polling_location_count_query.filter(state__iexact=state_code) polling_location_count_query = polling_location_count_query.exclude(polling_location_deleted=True) polling_location_count = polling_location_count_query.count() if positive_value_exists(polling_location_count): polling_location_query = PollingLocation.objects.all() polling_location_query = \ polling_location_query.exclude(Q(latitude__isnull=True) | Q(latitude__exact=0.0)) polling_location_query = \ polling_location_query.exclude(Q(zip_long__isnull=True) | Q(zip_long__exact='0') | Q(zip_long__exact='')) polling_location_query = polling_location_query.filter(state__iexact=state_code) polling_location_query = polling_location_query.exclude(polling_location_deleted=True) # Ordering by "line1" creates a bit of (locational) random order polling_location_list = polling_location_query.order_by('line1')[:import_limit] except PollingLocation.DoesNotExist: messages.add_message(request, messages.INFO, 'Could not retrieve ballot data for the {election_name}. ' 'No polling locations exist for the state \'{state}\'. ' 'Data needed from VIP.'.format( election_name=election_name, state=state_code)) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) if polling_location_count == 0: messages.add_message(request, messages.ERROR, 'Could not retrieve ballot data for the {election_name}. ' 'No polling locations returned for the state \'{state}\'. ' '(error 2 - retrieve_ballotpedia_data_for_polling_locations_view)'.format( election_name=election_name, state=state_code)) return HttpResponseRedirect(reverse('election:election_summary', args=(election_local_id,))) # If here, we know that we have some polling_locations to use in order to retrieve ballotpedia districts ballots_retrieved = 0 ballots_not_retrieved = 0 # Step though our set of polling locations, until we find one that contains a ballot. Some won't contain ballots # due to data quality issues. if retrieve_races or retrieve_measures or force_district_retrieve_from_ballotpedia: polling_locations_with_data = 0 polling_locations_without_data = 0 # If here we just want to retrieve the races for this election merged_district_list = [] for polling_location in polling_location_list: one_ballot_results = retrieve_ballotpedia_district_id_list_for_polling_location( google_civic_election_id, polling_location=polling_location, force_district_retrieve_from_ballotpedia=force_district_retrieve_from_ballotpedia) success = False if one_ballot_results['success']: success = True ballotpedia_district_id_list = one_ballot_results['ballotpedia_district_id_list'] if len(ballotpedia_district_id_list): for one_ballotpedia_district_id in ballotpedia_district_id_list: if one_ballotpedia_district_id not in merged_district_list: # Build up a list of ballotpedia districts that we need to retrieve races for merged_district_list.append(one_ballotpedia_district_id) if success: polling_locations_with_data += 1 else: polling_locations_without_data += 1 # Once we have a summary of all ballotpedia districts, we want to request all of the races or measures if len(merged_district_list): kind_of_batch = "Unknown" results = {} if retrieve_races: results = retrieve_ballotpedia_offices_by_district_from_api(google_civic_election_id, state_code, merged_district_list) kind_of_batch = "" if 'kind_of_batch' in results: kind_of_batch = results['kind_of_batch'] if not positive_value_exists(kind_of_batch): kind_of_batch = CONTEST_OFFICE status += results['status'] elif retrieve_measures: results = retrieve_ballotpedia_measures_by_district_from_api(google_civic_election_id, state_code, merged_district_list) kind_of_batch = "" if 'kind_of_batch' in results: kind_of_batch = results['kind_of_batch'] if not positive_value_exists(kind_of_batch): kind_of_batch = MEASURE status += results['status'] batch_header_id = 0 if 'batch_saved' in results and results['batch_saved']: messages.add_message(request, messages.INFO, kind_of_batch + ' import batch for {google_civic_election_id} election saved. ' 'status: {status}' ''.format(google_civic_election_id=google_civic_election_id, status=status)) batch_header_id = results['batch_header_id'] elif 'multiple_batches_found' in results and results['multiple_batches_found']: messages.add_message(request, messages.INFO, kind_of_batch + ' multiple import batches for {google_civic_election_id} election saved.' ' status: {status}' ''.format(google_civic_election_id=google_civic_election_id, status=status)) batch_header_id = results['batch_header_id'] # Go straight to the list of batches return HttpResponseRedirect(reverse('import_export_batches:batch_list', args=()) + "?kind_of_batch=" + str(kind_of_batch) + "&google_civic_election_id=" + str(google_civic_election_id)) elif 'batch_header_id' in results and results['batch_header_id']: messages.add_message(request, messages.INFO, kind_of_batch + ' import batch for {google_civic_election_id} election saved, ' 'batch_header_id. status: {status}' ''.format(google_civic_election_id=google_civic_election_id, status=status)) batch_header_id = results['batch_header_id'] else: messages.add_message(request, messages.ERROR, results['status']) if positive_value_exists(batch_header_id): # Go straight to the new batch return HttpResponseRedirect(reverse('import_export_batches:batch_action_list', args=()) + "?batch_header_id=" + str(batch_header_id) + "&kind_of_batch=" + str(kind_of_batch) + "&google_civic_election_id=" + str(google_civic_election_id)) else: if retrieve_races: # Go to the office listing page return HttpResponseRedirect(reverse('office:office_list', args=()) + "?google_civic_election_id=" + str(google_civic_election_id)) elif retrieve_measures: # Go to the measure listing page return HttpResponseRedirect(reverse('measure:measure_list', args=()) + "?google_civic_election_id=" + str(google_civic_election_id)) messages.add_message(request, messages.INFO, 'Races or measures retrieved from Ballotpedia for the {election_name}. ' 'polling_locations_with_data: {polling_locations_with_data}, ' 'polling_locations_without_data: {polling_locations_without_data}. ' ''.format( polling_locations_with_data=polling_locations_with_data, polling_locations_without_data=polling_locations_with_data, election_name=election_name)) return HttpResponseRedirect(reverse('import_export_batches:batch_set_list', args=()) + '?kind_of_batch=IMPORT_BALLOTPEDIA_BALLOT_ITEMS' + '&google_civic_election_id=' + str(google_civic_election_id)) else: # Create Batch Set for ballot items import_date = date.today() batch_set_id = 0 batch_set_name = "Ballotpedia ballot items (from Map Points v3) for " + election_name if positive_value_exists(state_code): batch_set_name += " (state " + str(state_code.upper()) + ")" if positive_value_exists(ballotpedia_election_id): batch_set_name += " - ballotpedia: " + str(ballotpedia_election_id) batch_set_name += " - " + str(import_date) # create batch_set object try: batch_set = BatchSet.objects.create(batch_set_description_text="", batch_set_name=batch_set_name, batch_set_source=BATCH_SET_SOURCE_IMPORT_BALLOTPEDIA_BALLOT_ITEMS, google_civic_election_id=google_civic_election_id, source_uri=BALLOTPEDIA_API_CONTAINS_URL, import_date=import_date, state_code=state_code) batch_set_id = batch_set.id if positive_value_exists(batch_set_id): status += " BATCH_SET_SAVED-POLLING_OLD " success = True except Exception as e: # Stop trying to save rows -- break out of the for loop status += " EXCEPTION_BATCH_SET " + str(e) + " " # If here, we assume we have already retrieved races for this election, and now we want to # put ballot items for this location onto a ballot for polling_location in polling_location_list: one_ballot_results = retrieve_ballot_items_from_polling_location( google_civic_election_id, polling_location=polling_location, batch_set_id=batch_set_id, state_code=state_code) success = False if one_ballot_results['success']: success = True if success: ballots_retrieved += 1 else: ballots_not_retrieved += 1 # We used to only retrieve up to 500 locations from each state, but we don't limit now # # Break out of this loop, assuming we have a minimum number of ballots with contests retrieved # # If we don't achieve the minimum number of ballots_with_contests_retrieved, break out at the emergency level # emergency = (ballots_retrieved + ballots_not_retrieved) >= (3 * number_of_polling_locations_to_retrieve) # if ((ballots_retrieved + ballots_not_retrieved) >= number_of_polling_locations_to_retrieve and # ballots_with_contests_retrieved > 20) or emergency: # break messages.add_message(request, messages.INFO, 'Ballot data retrieved from Ballotpedia v3 for the {election_name}. ' 'ballots retrieved: {ballots_retrieved}. ' 'ballots not retrieved: {ballots_not_retrieved}. ' ''.format( ballots_retrieved=ballots_retrieved, ballots_not_retrieved=ballots_not_retrieved, election_name=election_name)) return HttpResponseRedirect(reverse('import_export_batches:batch_set_list', args=()) + '?kind_of_batch=IMPORT_BALLOTPEDIA_BALLOT_ITEMS' + '&google_civic_election_id=' + str(google_civic_election_id)) # @login_required # def retrieve_ballotpedia_offices_by_election_from_api_view(request): # """ # Reach out to Ballotpedia API to retrieve offices. # """ # # admin, analytics_admin, partner_organization, political_data_manager, political_data_viewer, verified_volunteer # authority_required = {'political_data_manager'} # if not voter_has_authority(request, authority_required): # return redirect_to_sign_in_page(request, authority_required) # # google_civic_election_id = convert_to_int(request.GET.get('google_civic_election_id', 0)) # # results = retrieve_ballotpedia_offices_by_election_from_api(google_civic_election_id) # # kind_of_batch = "" # if 'kind_of_batch' in results: # kind_of_batch = results['kind_of_batch'] # if not positive_value_exists(kind_of_batch): # kind_of_batch = CONTEST_OFFICE # # batch_header_id = 0 # if 'batch_saved' in results and results['batch_saved']: # messages.add_message(request, messages.INFO, 'Import batch for {google_civic_election_id} election saved.' # ''.format(google_civic_election_id=google_civic_election_id)) # batch_header_id = results['batch_header_id'] # elif 'batch_header_id' in results and results['batch_header_id']: # messages.add_message(request, messages.INFO, 'Import batch for {google_civic_election_id} election saved, ' # 'batch_header_id.' # ''.format(google_civic_election_id=google_civic_election_id)) # batch_header_id = results['batch_header_id'] # else: # messages.add_message(request, messages.ERROR, results['status']) # # if positive_value_exists(batch_header_id): # # Go straight to the new batch # return HttpResponseRedirect(reverse('import_export_batches:batch_action_list', args=()) + # "?batch_header_id=" + str(batch_header_id) + # "&kind_of_batch=" + str(kind_of_batch) + # "&google_civic_election_id=" + str(google_civic_election_id)) # else: # # Go to the office listing page # return HttpResponseRedirect(reverse('office:office_list', args=()) + # "?google_civic_election_id=" + str(google_civic_election_id))
55.710542
121
0.658853
10,256
91,421
5.43711
0.040757
0.067249
0.054516
0.060255
0.896544
0.876513
0.861934
0.830551
0.818984
0.798702
0
0.003587
0.274138
91,421
1,640
122
55.744512
0.836737
0.122904
0
0.769585
0
0
0.151599
0.068797
0
0
0
0
0
1
0.008449
false
0.000768
0.053763
0
0.119816
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
5a6ba6c13c2981322f38f95cc5fd794275dd4991
2,600
py
Python
reversible_convolution.py
uthree/ReversibleConvolution
54b5b6209af268c0d6b8b2818baf93e28eaaeb8c
[ "MIT" ]
null
null
null
reversible_convolution.py
uthree/ReversibleConvolution
54b5b6209af268c0d6b8b2818baf93e28eaaeb8c
[ "MIT" ]
null
null
null
reversible_convolution.py
uthree/ReversibleConvolution
54b5b6209af268c0d6b8b2818baf93e28eaaeb8c
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import revtorch as rv # input: [batch_size, channels, height, width] # output: [batch_size, channels, height, width] class ReversibleConv2d(nn.Module): def __init__(self, channels, groups=1, num_layers=1): super(ReversibleConv2d, self).__init__() blocks = nn.ModuleList() for i in range(num_layers): blocks.append( rv.ReversibleBlock( nn.Sequential( nn.Conv2d(channels, channels, 3, padding=1, groups=groups, padding_mode="replicate"), nn.GELU(), ), nn.Sequential( nn.Conv2d(channels, channels, 3, padding=1, groups=groups, padding_mode="replicate"), nn.GELU(), ), split_along_dim=1 ) ) self.seq = rv.ReversibleSequence(blocks) def forward(self, x): x = torch.repeat_interleave(x, repeats=2, dim=1) x = self.seq(x) x1, x2 = torch.chunk(x, 2, dim=1) x = (x1 + x2) / 2 return x # input: [batch_size, channels, height, width] # output: [batch_size, channels, height, width] class ReversibleConvTranspose2d(nn.Module): def __init__(self, channels, groups=1, num_layers=1): super(ReversibleConvTranspose2d, self).__init__() blocks = nn.ModuleList() for i in range(num_layers): blocks.append( rv.ReversibleBlock( nn.Sequential( nn.Conv2d(channels, channels, 3, padding=0, groups=groups), nn.GELU(), nn.ConvTranspose2d(channels, channels, 3, padding=0, groups=groups), nn.GELU(), ), nn.Sequential( nn.Conv2d(channels, channels, 3, padding=0, groups=groups), nn.GELU(), nn.ConvTranspose2d(channels, channels, 3, padding=0, groups=groups), nn.GELU(), ), split_along_dim=1, ) ) self.seq = rv.ReversibleSequence(blocks) def forward(self, x): x = torch.repeat_interleave(x, repeats=2, dim=1) x = self.seq(x) x1, x2 = torch.chunk(x, 2, dim=1) x = (x1 + x2) / 2 return x
37.142857
110
0.496538
266
2,600
4.733083
0.225564
0.076251
0.081017
0.114376
0.859412
0.859412
0.859412
0.859412
0.859412
0.859412
0
0.029412
0.398462
2,600
69
111
37.681159
0.775575
0.069615
0
0.745763
0
0
0.007676
0
0
0
0
0
0
1
0.067797
false
0
0.084746
0
0.220339
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
5a8a6e97fc85a83d8862e84691a241ad01660a03
22,498
py
Python
buidl/test/test_helper.py
dhruvbansal/buidl-python
6c3a0ad91cc09c5720d97e950d89520b04b29a65
[ "MIT" ]
3
2021-09-11T22:19:41.000Z
2021-09-13T22:29:17.000Z
buidl/test/test_helper.py
Chilango21/buidl-python
ab47e9b281d947482930fc2e7f78731d31782fd9
[ "MIT" ]
null
null
null
buidl/test/test_helper.py
Chilango21/buidl-python
ab47e9b281d947482930fc2e7f78731d31782fd9
[ "MIT" ]
null
null
null
from unittest import TestCase from io import BytesIO from buidl.helper import ( bit_field_to_bytes, bytes_to_bit_field, bytes_to_str, decode_base58, encode_base58_checksum, decode_golomb, encode_golomb, decode_gcs, encode_gcs, encode_varstr, filter_null, hashed_items, hash256, int_to_little_endian, little_endian_to_int, merkle_parent, merkle_parent_level, merkle_root, pack_bits, read_varstr, _siphash, str_to_bytes, unpack_bits, ) class HelperTest(TestCase): def test_bytes(self): b = b"hello world" s = "hello world" self.assertEqual(b, str_to_bytes(s)) self.assertEqual(s, bytes_to_str(b)) def test_little_endian_to_int(self): h = bytes.fromhex("99c3980000000000") want = 10011545 self.assertEqual(little_endian_to_int(h), want) h = bytes.fromhex("a135ef0100000000") want = 32454049 self.assertEqual(little_endian_to_int(h), want) def test_int_to_little_endian(self): n = 1 want = b"\x01\x00\x00\x00" self.assertEqual(int_to_little_endian(n, 4), want) n = 10011545 want = b"\x99\xc3\x98\x00\x00\x00\x00\x00" self.assertEqual(int_to_little_endian(n, 8), want) def test_base58(self): addr = "mnrVtF8DWjMu839VW3rBfgYaAfKk8983Xf" h160 = decode_base58(addr).hex() want = "507b27411ccf7f16f10297de6cef3f291623eddf" self.assertEqual(h160, want) got = encode_base58_checksum(b"\x6f" + bytes.fromhex(h160)) self.assertEqual(got, addr) addr = "1111111111111111111114oLvT2" h160 = decode_base58(addr).hex() want = "0000000000000000000000000000000000000000" self.assertEqual(h160, want) got = encode_base58_checksum(b"\x00" + bytes.fromhex(h160)) self.assertEqual(got, addr) def test_encode_base58_checksum(self): raw = bytes.fromhex("005dedfbf9ea599dd4e3ca6a80b333c472fd0b3f69") want = "19ZewH8Kk1PDbSNdJ97FP4EiCjTRaZMZQA" self.assertEqual(encode_base58_checksum(raw), want) def test_merkle_parent(self): tx_hash0 = bytes.fromhex( "c117ea8ec828342f4dfb0ad6bd140e03a50720ece40169ee38bdc15d9eb64cf5" ) tx_hash1 = bytes.fromhex( "c131474164b412e3406696da1ee20ab0fc9bf41c8f05fa8ceea7a08d672d7cc5" ) want = bytes.fromhex( "8b30c5ba100f6f2e5ad1e2a742e5020491240f8eb514fe97c713c31718ad7ecd" ) self.assertEqual(merkle_parent(tx_hash0, tx_hash1), want) def test_merkle_parent_level(self): hex_hashes = [ "c117ea8ec828342f4dfb0ad6bd140e03a50720ece40169ee38bdc15d9eb64cf5", "c131474164b412e3406696da1ee20ab0fc9bf41c8f05fa8ceea7a08d672d7cc5", "f391da6ecfeed1814efae39e7fcb3838ae0b02c02ae7d0a5848a66947c0727b0", "3d238a92a94532b946c90e19c49351c763696cff3db400485b813aecb8a13181", "10092f2633be5f3ce349bf9ddbde36caa3dd10dfa0ec8106bce23acbff637dae", "7d37b3d54fa6a64869084bfd2e831309118b9e833610e6228adacdbd1b4ba161", "8118a77e542892fe15ae3fc771a4abfd2f5d5d5997544c3487ac36b5c85170fc", "dff6879848c2c9b62fe652720b8df5272093acfaa45a43cdb3696fe2466a3877", "b825c0745f46ac58f7d3759e6dc535a1fec7820377f24d4c2c6ad2cc55c0cb59", "95513952a04bd8992721e9b7e2937f1c04ba31e0469fbe615a78197f68f52b7c", "2e6d722e5e4dbdf2447ddecc9f7dabb8e299bae921c99ad5b0184cd9eb8e5908", ] tx_hashes = [bytes.fromhex(x) for x in hex_hashes] want_hex_hashes = [ "8b30c5ba100f6f2e5ad1e2a742e5020491240f8eb514fe97c713c31718ad7ecd", "7f4e6f9e224e20fda0ae4c44114237f97cd35aca38d83081c9bfd41feb907800", "ade48f2bbb57318cc79f3a8678febaa827599c509dce5940602e54c7733332e7", "68b3e2ab8182dfd646f13fdf01c335cf32476482d963f5cd94e934e6b3401069", "43e7274e77fbe8e5a42a8fb58f7decdb04d521f319f332d88e6b06f8e6c09e27", "1796cd3ca4fef00236e07b723d3ed88e1ac433acaaa21da64c4b33c946cf3d10", ] want_tx_hashes = [bytes.fromhex(x) for x in want_hex_hashes] self.assertEqual(merkle_parent_level(tx_hashes), want_tx_hashes) def test_merkle_root(self): hex_hashes = [ "c117ea8ec828342f4dfb0ad6bd140e03a50720ece40169ee38bdc15d9eb64cf5", "c131474164b412e3406696da1ee20ab0fc9bf41c8f05fa8ceea7a08d672d7cc5", "f391da6ecfeed1814efae39e7fcb3838ae0b02c02ae7d0a5848a66947c0727b0", "3d238a92a94532b946c90e19c49351c763696cff3db400485b813aecb8a13181", "10092f2633be5f3ce349bf9ddbde36caa3dd10dfa0ec8106bce23acbff637dae", "7d37b3d54fa6a64869084bfd2e831309118b9e833610e6228adacdbd1b4ba161", "8118a77e542892fe15ae3fc771a4abfd2f5d5d5997544c3487ac36b5c85170fc", "dff6879848c2c9b62fe652720b8df5272093acfaa45a43cdb3696fe2466a3877", "b825c0745f46ac58f7d3759e6dc535a1fec7820377f24d4c2c6ad2cc55c0cb59", "95513952a04bd8992721e9b7e2937f1c04ba31e0469fbe615a78197f68f52b7c", "2e6d722e5e4dbdf2447ddecc9f7dabb8e299bae921c99ad5b0184cd9eb8e5908", "b13a750047bc0bdceb2473e5fe488c2596d7a7124b4e716fdd29b046ef99bbf0", ] tx_hashes = [bytes.fromhex(x) for x in hex_hashes] want_hex_hash = ( "acbcab8bcc1af95d8d563b77d24c3d19b18f1486383d75a5085c4e86c86beed6" ) want_hash = bytes.fromhex(want_hex_hash) self.assertEqual(merkle_root(tx_hashes), want_hash) def test_bit_field_to_bytes(self): bit_field = [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, ] want = "4000600a080000010940" self.assertEqual(bit_field_to_bytes(bit_field).hex(), want) self.assertEqual(bytes_to_bit_field(bytes.fromhex(want)), bit_field) def test_varstr(self): to_encode = b"hello" want = b"\x05hello" self.assertEqual(encode_varstr(to_encode), want) stream = BytesIO(want) self.assertEqual(read_varstr(stream), to_encode) def test_siphash(self): zero_key = b"\x00" * 16 result = _siphash(zero_key, b"Hello world") want = 0xC9E8A3021F3822D9 self.assertEqual(result, want) result = _siphash(zero_key, b"") want = 0x1E924B9D737700D7 self.assertEqual(result, want) result = _siphash(zero_key, b"12345678123") want = 0xF95D77CCDB0649F self.assertEqual(result, want) test_key = bytes.fromhex("000102030405060708090a0b0c0d0e0f") result = _siphash(test_key, b"") want = 0x726FDB47DD0E0E31 self.assertEqual(result, want) result = _siphash(test_key, b"\x00") want = 0x74F839C593DC67FD self.assertEqual(result, want) with self.assertRaises(ValueError): _siphash(b"\x00" * 4, b"\x00") def test_golomb(self): tests = ( # x, p, want (0, 2, b"\x00"), (1, 2, b"\x20"), (2, 2, b"\x40"), (3, 2, b"\x60"), (4, 2, b"\x80"), (5, 2, b"\x90"), (6, 2, b"\xa0"), (7, 2, b"\xb0"), (8, 2, b"\xc0"), (9, 2, b"\xc8"), (0, 8, b"\x00\x00"), (1, 8, b"\x00\x80"), (2, 8, b"\x01\x00"), (128, 8, b"\x40\x00"), (256, 8, b"\x80\x00"), (257, 8, b"\x80\x40"), ) for x, p, want in tests: result = pack_bits(encode_golomb(x, p)) self.assertEqual(result, want) self.assertEqual(decode_golomb(unpack_bits(result), p), x) def test_hashed_items(self): from buidl.block import Block tests = [ # ["Block Height,Block Hash,Block,[Prev Output Scripts for Block],Previous Basic Header,Basic Filter,Basic Header,Notes"], [ 0, "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943", "0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff001d1aa4ae180101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000", [], "0000000000000000000000000000000000000000000000000000000000000000", "019dfca8", "21584579b7eb08997773e5aeff3a7f932700042d0ed2a6129012b7d7ae81b750", "Genesis block", ], [ 2, "000000006c02c8ea6e4ff69651f7fcde348fb9d557a06e6957b65552002a7820", "0100000006128e87be8b1b4dea47a7247d5528d2702c96826c7a648497e773b800000000e241352e3bec0a95a6217e10c3abb54adfa05abb12c126695595580fb92e222032e7494dffff001d00d235340101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0432e7494d010e062f503253482fffffffff0100f2052a010000002321038a7f6ef1c8ca0c588aa53fa860128077c9e6c11e6830f4d7ee4e763a56b7718fac00000000", [], "d7bdac13a59d745b1add0d2ce852f1a0442e8945fc1bf3848d3cbffd88c24fe1", "0174a170", "186afd11ef2b5e7e3504f2e8cbf8df28a1fd251fe53d60dff8b1467d1b386cf0", "", ], [ 3, "000000008b896e272758da5297bcd98fdc6d97c9b765ecec401e286dc1fdbe10", "0100000020782a005255b657696ea057d5b98f34defcf75196f64f6eeac8026c0000000041ba5afc532aae03151b8aa87b65e1594f97504a768e010c98c0add79216247186e7494dffff001d058dc2b60101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0486e7494d0151062f503253482fffffffff0100f2052a01000000232103f6d9ff4c12959445ca5549c811683bf9c88e637b222dd2e0311154c4c85cf423ac00000000", [], "186afd11ef2b5e7e3504f2e8cbf8df28a1fd251fe53d60dff8b1467d1b386cf0", "016cf7a0", "8d63aadf5ab7257cb6d2316a57b16f517bff1c6388f124ec4c04af1212729d2a", "", ], [ 49291, "0000000018b07dca1b28b4b5a119f6d6e71698ce1ed96f143f54179ce177a19c", "02000000abfaf47274223ca2fea22797e44498240e482cb4c2f2baea088962f800000000604b5b52c32305b15d7542071d8b04e750a547500005d4010727694b6e72a776e55d0d51ffff001d211806480201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0d038bc0000102062f503253482fffffffff01a078072a01000000232102971dd6034ed0cf52450b608d196c07d6345184fcb14deb277a6b82d526a6163dac0000000001000000081cefd96060ecb1c4fbe675ad8a4f8bdc61d634c52b3a1c4116dee23749fe80ff000000009300493046022100866859c21f306538152e83f115bcfbf59ab4bb34887a88c03483a5dff9895f96022100a6dfd83caa609bf0516debc2bf65c3df91813a4842650a1858b3f61cfa8af249014730440220296d4b818bb037d0f83f9f7111665f49532dfdcbec1e6b784526e9ac4046eaa602204acf3a5cb2695e8404d80bf49ab04828bcbe6fc31d25a2844ced7a8d24afbdff01ffffffff1cefd96060ecb1c4fbe675ad8a4f8bdc61d634c52b3a1c4116dee23749fe80ff020000009400483045022100e87899175991aa008176cb553c6f2badbb5b741f328c9845fcab89f8b18cae2302200acce689896dc82933015e7230e5230d5cff8a1ffe82d334d60162ac2c5b0c9601493046022100994ad29d1e7b03e41731a4316e5f4992f0d9b6e2efc40a1ccd2c949b461175c502210099b69fdc2db00fbba214f16e286f6a49e2d8a0d5ffc6409d87796add475478d601ffffffff1e4a6d2d280ea06680d6cf8788ac90344a9c67cca9b06005bbd6d3f6945c8272010000009500493046022100a27400ba52fd842ce07398a1de102f710a10c5599545e6c95798934352c2e4df022100f6383b0b14c9f64b6718139f55b6b9494374755b86bae7d63f5d3e583b57255a01493046022100fdf543292f34e1eeb1703b264965339ec4a450ec47585009c606b3edbc5b617b022100a5fbb1c8de8aaaa582988cdb23622838e38de90bebcaab3928d949aa502a65d401ffffffff1e4a6d2d280ea06680d6cf8788ac90344a9c67cca9b06005bbd6d3f6945c8272020000009400493046022100ac626ac3051f875145b4fe4cfe089ea895aac73f65ab837b1ac30f5d875874fa022100bc03e79fa4b7eb707fb735b95ff6613ca33adeaf3a0607cdcead4cfd3b51729801483045022100b720b04a5c5e2f61b7df0fcf334ab6fea167b7aaede5695d3f7c6973496adbf1022043328c4cc1cdc3e5db7bb895ccc37133e960b2fd3ece98350f774596badb387201ffffffff23a8733e349c97d6cd90f520fdd084ba15ce0a395aad03cd51370602bb9e5db3010000004a00483045022100e8556b72c5e9c0da7371913a45861a61c5df434dfd962de7b23848e1a28c86ca02205d41ceda00136267281be0974be132ac4cda1459fe2090ce455619d8b91045e901ffffffff6856d609b881e875a5ee141c235e2a82f6b039f2b9babe82333677a5570285a6000000006a473044022040a1c631554b8b210fbdf2a73f191b2851afb51d5171fb53502a3a040a38d2c0022040d11cf6e7b41fe1b66c3d08f6ada1aee07a047cb77f242b8ecc63812c832c9a012102bcfad931b502761e452962a5976c79158a0f6d307ad31b739611dac6a297c256ffffffff6856d609b881e875a5ee141c235e2a82f6b039f2b9babe82333677a5570285a601000000930048304502205b109df098f7e932fbf71a45869c3f80323974a826ee2770789eae178a21bfc8022100c0e75615e53ee4b6e32b9bb5faa36ac539e9c05fa2ae6b6de5d09c08455c8b9601483045022009fb7d27375c47bea23b24818634df6a54ecf72d52e0c1268fb2a2c84f1885de022100e0ed4f15d62e7f537da0d0f1863498f9c7c0c0a4e00e4679588c8d1a9eb20bb801ffffffffa563c3722b7b39481836d5edfc1461f97335d5d1e9a23ade13680d0e2c1c371f030000006c493046022100ecc38ae2b1565643dc3c0dad5e961a5f0ea09cab28d024f92fa05c922924157e022100ebc166edf6fbe4004c72bfe8cf40130263f98ddff728c8e67b113dbd621906a601210211a4ed241174708c07206601b44a4c1c29e5ad8b1f731c50ca7e1d4b2a06dc1fffffffff02d0223a00000000001976a91445db0b779c0b9fa207f12a8218c94fc77aff504588ac80f0fa02000000000000000000", [ "5221033423007d8f263819a2e42becaaf5b06f34cb09919e06304349d950668209eaed21021d69e2b68c3960903b702af7829fadcd80bd89b158150c85c4a75b2c8cb9c39452ae", "52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821021d69e2b68c3960903b702af7829fadcd80bd89b158150c85c4a75b2c8cb9c39452ae", "522102a7ae1e0971fc1689bd66d2a7296da3a1662fd21a53c9e38979e0f090a375c12d21022adb62335f41eb4e27056ac37d462cda5ad783fa8e0e526ed79c752475db285d52ae", "52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821022adb62335f41eb4e27056ac37d462cda5ad783fa8e0e526ed79c752475db285d52ae", "512103b9d1d0e2b4355ec3cdef7c11a5c0beff9e8b8d8372ab4b4e0aaf30e80173001951ae", "76a9149144761ebaccd5b4bbdc2a35453585b5637b2f8588ac", "522103f1848b40621c5d48471d9784c8174ca060555891ace6d2b03c58eece946b1a9121020ee5d32b54d429c152fdc7b1db84f2074b0564d35400d89d11870f9273ec140c52ae", "76a914f4fa1cc7de742d135ea82c17adf0bb9cf5f4fb8388ac", ], "ed47705334f4643892ca46396eb3f4196a5e30880589e4009ef38eae895d4a13", "0afbc2920af1b027f31f87b592276eb4c32094bb4d3697021b4c6380", "b6d98692cec5145f67585f3434ec3c2b3030182e1cb3ec58b855c5c164dfaaa3", "Tx pays to empty output script", ], [ 180480, "00000000fd3ceb2404ff07a785c7fdcc76619edc8ed61bd25134eaa22084366a", "020000006058aa080a655aa991a444bd7d1f2defd9a3bbe68aabb69030cf3b4e00000000d2e826bfd7ef0beaa891a7eedbc92cd6a544a6cb61c7bdaa436762eb2123ef9790f5f552ffff001d0002c90f0501000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0e0300c102024608062f503253482fffffffff01c0c6072a01000000232102e769e60137a4df6b0df8ebd387cca44c4c57ae74cc0114a8e8317c8f3bfd85e9ac00000000010000000381a0802911a01ffb025c4dea0bc77963e8c1bb46313b71164c53f72f37fe5248010000000151ffffffffc904b267833d215e2128bd9575242232ac2bc311550c7fc1f0ef6f264b40d14c010000000151ffffffffdf0915666649dba81886519c531649b7b02180b4af67d6885e871299e9d5f775000000000151ffffffff0180817dcb00000000232103bb52138972c48a132fc1f637858c5189607dd0f7fe40c4f20f6ad65f2d389ba4ac0000000001000000018da38b434fba82d66052af74fc5e4e94301b114d9bc03f819dc876398404c8b4010000006c493046022100fe738b7580dc5fb5168e51fc61b5aed211125eb71068031009a22d9bbad752c5022100be5086baa384d40bcab0fa586e4f728397388d86e18b66cc417dc4f7fa4f9878012103f233299455134caa2687bdf15cb0becdfb03bd0ff2ff38e65ec6b7834295c34fffffffff022ebc1400000000001976a9147779b7fba1c1e06b717069b80ca170e8b04458a488ac9879c40f000000001976a9142a0307cd925dbb66b534c4db33003dd18c57015788ac0000000001000000026139a62e3422a602de36c873a225c1d3ca5aeee598539ceecb9f0dc8d1ad0f83010000006b483045022100ad9f32b4a0a2ddc19b5a74eba78123e57616f1b3cfd72ce68c03ea35a3dda1f002200dbd22aa6da17213df5e70dfc3b2611d40f70c98ed9626aa5e2cde9d97461f0a012103ddb295d2f1e8319187738fb4b230fdd9aa29d0e01647f69f6d770b9ab24eea90ffffffff983c82c87cf020040d671956525014d5c2b28c6d948c85e1a522362c0059eeae010000006b4830450221009ca544274c786d30a5d5d25e17759201ea16d3aedddf0b9e9721246f7ef6b32e02202cfa5564b6e87dfd9fd98957820e4d4e6238baeb0f65fe305d91506bb13f5f4f012103c99113deac0d5d044e3ac0346abc02501542af8c8d3759f1382c72ff84e704f7ffffffff02c0c62d00000000001976a914ae19d27efe12f5a886dc79af37ad6805db6f922d88ac70ce2000000000001976a9143b8d051d37a07ea1042067e93efe63dbf73920b988ac000000000100000002be566e8cd9933f0c75c4a82c027f7d0c544d5c101d0607ef6ae5d07b98e7f1dc000000006b483045022036a8cdfd5ea7ebc06c2bfb6e4f942bbf9a1caeded41680d11a3a9f5d8284abad022100cacb92a5be3f39e8bc14db1710910ef7b395fa1e18f45d41c28d914fcdde33be012102bf59abf110b5131fae0a3ce1ec379329b4c896a6ae5d443edb68529cc2bc7816ffffffff96cf67645b76ceb23fe922874847456a15feee1655082ff32d25a6bf2c0dfc90000000006a47304402203471ca2001784a5ac0abab583581f2613523da47ec5f53df833c117b5abd81500220618a2847723d57324f2984678db556dbca1a72230fc7e39df04c2239942ba942012102925c9794fd7bb9f8b29e207d5fc491b1150135a21f505041858889fa4edf436fffffffff026c840f00000000001976a914797fb8777d7991d8284d88bfd421ce520f0f843188ac00ca9a3b000000001976a9146d10f3f592699265d10b106eda37c3ce793f7a8588ac00000000", [ "", "", "", "76a9142903b138c24be9e070b3e73ec495d77a204615e788ac", "76a91433a1941fd9a37b9821d376f5a51bd4b52fa50e2888ac", "76a914e4374e8155d0865742ca12b8d4d14d41b57d682f88ac", "76a914001fa7459a6cfc64bdc178ba7e7a21603bb2568f88ac", "76a914f6039952bc2b307aeec5371bfb96b66078ec17f688ac", ], "b109139671dbedc2b6fcd499a5480a7461ae458af8ff9411d819aa64ba6995d1", "0db414c859a07e8205876354a210a75042d0463404913d61a8e068e58a3ae2aa080026", "a0af77e0a7ed20ea78d2def3200cc24f08217dcd51755c7c7feb0e2ba8316c2d", "Tx spends from empty output script", ], [ 1263442, "000000006f27ddfe1dd680044a34548f41bed47eba9e6f0b310da21423bc5f33", "000000201c8d1a529c39a396db2db234d5ec152fa651a2872966daccbde028b400000000083f14492679151dbfaa1a825ef4c18518e780c1f91044180280a7d33f4a98ff5f45765aaddc001d38333b9a02010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff230352471300fe5f45765afe94690a000963676d696e6572343208000000000000000000ffffffff024423a804000000001976a914f2c25ac3d59f3d674b1d1d0a25c27339aaac0ba688ac0000000000000000266a24aa21a9edcb26cb3052426b9ebb4d19c819ef87c19677bbf3a7c46ef0855bd1b2abe83491012000000000000000000000000000000000000000000000000000000000000000000000000002000000000101d20978463906ba4ff5e7192494b88dd5eb0de85d900ab253af909106faa22cc5010000000004000000014777ff000000000016001446c29eabe8208a33aa1023c741fa79aa92e881ff0347304402207d7ca96134f2bcfdd6b536536fdd39ad17793632016936f777ebb32c22943fda02206014d2fb8a6aa58279797f861042ba604ebd2f8f61e5bddbd9d3be5a245047b201004b632103eeaeba7ce5dc2470221e9517fb498e8d6bd4e73b85b8be655196972eb9ccd5566754b2752103a40b74d43df244799d041f32ce1ad515a6cd99501701540e38750d883ae21d3a68ac00000000", [ "002027a5000c7917f785d8fc6e5a55adfca8717ecb973ebb7743849ff956d896a7ed" ], "a4a4d6c6034da8aa06f01fe71f1fffbd79e032006b07f6c7a2c60a66aa310c01", "0385acb4f0fe889ef0", "3588f34fbbc11640f9ed40b2a66a4e096215d50389691309c1dac74d4268aa81", "Includes witness data", ], ] for ( block_height, block_hash_hex, full_block_hex, scripts, prev_hash_hex, cfilter_hex, filter_header_hex, notes, ) in tests: key = bytes.fromhex(block_hash_hex)[::-1][:16] b = Block.parse(BytesIO(bytes.fromhex(full_block_hex))) items = filter_null( [bytes.fromhex(s) for s in scripts] + [i for i in b.get_outpoints()] ) cfilter = encode_gcs(key, items) self.assertEqual(cfilter.hex(), cfilter_hex, notes) decoded_items = decode_gcs(key, cfilter) self.assertEqual(decoded_items, hashed_items(key, items)) prev_hash = bytes.fromhex(prev_hash_hex)[::-1] filter_header = hash256(hash256(cfilter) + prev_hash)[::-1] self.assertEqual(filter_header_hex, filter_header.hex(), notes)
58.895288
3,213
0.744511
916
22,498
18.091703
0.229258
0.007241
0.009413
0.011103
0.140056
0.128832
0.12328
0.118694
0.1126
0.101376
0
0.515436
0.208107
22,498
381
3,214
59.049869
0.41474
0.005823
0
0.38674
0
0
0.603604
0.586702
0
1
0.00398
0
0.080111
1
0.035912
false
0
0.01105
0
0.049724
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
7
ce5ab46e27f716b4eaaf434e82e6834c090f446b
39,202
py
Python
old/python_ver0.1/libnmf_jit.py
MotokiShiga/stem-nmf
e2be57ea54239c033c593feaa0823ceba0f0954e
[ "MIT" ]
3
2018-11-06T09:44:16.000Z
2021-09-24T08:21:45.000Z
old/python_ver0.1/libnmf_jit.py
MotokiShiga/stem-nmf
e2be57ea54239c033c593feaa0823ceba0f0954e
[ "MIT" ]
null
null
null
old/python_ver0.1/libnmf_jit.py
MotokiShiga/stem-nmf
e2be57ea54239c033c593feaa0823ceba0f0954e
[ "MIT" ]
6
2017-10-10T08:50:59.000Z
2021-10-07T05:35:04.000Z
""" NMF (Nonnegative Matrix Factorization) for Spectrum Imaging Data Analysis """ # Author: Motoki Shiga <shiga_m@gifu-u.ac.jp> # License: MIT # # Reference # [1] Motoki Shiga, Kazuyoshi Tatsumi, Shunsuke Muto, Koji Tsuda, # Yuta Yamamoto, Toshiyuki Mori, Takayoshi Tanji, # "Sparse Modeling of EELS and EDX Spectral Imaging Data by Nonnegative Matrix Factorization", # Ultramicroscopy, Vol.170, p.43-59, 2016. # import numpy as np from numpy import random import numpy.linalg as lin from scipy.special import gammaln import matplotlib.pyplot as plt from numba import jitclass from numba import int32, float64 spec_nmf = [ ('n_components', int32), ('max_itr', int32), ('random_seed', int32) ] @jitclass(spec_nmf) class NMF(object): """Non-Negative Matrix Factorization (NMF) Parameters ---------- n_components : int or None Number of components, if n_components is not set all features are kept. reps : The number of initializations. (default: 3) max_itr : integer, default: 200 Number of iterations to compute. random_state : integer seed, RandomState instance (default: 0) Random number generator seed control. Attributes ---------- C_ : array, [#spatial data points, n_components] Non-negative components decomposed from data X. S_ : array, [#channels, n_components] Non-negative spectra decomposed from data X. obj_fun_ : array, [#iterations] Learning curve of reconstruction error (Mean Squared Error) Examples -------- >>> import numpy as np >>> X = np.array([[1,1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]]) >>> model = NMF(n_components=2) >>> model.fit(X) Training NMF model.... 1th iteration of NMF algorithm 2th iteration of NMF algorithm 3th iteration of NMF algorithm NMF(n_components=2, reps=3, max_itr=100, random_seed=0) >>> model.C_ array([[ 0. , 0.40549951], [ 0.13374645, 0.40555886], [ 0.24076597, 0.48667235], [ 0.40131387, 0.4055646 ], [ 0.56186177, 0.32445684], [ 0.66888128, 0.40557034]]) >>> model.S_ array([[ 7.47464589, 2.46643616], [ 0. , 2.4657656 ]]) References ---------- [1] Cichocki, Andrzej, and P.H.A.N. Anh-Huy. “Fast local algorithms for large scale nonnegative matrix and tensor factorizations.” IEICE transactions on fundamentals of electronics, communications and computer sciences 92.3: 708-721, 2009. """ # constructor def __init__(self, n_components, reps=3, max_itr=100, random_seed=0): self.n_components = n_components self.reps = reps self.max_itr = max_itr self.random_seed = random_seed def __repr__(self): class_name = self.__class__.__name__ txt = 'n_components=' + str(self.n_components) \ + ', reps=' + str(self.reps) + ', max_itr=' + str(self.max_itr) + \ ', random_seed=' + str(self.random_seed) return '%s(%s)' % (class_name, txt,) def __str__(self): txt = self.__repr__() return txt def fit(self, X, num_xy=list(), channel_vals=list(), unit_name='Channel'): """ Learn a NMF model for the data X. Parameters ---------- X: {array-like, sparse matrix}, shape (n_samples, n_features) Data matrix to be decomposed num_xy: {array}, (#samples in x axis, #samples in x axis) or int, (#samples in x axis x #samples in x axis) The number of data points channel_vals: {array} The sequence of channel numbers, or unit values unit_name: strings The name of x axis of spectra Returns ------- self """ num_X_xy, num_X_ch = X.shape if type(num_xy)==int: self.num_xy = [num_xy] elif len(num_xy)==0: self.num_xy = num_X_xy else: self.num_xy = num_xy if len(channel_vals)>0: self.channel_vals = channel_vals else: self.channel_vals = np.arange(num_X_ch) self.unit_name = unit_name obj_best = np.inf random.seed(self.random_seed) # set the random seed print('Training NMF model....') for rep in range(self.reps): print(str(rep + 1) + 'th iteration of NMF algorithm') # initialization obj = np.zeros(self.max_itr) C = np.ones((num_X_xy, self.n_components)) for j in range(self.n_components): C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j]) + 1e-16) cj = np.sum(C, axis=1) i = np.random.choice(num_X_xy, self.n_components) S = X[i, :].T # main loop for itr in range(self.max_itr): # update S XC = X.T @ C C2 = C.T @ C for j in range(self.n_components): S[:, j] = XC[:, j] - S @ C2[:, j] + C2[j, j] * S[:, j] S[:, j] = (S[:, j] + np.abs(S[:, j])) / 2 # replace negative values with zeros # update C XS = X @ S S2 = S.T @ S for j in range(self.n_components): cj = cj - C[:, j] C[:, j] = XS[:, j] - C @ S2[:, j] + S2[j, j] * C[:, j] C[:, j] = (C[:, j] + np.abs(C[:, j])) / 2 # replace negative values with zeros C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j])) # normalize cj = cj + C[:, j] # cost function X_est = C @ S.T # reconstructed data matrix obj[itr] = lin.norm(X - X_est, ord='fro')**2 / X.size # check of convergence if (itr > 1) & (np.abs(obj[itr - 1] - obj[itr]) < 10 ** (-10)): obj = obj[0:itr] print('# updates: ' + str(itr)) break # choose the best result if obj_best > obj[-1]: objs_best = obj.copy() C_best = C.copy() S_best = S.copy() self.C_, self.S_, self.obj_fun_ = C_best, S_best, objs_best return self def imshow_component(self, figsize=list()): ''' Plot spatial distributions of components Parameters ---------- figsize: the vertical and horizontal size of the figure ''' if (type(self.num_xy) != int) and (len(self.num_xy) == 2): if len(figsize) == 0: plt.figure() else: plt.figure(figsize=figsize) for k in range(self.C_.shape[1]): plt.subplot(100 + self.C_.shape[1] * 10 + k + 1) im = np.reshape(self.C_[:, k], self.num_xy) plt.imshow(im) plt.title('Component: ' + str(k + 1)) plt.tight_layout() plt.show() else: self.plot_component(figsize) def plot_component(self, figsize=list()): ''' Plot component intensities (data points vs intensities) Parameters ---------- figsize: the vertical and horizontal size of the figure ''' if len(figsize) == 0: plt.figure() else: plt.figure(figsize=figsize) for k in range(self.C_.shape[1]): plt.plot(self.C_[:, k], label=str(k + 1)) plt.xlim([0, self.C_.shape[0]]) plt.xlabel('Spatial data point') plt.ylabel('Intensity') plt.title('Components') plt.legend() plt.show() def plot_spectra(self, figsize=list()): ''' Plot spectra Parameters ---------- figsize: the vertical and horizontal size of the figure ''' if len(figsize) == 0: plt.figure() else: plt.figure(figsize=figsize) for k in range(self.S_.shape[1]): self.S_[:, k] = self.S_[:, k] / (np.sqrt(self.S_[:, k].T @ self.S_[:, k]) + 1e-16) plt.plot(self.channel_vals, self.S_[:, k], label=str(k + 1)) plt.xlabel('Channel') plt.ylabel('Intensity') plt.xlim([self.channel_vals[0], self.channel_vals[-1]]) plt.title('Spectra') plt.legend() plt.show() def plot_object_fun(self, figsize=list()): ''' Plot learning curve (#iterations vs object function (error function)) Parameters ---------- figsize: the vertical and horizontal size of the figure ''' if len(figsize) == 0: plt.figure() else: plt.figure(figsize=figsize) plt.plot(self.obj_fun_) plt.xlabel('Iterations') plt.xlim([0, len(self.obj_fun_)]) plt.title('Object function') plt.show() class NMF_SO(NMF): """Non-Negative Matrix Factorization with Soft orthogonality penalty (NMF-SO) Parameters ---------- n_components : int or None Number of components, if n_components is not set all features are kept. wo : weight of orthogonal penalty. The value should be between 0 and 1. reps : The number of initializations. (default: 3) max_itr : integer, default: 200 Number of iterations to compute. random_state : integer seed, RandomState instance (default: 0) Random number generator seed control. Attributes ---------- C_ : array, [#spatial data points, n_components] Non-negative components decomposed from data X. S_ : array, [#channels, n_components] Non-negative spectra decomposed from data X. obj_fun_ : array, [#iterations] Learning curve of reconstruction error (Mean Squared Error) Examples -------- >>> import numpy as np >>> X = np.array([[1,1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]]) >>> model = NMF_SO(n_components=2, wo = 0.1) >>> model.fit(X) Training NMF with Soft Orthogonal constraint.... 1th iteration of NMF-SO algorithm 2th iteration of NMF-SO algorithm 3th iteration of NMF-SO algorithm NMF_SO(n_components=2, wo=0.1, reps=3, max_itr=100, random_seed=0) >>> model.C_ array([[ 0. , 0.30547946], [ 0. , 0.51238139], [ 0. , 0.73899883], [ 0.33013316, 0.31309478], [ 0.60391616, 0. ], [ 0.72546355, 0. ]]) >>> model.S_ array([[ 8.28515563, 3.94337313], [ 1.34447182, 1.87880282]]) References ---------- Motoki Shiga, Kazuyoshi Tatsumi, Shunsuke Muto, Koji Tsuda, Yuta Yamamoto, Toshiyuki Mori, Takayoshi Tanji, "Sparse Modeling of EELS and EDX Spectral Imaging Data by Nonnegative Matrix Factorization", Ultramicroscopy, Vol.170, p.43-59, 2016. doi: 10.1016/j.ultramic.2016.08.006 """ # constructor def __init__(self, n_components, wo=0.1, reps=3, max_itr=100, random_seed=0): self.n_components = n_components self.wo = wo self.reps = reps self.max_itr = max_itr self.random_seed = random_seed def __repr__(self): class_name = self.__class__.__name__ txt = 'n_components=' + str(self.n_components) + ', wo=' + str(self.wo) \ + ', reps=' + str(self.reps) + ', max_itr=' + str(self.max_itr) + \ ', random_seed=' + str(self.random_seed) return '%s(%s)' % (class_name, txt,) def __str__(self): txt = self.__repr__() return txt def fit(self, X, num_xy=list(), channel_vals=list(), unit_name='Channel'): """ Learn a NMF model for the data X. Parameters ---------- X: {array-like, sparse matrix}, shape (n_samples, n_features) Data matrix to be decomposed num_xy: {array}, (#samples in x axis, #samples in x axis) or int, (#samples in x axis x #samples in x axis) The number of data points channel_vals: {array} The sequence of channel numbers, or unit values unit_name: strings The name of x axis of spectra Returns ------- self """ num_X_xy, num_X_ch = X.shape if type(num_xy)==int: self.num_xy = [num_xy] elif len(num_xy)==0: self.num_xy = num_X_xy else: self.num_xy = num_xy if len(channel_vals)>0: self.channel_vals = channel_vals else: self.channel_vals = np.arange(num_X_ch) self.unit_name = unit_name obj_best = np.inf random.seed(self.random_seed) # set the random seed print('Training NMF with Soft Orthogonal constraint....') for rep in range(self.reps): print(str(rep + 1) + 'th iteration of NMF-SO algorithm') # initialization obj = np.zeros(self.max_itr) C = np.ones((num_X_xy, self.n_components)) for j in range(self.n_components): C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j]) + 1e-16) cj = np.sum(C, axis=1) i = np.random.choice(num_X_xy, self.n_components) S = X[i, :].T # main loop for itr in range(self.max_itr): # update S XC = X.T @ C C2 = C.T @ C for j in range(self.n_components): S[:, j] = XC[:, j] - S @ C2[:, j] + C2[j, j] * S[:, j] S[:, j] = (S[:, j] + np.abs(S[:, j])) / 2 # replace negative values with zeros # update C XS = X @ S S2 = S.T @ S for j in range(self.n_components): cj = cj - C[:, j] C[:, j] = XS[:, j] - C @ S2[:, j] + S2[j, j] * C[:, j] C[:, j] = C[:, j] - self.wo * (cj.T @ C[:, j]) / (cj.T @ cj) * cj C[:, j] = (C[:, j] + np.abs(C[:, j])) / 2 # replace negative values with zeros C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j])) # normalize cj = cj + C[:, j] # cost function X_est = C @ S.T # reconstructed data matrix obj[itr] = lin.norm(X - X_est, ord='fro')**2 / X.size # check of convergence if (itr > 1) & (np.abs(obj[itr - 1] - obj[itr]) < 10 ** (-10)): obj = obj[0:itr] print('# updates: ' + str(itr)) break # choose the best result if obj_best > obj[-1]: objs_best = obj.copy() C_best = C.copy() S_best = S.copy() self.C_, self.S_, self.obj_fun_ = C_best, S_best, objs_best return self class NMF_ARD_SO(NMF_SO): """Non-Negative Matrix Factorization with Soft orthogonality penalty (NMF-SO) Parameters ---------- n_components : int or None Number of components, if n_components is not set all features are kept. wo : real value The weight of orthogonal penalty. The value should be between 0 and 1. reps : The number of initializations. (default: 3) max_itr : integer, default: 200 Number of iterations to compute. alpha: real value (over than 1) To adjust sparseness threshold_merge: real value The threshold of similarity between components to judge components should be merged. random_state : integer seed, RandomState instance (default: 0) Random number generator seed control. Attributes ---------- C_ : array, [#spatial data points, n_components] Non-negative components decomposed from data X. S_ : array, [#channels, n_components] Non-negative spectra decomposed from data X. obj_fun_ : array, [#iterations] Learning curve of reconstruction error (Mean Squared Error) beta_ : real value Sparse penalty parameter (computed from alpha and data X) lambdas_ : attay, [#iterations] Learning curve of component intensities Examples -------- >>> import numpy as np >>> X = np.array([[1,1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]]) >>> model = NMF_ARD_SO(n_components=2, wo = 0.1) >>> model.fit(X) Training NMF with Soft Orthogonal constraint.... 1th iteration of NMF-SO algorithm 2th iteration of NMF-SO algorithm 3th iteration of NMF-SO algorithm NMF_SO(n_components=2, wo=0.1, reps=3, max_itr=100, random_seed=0) >>> model.C_ array([[ 0. , 1.31254938], [ 0. , 2.21337851], [ 0.04655829, 3.15615036], [ 2.88446237, 1.23380528], [ 5.05090679, 0. ], [ 6.07007114, 0. ]]) >>> model.S_ array([[ 0.9869102 , 0.90082913], [ 0.16127074, 0.43417379]]) References ---------- Motoki Shiga, Kazuyoshi Tatsumi, Shunsuke Muto, Koji Tsuda, Yuta Yamamoto, Toshiyuki Mori, Takayoshi Tanji, "Sparse Modeling of EELS and EDX Spectral Imaging Data by Nonnegative Matrix Factorization", Ultramicroscopy, Vol.170, p.43-59, 2016. doi: 10.1016/j.ultramic.2016.08.006 """ # constructor def __init__(self, n_components, wo=0.1, reps=3, max_itr=100, alpha=1+10**(-15), threshold_merge=0.99, random_seed=0): super(NMF_ARD_SO, self).__init__(n_components, wo, reps, max_itr, random_seed) self.alpha = alpha self.threshold_merge = threshold_merge def __repr__(self): class_name = self.__class__.__name__ txt = 'n_components=' + str(self.n_components) + ', wo=' + str(self.wo) \ + ', reps=' + str(self.reps) + ', max_itr=' + str(self.max_itr) + \ ', alpha=' + str(self.alpha) + ', threshold_merge=' + str(self.threshold_merge) + ', random_seed=' + str(self.random_seed) return '%s(%s)' % (class_name, txt,) def __str__(self): txt = self.__repr__() return txt def fit(self, X, num_xy=list(), channel_vals=list(), unit_name='Channel'): """ Learn a NMF model for the data X. Parameters ---------- X: {array-like, sparse matrix}, shape (n_samples, n_features) Data matrix to be decomposed num_xy: {array}, (#samples in x axis, #samples in x axis) or int, (#samples in x axis x #samples in x axis) The number of data points channel_vals: {array} The sequence of channel numbers, or unit values unit_name: strings The name of x axis of spectra Returns ------- self """ eps = np.finfo(np.float64).eps # tiny value num_X_xy, num_X_ch = X.shape # the number of data points and the number of channels # --- Attribute initialization from a data matrix------ if type(num_xy) == int: self.num_xy = [num_xy] elif len(num_xy) == 0: self.num_xy = num_X_xy else: self.num_xy = num_xy # (xdim, ydim) if len(channel_vals) > 0: self.channel_vals = channel_vals else: self.channel_vals = np.arange(num_X_ch) self.unit_name = unit_name # ----------------------------------------------------- mu_x = np.mean(X) self.beta_ = mu_x * (self.alpha - 1) * np.sqrt(num_X_ch) / self.n_components const = self.n_components * (gammaln(self.alpha) - self.alpha * np.log(self.beta_)) random.seed(self.random_seed) # set the random seed obj_best = np.inf # to deposit the best object value print('Training NMF with ARD and Soft Orthogonal constraint....') for rep in range(self.reps): print(str(rep+1) + 'th iteration of NMF-ARD-SO algorithm') # --- Initialization ------ C = (np.random.rand(num_X_xy, self.n_components) + 1) * (np.sqrt(mu_x / self.n_components)) L = (np.sum(C, axis=0) + self.beta_) / (num_X_ch + self.alpha + 1) cj = np.sum(C, axis=1) i = np.random.choice(num_X_xy, self.n_components) S = X[i, :].T for j in range(self.n_components): c = (np.sqrt(S[:, j].T @ S[:, j])) # normalize if c > 0: S[:, j] = S[:, j] / c else: S[:, j] = 1 / np.sqrt(num_X_ch) X_est = C @ S.T # reconstructed data matrix sigma2 = np.mean((X - X_est) ** 2) obj = np.zeros(self.max_itr) lambdas = np.zeros((self.max_itr, self.n_components)) # ------------------------- for itr in range(self.max_itr): # update S (spectra) XC = X.T @ C C2 = C.T @ C for j in range(self.n_components): S[:, j] = XC[:, j] - S @ C2[:, j] + C2[j, j] * S[:, j] S[:, j] = (S[:, j] + np.abs(S[:, j])) / 2 # replace negative values with zeros c = (np.sqrt(S[:, j].T @ S[:, j])) # normalize if c > 0: S[:, j] = S[:, j] / c else: S[:, j] = 1 / np.sqrt(num_X_ch) # update C (component intensities) XS = X @ S S2 = S.T @ S for j in range(self.n_components): cj = cj - C[:, j] C[:, j] = XS[:, j] - C @ S2[:, j] + S2[j, j] * C[:, j] C[:, j] = C[:, j] - sigma2 / L[j] if (self.wo > 0): C[:, j] = C[:, j] - self.wo * (cj.T @ C[:, j]) / (cj.T @ cj) * cj C[:, j] = (C[:, j] + np.abs(C[:, j])) / 2 # replace negative values with zeros cj = cj + C[:, j] # merge components if their spectra are almost same if itr > 3: SS = S.T @ S i, j = np.where(SS >= self.threshold_merge) m = i < j i, j = i[m], j[m] for n in range(len(i)): S[:, j[n]] = 1 / np.sqrt(num_X_ch) C[:, i[n]] = np.sum(C[:, np.r_[i[n], j[n]]], axis=1) C[:, j[n]] = 0 if np.sum(cj) < eps: C[:, :] = eps # update lambda(ARD parameters) L = (np.sum(C, axis=0) + self.beta_) / (num_X_xy + self.alpha + 1) + eps lambdas[itr, :] = L.copy() # update sigma2 (the variance of additive Gaussian noise) X_est = C @ S.T # reconstructed data matrix sigma2 = np.mean((X - X_est) ** 2) # object function (negative log likelihood) obj[itr] = num_X_xy * num_X_ch / 2 * np.log(2 * np.pi * sigma2) + num_X_xy * num_X_ch / 2 # MSE obj[itr] = obj[itr] + (L ** (-1)).T @ (np.sum(C, axis=0) + self.beta_).T \ + (num_X_xy + self.alpha + 1) * np.sum(np.log(L), axis=0) + const # check of convergence if (itr > 1) & (np.abs(obj[itr - 1] - obj[itr]) < 10 ** (-10)): obj = obj[0:itr] lambdas = lambdas[0:itr, :].copy() break # choose the best result if obj_best > obj[-1]: objs_best = obj.copy() C_best = C.copy() S_best = S.copy() lambdas_best = lambdas.copy() # for learning curve of object function self.obj_fun_ = objs_best # replace tiny values with zeros C_best[C_best < eps] = 0 S_best[S_best < eps] = 0 L_best = (np.sum(C, axis=0) + self.beta_) / (num_X_xy + self.alpha + 1) k = np.argsort(-L_best) num_comp_best = np.sum(L_best[k] > eps) ks = k[:num_comp_best] self.C_, self.S_, self.L_ = C_best[:, ks], S_best[:, ks], L_best[ks] self.lambdas_ = lambdas_best[:, k] # leave all values to draw learning curve of ARD X_est = self.C_ @ self.S_.T # reconstructed data matrix self.sigma2_ = np.mean((X - X_est) ** 2) return self def plot_ard(self, figsize=list()): ''' Plot learning curve of component intensities (#iterations vs intensities) Parameters ---------- figsize: the vertical and horizontal size of the figure ''' if len(figsize) == 0: plt.figure() else: plt.figure(figsize=figsize) for k in range(self.n_components): plt.plot(self.lambdas_[:, k], label=str(k + 1)) plt.xlabel('Iterations') plt.ylabel('Intensity') plt.xlim([0, self.lambdas_.shape[0]]) plt.title('Intensity of components') plt.legend() plt.show() class MultiNMF(NMF): """Multi Non-Negative Matrix Factorization (MNMF) Parameters ---------- n_components : int or None Number of components, if n_components is not set all features are kept. reps : The number of initializations. (default: 3) max_itr : integer, default: 200 Number of iterations to compute. random_state : integer seed, RandomState instance (default: 0) Random number generator seed control. Attributes ---------- C_ : array, [#spatial data points, n_components] Non-negative components decomposed from data X. S_ : array, [#channels, n_components] Non-negative spectra decomposed from data X. obj_fun_ : array, [#iterations] Learning curve of reconstruction error (Mean Squared Error) Examples -------- >>> import numpy as np >>> X = np.array([[1,1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]]) >>> model = NMF(n_components=2) >>> model.fit(X) Training NMF model.... 1th iteration of NMF algorithm 2th iteration of NMF algorithm 3th iteration of NMF algorithm NMF(n_components=2, reps=3, max_itr=100, random_seed=0) >>> model.C_ array([[ 0. , 0.40549951], [ 0.13374645, 0.40555886], [ 0.24076597, 0.48667235], [ 0.40131387, 0.4055646 ], [ 0.56186177, 0.32445684], [ 0.66888128, 0.40557034]]) >>> model.S_ array([[ 7.47464589, 2.46643616], [ 0. , 2.4657656 ]]) References ---------- [1] Cichocki, Andrzej, and P.H.A.N. Anh-Huy. “Fast local algorithms for large scale nonnegative matrix and tensor factorizations.” IEICE transactions on fundamentals of electronics, communications and computer sciences 92.3: 708-721, 2009. """ # constructor def __init__(self, n_components, reps=3, max_itr=100, random_seed=0): self.n_components = n_components self.reps = reps self.max_itr = max_itr self.random_seed = random_seed def __repr__(self): class_name = self.__class__.__name__ txt = 'n_components=' + str(self.n_components) + 'weight_source=' + str(self.weight_source)\ + ', reps=' + str(self.reps) + ', max_itr=' + str(self.max_itr) + \ ', random_seed=' + str(self.random_seed) return '%s(%s)' % (class_name, txt,) def fit(self, X, weight_source=list(), num_xy=list(), channel_vals=list(), unit_name='Channel'): """ Learn a MNMF model for the data X. Parameters ---------- X: {array-like, sparse matrix}, shape (n_samples, n_features) Data matrix to be decomposed num_xy: {array}, (#samples in x axis, #samples in x axis) or int, (#samples in x axis x #samples in x axis) The number of data points weight_source: {array}, (#data sources) Weight of data sources channel_vals: {array} The sequence of channel numbers, or unit values unit_name: strings The name of x axis of spectra Returns ------- self """ num_source = len(X) if len(weight_source) == 0: self.weight_source = np.array(num_source)/num_source else: self.weight_source = weight_source num_X_xy = X[0].shape[0] if len(num_xy) == 0: self.num_xy = num_X_xy else: self.num_xy = num_xy if len(channel_vals) > 0: self.channel_vals = channel_vals else: self.channel_vals = ( np.arange(X[n].shape[1]) for n in range(num_source)) self.unit_name = unit_name obj_best = np.inf random.seed(self.random_seed) # set the random seed print('Training Multi-NMF model....') for rep in range(self.reps): print(str(rep + 1) + 'th iteration of Multi-NMF algorithm') # initialization obj = np.zeros(self.max_itr) C = np.ones((num_X_xy, self.n_components)) for j in range(self.n_components): C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j]) + 1e-16) cj = np.sum(C, axis=1) i = np.random.choice(num_X_xy, self.n_components) S = [X[n][i, :].T for n in range(num_source)] # main loop for itr in range(self.max_itr): # update S C2 = C.T @ C for n in range(num_source): XC = X[n].T @ C for j in range(self.n_components): S[n][:, j] = XC[:, j] - S[n] @ C2[:, j] + C2[j, j] * S[n][:, j] S[n][:, j] = (S[n][:, j] + np.abs(S[n][:, j])) / 2 # replace negative values with zeros # update C XS = self.weight_source[0] * X[0] @ S[0] for n in range(1,num_source): XS += self.weight_source[n] * X[n] @ S[n] S2 = self.weight_source[0] * S[0].T @ S[0] for n in range(1, num_source): S2 += self.weight_source[n] * S[n].T @ S[n] for j in range(self.n_components): cj = cj - C[:, j] C[:, j] = XS[:, j] - C @ S2[:, j] + S2[j, j] * C[:, j] C[:, j] = (C[:, j] + np.abs(C[:, j])) / 2 # replace negative values with zeros C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j])) # normalize cj = cj + C[:, j] # cost function for n in range(num_source): X_est = C @ S[n].T # reconstructed data matrix obj[itr] += self.weight_source[n] * lin.norm(X[n] - X_est, ord='fro') ** 2 / X[n].size # check of convergence if (itr > 1) & (np.abs(obj[itr - 1] - obj[itr]) < 10 ** (-10)): obj = obj[0:itr] print('# updates: ' + str(itr)) break # choose the best result if obj_best > obj[-1]: objs_best = obj.copy() C_best = C.copy() S_best = S.copy() self.C_, self.S_, self.obj_fun_ = C_best, S_best, objs_best return self def plot_spectra(self, figsize=list()): ''' Plot spectra Parameters ---------- figsize: the vertical and horizontal size of the figure ''' for n in range(len(self.S_)): if len(figsize) == 0: plt.figure() else: plt.figure(figsize=figsize) for k in range(self.S_[n].shape[1]): self.S_[n][:, k] = self.S_[n][:, k] / (np.sqrt(self.S_[n][:, k].T @ self.S_[n][:, k]) + 1e-16) plt.plot(self.channel_vals[n], self.S_[n][:, k], label=str(k + 1)) plt.xlabel('Channel') plt.ylabel('Intensity') plt.xlim([self.channel_vals[n][0], self.channel_vals[n][-1]]) plt.title('Spectra in source ' + str(n)) plt.legend() plt.show() class MultiNMF_SO(MultiNMF): """Multi Non-Negative Matrix Factorization with Soft orthogonality penalty (NMF-SO) Parameters ---------- n_components : int or None Number of components, if n_components is not set all features are kept. wo : weight of orthogonal penalty. The value should be between 0 and 1. reps : The number of initializations. (default: 3) max_itr : integer, default: 200 Number of iterations to compute. random_state : integer seed, RandomState instance (default: 0) Random number generator seed control. Attributes ---------- C_ : array, [#spatial data points, n_components] Non-negative components decomposed from data X. S_ : array, [#channels, n_components] Non-negative spectra decomposed from data X. obj_fun_ : array, [#iterations] Learning curve of reconstruction error (Mean Squared Error) Examples -------- >>> import numpy as np >>> X = np.array([[1,1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]]) >>> model = NMF_SO(n_components=2, wo = 0.1) >>> model.fit(X) Training NMF with Soft Orthogonal constraint.... 1th iteration of NMF-SO algorithm 2th iteration of NMF-SO algorithm 3th iteration of NMF-SO algorithm NMF_SO(n_components=2, wo=0.1, reps=3, max_itr=100, random_seed=0) >>> model.C_ array([[ 0. , 0.30547946], [ 0. , 0.51238139], [ 0. , 0.73899883], [ 0.33013316, 0.31309478], [ 0.60391616, 0. ], [ 0.72546355, 0. ]]) >>> model.S_ array([[ 8.28515563, 3.94337313], [ 1.34447182, 1.87880282]]) References ---------- Motoki Shiga, Kazuyoshi Tatsumi, Shunsuke Muto, Koji Tsuda, Yuta Yamamoto, Toshiyuki Mori, Takayoshi Tanji, "Sparse Modeling of EELS and EDX Spectral Imaging Data by Nonnegative Matrix Factorization", Ultramicroscopy, Vol.170, p.43-59, 2016. doi: 10.1016/j.ultramic.2016.08.006 """ # constructor def __init__(self, n_components, wo=0.1, reps=3, max_itr=100, random_seed=0): self.n_components = n_components self.wo = wo self.reps = reps self.max_itr = max_itr self.random_seed = random_seed def __repr__(self): class_name = self.__class__.__name__ txt = 'n_components=' + str(self.n_components) + 'weight_source=' + str(self.weight_source) + ', wo=' + str(self.wo) \ + ', reps=' + str(self.reps) + ', max_itr=' + str(self.max_itr) + \ ', random_seed=' + str(self.random_seed) return '%s(%s)' % (class_name, txt,) def fit(self, X, weight_source=list(), num_xy=list(), channel_vals=list(), unit_name='Channel'): """ Learn a NMF model for the data X. Parameters ---------- X: {array-like, sparse matrix}, shape (n_samples, n_features) Data matrix to be decomposed num_xy: {array}, (#samples in x axis, #samples in x axis) or int, (#samples in x axis x #samples in x axis) The number of data points channel_vals: {array} The sequence of channel numbers, or unit values unit_name: strings The name of x axis of spectra Returns ------- self """ num_source = len(X) if len(weight_source) == 0: self.weight_source = np.array(num_source) / num_source else: self.weight_source = weight_source num_X_xy = X[0].shape[0] if len(num_xy) == 0: self.num_xy = num_X_xy else: self.num_xy = num_xy if len(channel_vals) > 0: self.channel_vals = channel_vals else: self.channel_vals = [np.arange(X[n].shape[1]) for n in range(num_source)] self.unit_name = unit_name obj_best = np.inf random.seed(self.random_seed) # set the random seed print('Training Multi-NMF with Soft Orthogonal constraint....') for rep in range(self.reps): print(str(rep + 1) + 'th iteration of Multi-NMF-SO algorithm') # initialization obj = np.zeros(self.max_itr) C = np.ones((num_X_xy, self.n_components)) for j in range(self.n_components): C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j]) + 1e-16) cj = np.sum(C, axis=1) i = np.random.choice(num_X_xy, self.n_components) S = [X[n][i, :].T for n in range(num_source)] # main loop for itr in range(self.max_itr): # update S C2 = C.T @ C for n in range(num_source): XC = X[n].T @ C for j in range(self.n_components): S[n][:, j] = XC[:, j] - S[n] @ C2[:, j] + C2[j, j] * S[n][:, j] S[n][:, j] = (S[n][:, j] + np.abs(S[n][:, j])) / 2 # replace negative values with zeros # update C XS = self.weight_source[0] * X[0] @ S[0] for n in range(1, num_source): XS += self.weight_source[n] * X[n] @ S[n] S2 = self.weight_source[0] * S[0].T @ S[0] for n in range(1, num_source): S2 += self.weight_source[n] * S[n].T @ S[n] for j in range(self.n_components): cj = cj - C[:, j] C[:, j] = XS[:, j] - C @ S2[:, j] + S2[j, j] * C[:, j] C[:, j] = C[:, j] - self.wo * (cj.T @ C[:, j]) / (cj.T @ cj) * cj C[:, j] = (C[:, j] + np.abs(C[:, j])) / 2 # replace negative values with zeros C[:, j] = C[:, j] / (np.sqrt(C[:, j].T @ C[:, j])) # normalize cj = cj + C[:, j] # cost function for n in range(num_source): X_est = C @ S[n].T # reconstructed data matrix obj[itr] += self.weight_source[n] * lin.norm(X[n] - X_est, ord='fro') ** 2 / X[n].size # check of convergence if (itr > 1) & (np.abs(obj[itr - 1] - obj[itr]) < 10 ** (-10)): obj = obj[0:itr] print('# updates: ' + str(itr)) break # choose the best result if obj_best > obj[-1]: objs_best = obj.copy() C_best = C.copy() S_best = S.copy() self.C_, self.S_, self.obj_fun_ = C_best, S_best, objs_best return self
37.986434
136
0.51153
5,159
39,202
3.749564
0.073464
0.048335
0.034119
0.005583
0.857165
0.839692
0.825527
0.821237
0.81617
0.812552
0
0.044065
0.35164
39,202
1,031
137
38.023278
0.717
0.361997
0
0.773196
0
0
0.043614
0
0
0
0
0
0
1
0.049485
false
0
0.014433
0
0.101031
0.028866
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
ce74c8f42a05164f5e4616707228a38e6069152c
180
py
Python
ibsng/handler/util/get_start_of_month.py
ParspooyeshFanavar/pyibsng
d48bcf4f25e3f23461528bf0ff8870cc3d537444
[ "MIT" ]
6
2018-03-06T10:16:36.000Z
2021-12-05T12:43:10.000Z
ibsng/handler/util/get_start_of_month.py
ParspooyeshFanavar/pyibsng
d48bcf4f25e3f23461528bf0ff8870cc3d537444
[ "MIT" ]
3
2018-03-06T10:27:08.000Z
2022-01-02T15:21:27.000Z
ibsng/handler/util/get_start_of_month.py
ParspooyeshFanavar/pyibsng
d48bcf4f25e3f23461528bf0ff8870cc3d537444
[ "MIT" ]
3
2018-01-06T16:28:31.000Z
2018-09-17T19:47:19.000Z
"""Get server start of month API method.""" from ibsng.handler.handler import Handler class getStartOfMonth(Handler): """Get server start of month method class.""" pass
20
49
0.716667
24
180
5.375
0.583333
0.139535
0.217054
0.248062
0.325581
0
0
0
0
0
0
0
0.177778
180
8
50
22.5
0.871622
0.427778
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
8
0b3a3a91568ba5a7b8664c09d25c55f9cc1916ff
7,984
py
Python
src/cdot.py
bcrafton/speed_read
3e9c0c873e49e4948a216aae14ec0d4654d1a62c
[ "MIT" ]
null
null
null
src/cdot.py
bcrafton/speed_read
3e9c0c873e49e4948a216aae14ec0d4654d1a62c
[ "MIT" ]
null
null
null
src/cdot.py
bcrafton/speed_read
3e9c0c873e49e4948a216aae14ec0d4654d1a62c
[ "MIT" ]
2
2020-11-08T12:51:23.000Z
2021-12-02T23:16:48.000Z
import numpy as np from conv_utils import * from scipy.stats import norm import ctypes pim_lib = ctypes.cdll.LoadLibrary('./pim.so') pim_lib.pim.restype = ctypes.c_int ########################### def pim(x, w, y_shape, lut_var, lut_rpr, alloc, adc_state, adc_thresh, params): nrow, nwl, wl, xb = np.shape(x) nwl, wl, nbl, bl = np.shape(w) # nwl, nbl, wl, bl nrow, ncol = y_shape y = np.zeros(shape=y_shape) # metrics = adc {1,2,3,4,5,6,7,8}, cycle, ron, roff, wl, stall, block_cycles[nwl] metrics_len = 13 + nwl metrics = np.zeros(shape=metrics_len) x = np.ascontiguousarray(x, np.int32) w = np.ascontiguousarray(w, np.int32) y = np.ascontiguousarray(y, np.int32) lut_var = np.ascontiguousarray(lut_var, np.float32) lut_rpr = np.ascontiguousarray(lut_rpr, np.int32) adc_state = np.ascontiguousarray(adc_state, np.float32) adc_thresh = np.ascontiguousarray(adc_thresh, np.float32) metrics = np.ascontiguousarray(metrics, np.int64) lut_bias = np.zeros(shape=64) lut_bias = np.ascontiguousarray(lut_bias, np.int32) ######## if params['alloc'] == 'block': nblock = np.sum(alloc) block_map = np.zeros(shape=nblock) block = 0 for i in range(nwl): for j in range(alloc[i]): block_map[block] = i block += 1 block_map = np.ascontiguousarray(block_map.flatten(), np.int32) sync = 0 ######## elif params['alloc'] == 'layer': nblock = alloc * nwl block_map = np.zeros(shape=(alloc, nwl)) for i in range(alloc): for j in range(nwl): block_map[i][j] = j block_map = np.ascontiguousarray(block_map.flatten(), np.int32) sync = 1 ######## # print (adc_state) # print (adc_thresh) # print (lut_rpr) psum = pim_lib.pim( ctypes.c_void_p(x.ctypes.data), ctypes.c_void_p(w.ctypes.data), ctypes.c_void_p(y.ctypes.data), ctypes.c_void_p(lut_var.ctypes.data), ctypes.c_void_p(lut_rpr.ctypes.data), ctypes.c_void_p(lut_bias.ctypes.data), ctypes.c_void_p(metrics.ctypes.data), ctypes.c_void_p(block_map.ctypes.data), ctypes.c_void_p(adc_state.ctypes.data), ctypes.c_void_p(adc_thresh.ctypes.data), ctypes.c_int(params['adc']), ctypes.c_int(params['max_rpr']), ctypes.c_int(params['skip']), ctypes.c_int(nrow), ctypes.c_int(nblock), ctypes.c_int(ncol), ctypes.c_int(nwl), ctypes.c_int(nbl), ctypes.c_int(wl), ctypes.c_int(bl), ctypes.c_int(sync), ctypes.c_int(1)) ######## return y, metrics ########################### # copying this from cc_update1 def pim_dyn(x, w, y_shape, lut_var, lut_rpr, alloc, params): nrow, nwl, wl, xb = np.shape(x) nwl, wl, nbl, bl = np.shape(w) # nwl, nbl, wl, bl nrow, ncol = y_shape y = np.zeros(shape=y_shape) # metrics = adc {1,2,3,4,5,6,7,8}, cycle, ron, roff, wl, stall, block_cycles[nwl] metrics_len = 13 + nwl metrics = np.zeros(shape=metrics_len) x = np.ascontiguousarray(x, np.int32) w = np.ascontiguousarray(w, np.int32) y = np.ascontiguousarray(y, np.int32) lut_var = np.ascontiguousarray(lut_var, np.float32) lut_rpr = np.ascontiguousarray(lut_rpr, np.int32) metrics = np.ascontiguousarray(metrics, np.int64) lut_bias = np.zeros(shape=64) lut_bias = np.ascontiguousarray(lut_bias, np.int32) # self.adc_state = np.zeros(shape=(rpr_high + 1, self.params['adc'] + 1)) # self.adc_thresh = np.zeros(shape=(rpr_high + 1, self.params['adc'] + 1)) adc_state = np.zeros(shape=(64, 9)) adc_thresh = np.zeros(shape=(64, 9)) adc_state = np.ascontiguousarray(adc_state, np.float32) adc_thresh = np.ascontiguousarray(adc_thresh, np.float32) ######## if params['alloc'] == 'block': nblock = np.sum(alloc) block_map = np.zeros(shape=nblock) block = 0 for i in range(nwl): for j in range(alloc[i]): block_map[block] = i block += 1 block_map = np.ascontiguousarray(block_map.flatten(), np.int32) sync = 0 elif params['alloc'] == 'layer': nblock = alloc * nwl block_map = np.zeros(shape=(alloc, nwl)) for i in range(alloc): for j in range(nwl): block_map[i][j] = j block_map = np.ascontiguousarray(block_map.flatten(), np.int32) sync = 1 ######## psum = pim_lib.pim( ctypes.c_void_p(x.ctypes.data), ctypes.c_void_p(w.ctypes.data), ctypes.c_void_p(y.ctypes.data), ctypes.c_void_p(lut_var.ctypes.data), ctypes.c_void_p(lut_rpr.ctypes.data), ctypes.c_void_p(lut_bias.ctypes.data), ctypes.c_void_p(metrics.ctypes.data), ctypes.c_void_p(block_map.ctypes.data), ctypes.c_void_p(adc_state.ctypes.data), ctypes.c_void_p(adc_thresh.ctypes.data), ctypes.c_int(params['adc']), ctypes.c_int(params['max_rpr']), ctypes.c_int(params['skip']), ctypes.c_int(nrow), ctypes.c_int(nblock), ctypes.c_int(ncol), ctypes.c_int(nwl), ctypes.c_int(nbl), ctypes.c_int(wl), ctypes.c_int(bl), ctypes.c_int(sync), ctypes.c_int(0)) return y, metrics ########################### def pim_static(x, w, y_shape, lut_var, lut_rpr, alloc, lut_bias, params): nrow, nwl, wl, xb = np.shape(x) nwl, wl, nbl, bl = np.shape(w) # nwl, nbl, wl, bl nrow, ncol = y_shape y = np.zeros(shape=y_shape) # metrics = adc {1,2,3,4,5,6,7,8}, cycle, ron, roff, wl, stall, block_cycles[nwl] metrics_len = 13 + nwl metrics = np.zeros(shape=metrics_len) x = np.ascontiguousarray(x, np.int32) w = np.ascontiguousarray(w, np.int32) y = np.ascontiguousarray(y, np.int32) lut_var = np.ascontiguousarray(lut_var, np.float32) lut_rpr = np.ascontiguousarray(lut_rpr, np.int32) metrics = np.ascontiguousarray(metrics, np.int64) lut_bias = np.ascontiguousarray(lut_bias, np.int32) # self.adc_state = np.zeros(shape=(rpr_high + 1, self.params['adc'] + 1)) # self.adc_thresh = np.zeros(shape=(rpr_high + 1, self.params['adc'] + 1)) adc_state = np.zeros(shape=(64, 9)) adc_thresh = np.zeros(shape=(64, 9)) adc_state = np.ascontiguousarray(adc_state, np.float32) adc_thresh = np.ascontiguousarray(adc_thresh, np.float32) ######## if params['alloc'] == 'block': nblock = np.sum(alloc) block_map = np.zeros(shape=nblock) block = 0 for i in range(nwl): for j in range(alloc[i]): block_map[block] = i block += 1 block_map = np.ascontiguousarray(block_map.flatten(), np.int32) sync = 0 elif params['alloc'] == 'layer': nblock = alloc * nwl block_map = np.zeros(shape=(alloc, nwl)) for i in range(alloc): for j in range(nwl): block_map[i][j] = j block_map = np.ascontiguousarray(block_map.flatten(), np.int32) sync = 1 ######## psum = pim_lib.pim( ctypes.c_void_p(x.ctypes.data), ctypes.c_void_p(w.ctypes.data), ctypes.c_void_p(y.ctypes.data), ctypes.c_void_p(lut_var.ctypes.data), ctypes.c_void_p(lut_rpr.ctypes.data), ctypes.c_void_p(lut_bias.ctypes.data), ctypes.c_void_p(metrics.ctypes.data), ctypes.c_void_p(block_map.ctypes.data), ctypes.c_void_p(adc_state.ctypes.data), ctypes.c_void_p(adc_thresh.ctypes.data), ctypes.c_int(params['adc']), ctypes.c_int(params['max_rpr']), ctypes.c_int(params['skip']), ctypes.c_int(nrow), ctypes.c_int(nblock), ctypes.c_int(ncol), ctypes.c_int(nwl), ctypes.c_int(nbl), ctypes.c_int(wl), ctypes.c_int(bl), ctypes.c_int(sync), ctypes.c_int(2)) return y, metrics
30.473282
85
0.604835
1,196
7,984
3.849498
0.078595
0.101868
0.080365
0.078193
0.93788
0.93788
0.93788
0.93788
0.93788
0.92159
0
0.022394
0.239354
7,984
261
86
30.590038
0.735715
0.082916
0
0.935484
0
0
0.015361
0
0
0
0
0
0
1
0.016129
false
0
0.021505
0
0.053763
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
0b8f9b9aa2e3eba7471f2d0343b02d05cdd69cc9
75
py
Python
python/shadow/__init__.py
claudiok/clsim
e1d3f4a2de21bd1bedd0b8e604b122a784f7151d
[ "ISC", "BSD-2-Clause" ]
8
2017-09-29T12:01:51.000Z
2020-06-30T02:16:37.000Z
python/shadow/__init__.py
claudiok/clsim
e1d3f4a2de21bd1bedd0b8e604b122a784f7151d
[ "ISC", "BSD-2-Clause" ]
5
2015-03-17T18:57:04.000Z
2017-08-08T00:09:02.000Z
python/shadow/__init__.py
claudiok/clsim
e1d3f4a2de21bd1bedd0b8e604b122a784f7151d
[ "ISC", "BSD-2-Clause" ]
4
2017-12-24T19:00:22.000Z
2021-04-09T22:10:07.000Z
from .AddCylinder import AddCylinder from .AddCylinder import AddCylinders
25
37
0.866667
8
75
8.125
0.5
0.461538
0.646154
0
0
0
0
0
0
0
0
0
0.106667
75
2
38
37.5
0.970149
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
e7f2d114edfbb6481ca94b208cecfb7b13c69297
224
py
Python
src/cirrus/plugins/linters/__init__.py
Maxsparrow/cirrus
ae9639daba4f2d8d9285e98d5b11a89eac573f96
[ "Apache-2.0" ]
12
2016-04-30T16:13:55.000Z
2021-01-20T23:42:31.000Z
src/cirrus/plugins/linters/__init__.py
Maxsparrow/cirrus
ae9639daba4f2d8d9285e98d5b11a89eac573f96
[ "Apache-2.0" ]
153
2015-02-12T15:25:42.000Z
2020-03-09T07:16:15.000Z
src/cirrus/plugins/linters/__init__.py
Maxsparrow/cirrus
ae9639daba4f2d8d9285e98d5b11a89eac573f96
[ "Apache-2.0" ]
7
2015-06-15T21:30:38.000Z
2020-02-17T02:13:00.000Z
#!/usr/bin/env python """ linter plugins """ import cirrus.plugins.linters.pylint_linter import cirrus.plugins.linters.pyflakes_linter import cirrus.plugins.linters.coverage_linter import cirrus.plugins.linters.pep8_linter
22.4
45
0.830357
30
224
6.066667
0.433333
0.263736
0.417582
0.571429
0.527473
0
0
0
0
0
0
0.004785
0.066964
224
9
46
24.888889
0.866029
0.15625
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
f00936d38c2618ad94610d326d870183e2e54a43
189
py
Python
resnest/torch/datasets/build.py
mohitktanwr/Improved-Inverse-ResNest-Isprs
8463d7be0f67c398c91241f47cd7d9e0d235d799
[ "Apache-2.0" ]
3,168
2020-04-04T01:22:28.000Z
2022-03-31T12:14:50.000Z
resnest/torch/datasets/build.py
mohitktanwr/Improved-Inverse-ResNest-Isprs
8463d7be0f67c398c91241f47cd7d9e0d235d799
[ "Apache-2.0" ]
138
2020-04-04T02:12:30.000Z
2022-03-21T03:20:52.000Z
resnest/torch/datasets/build.py
mohitktanwr/Improved-Inverse-ResNest-Isprs
8463d7be0f67c398c91241f47cd7d9e0d235d799
[ "Apache-2.0" ]
527
2020-04-04T05:17:26.000Z
2022-03-31T06:15:34.000Z
from fvcore.common.registry import Registry RESNEST_DATASETS_REGISTRY = Registry('RESNEST_DATASETS') def get_dataset(dataset_name): return RESNEST_DATASETS_REGISTRY.get(dataset_name)
27
56
0.84127
24
189
6.291667
0.5
0.298013
0.304636
0
0
0
0
0
0
0
0
0
0.089947
189
6
57
31.5
0.877907
0
0
0
0
0
0.084656
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
7
f0232fc00cf35d4263a2aa08fcc0a1c835ae2c02
65,245
py
Python
tests/api/endpoints/test_repos_batch.py
odontomachus/seahub
5b6f2153921da21a473d9ff20ce443d40efc93ab
[ "Apache-2.0" ]
null
null
null
tests/api/endpoints/test_repos_batch.py
odontomachus/seahub
5b6f2153921da21a473d9ff20ce443d40efc93ab
[ "Apache-2.0" ]
6
2019-12-13T09:55:45.000Z
2022-03-11T23:47:29.000Z
tests/api/endpoints/test_repos_batch.py
odontomachus/seahub
5b6f2153921da21a473d9ff20ce443d40efc93ab
[ "Apache-2.0" ]
1
2019-05-16T06:58:16.000Z
2019-05-16T06:58:16.000Z
import os import json import posixpath from seaserv import seafile_api, ccnet_api from django.core.urlresolvers import reverse from tests.common.utils import randstring from seahub.test_utils import BaseTestCase from seahub.utils import normalize_dir_path try: from seahub.settings import LOCAL_PRO_DEV_ENV except ImportError: LOCAL_PRO_DEV_ENV = False class ReposBatchViewTest(BaseTestCase): def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.repo_id = self.repo.id self.group_id = self.group.id self.url = reverse('api-v2.1-repos-batch') def tearDown(self): self.remove_repo() self.remove_group() def test_can_share_repos_to_user(self): tmp_repo_id = self.create_new_repo(self.user_name) self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'user', 'username': self.admin_name, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 1 assert len(json_resp['failed']) == 0 # share repo again will failed data = { 'operation': 'share', 'share_type': 'user', 'username': self.admin_name, 'repo_id': [self.repo_id, tmp_repo_id] } resp = self.client.post(self.url, data) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 1 assert len(json_resp['failed']) == 1 assert self.repo_id in json_resp['failed'][0]['repo_id'] self.remove_repo(tmp_repo_id) def test_can_share_repos_to_group(self): tmp_repo_id = self.create_new_repo(self.user_name) self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'group', 'group_id': self.group_id, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 1 assert len(json_resp['failed']) == 0 # share repo again will failed data = { 'operation': 'share', 'share_type': 'group', 'group_id': self.group_id, 'repo_id': [self.repo_id, tmp_repo_id] } resp = self.client.post(self.url, data) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 1 assert len(json_resp['failed']) == 1 assert self.repo_id in json_resp['failed'][0]['repo_id'] self.remove_repo(tmp_repo_id) def test_share_with_invalid_operation(self): self.login_as(self.user) data = { 'operation': 'invalid_operation', 'share_type': 'user', 'username': self.admin_name, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(400, resp.status_code) data = { 'operation': 'invalid_operation', 'share_type': 'group', 'group_id': self.group_id, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(400, resp.status_code) def test_share_with_invalid_share_type(self): self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'invalid_share_type', 'username': self.admin_name, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(400, resp.status_code) data = { 'operation': 'share', 'share_type': 'invalid_share_type', 'group_id': self.group_id, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(400, resp.status_code) def test_share_with_invalid_permisson(self): self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'user', 'permission': 'invalid_permission', 'username': self.admin_name, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(400, resp.status_code) data = { 'operation': 'share', 'share_type': 'group', 'permission': 'invalid_permission', 'group_id': self.group_id, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(400, resp.status_code) def test_share_with_invalid_user(self): self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'user', 'username': 'invalid@user.com', 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(404, resp.status_code) def test_share_with_not_exist_group(self): self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'group', 'group_id': -1, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(404, resp.status_code) def test_share_with_not_group_member(self): tmp_group_id = ccnet_api.create_group(randstring(10), self.admin_name) self.login_as(self.user) data = { 'operation': 'share', 'share_type': 'group', 'group_id': tmp_group_id, 'repo_id': [self.repo_id] } resp = self.client.post(self.url, data) self.assertEqual(403, resp.status_code) class ReposBatchCopyDirView(BaseTestCase): def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.repo_id = self.repo.id self.url = reverse('api-v2.1-repos-batch-copy-dir') def tearDown(self): self.remove_repo() self.remove_group() def get_random_path(self): return '/%s/%s/%s/' % (randstring(2), \ randstring(2), randstring(2)) def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def test_copy_dir(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # create two folders in src repo src_folder_1 = self.get_random_path() src_folder_2 = self.get_random_path() for path in [src_folder_1, src_folder_2]: seafile_api.mkdir_with_parents(self.repo_id, '/', path.strip('/'), self.user_name) # share admin's tmp repo to user tmp_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(tmp_repo_id, self.admin_name, self.user_name, 'rw') # create two folders as parent dirs in dst repo for admin user dst_folder_1 = self.get_random_path() seafile_api.mkdir_with_parents(tmp_repo_id, '/', dst_folder_1.strip('/'), self.admin_name) dst_folder_2 = '/' # copy folders data = { "src_repo_id": self.repo_id, "dst_repo_id": tmp_repo_id, "paths": [ {"src_path": src_folder_1, "dst_path": dst_folder_1}, {"src_path": src_folder_2, "dst_path": dst_folder_2}, ] } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 2 assert len(json_resp['failed']) == 0 def folder_exist(src_folder, dst_repo_id, dst_folder): src_obj_name = os.path.basename(src_folder.rstrip('/')) full_dst_folder_path = posixpath.join(dst_folder.strip('/'), src_obj_name.strip('/')) full_dst_folder_path = normalize_dir_path(full_dst_folder_path) return seafile_api.get_dir_id_by_path(dst_repo_id, full_dst_folder_path) is not None assert folder_exist(src_folder_1, tmp_repo_id, dst_folder_1) assert folder_exist(src_folder_2, tmp_repo_id, dst_folder_2) self.remove_repo(tmp_repo_id) def test_copy_dir_with_invalid_repo_permisson(self): self.login_as(self.user) # create two folders as parent dirs in dst repo for admin user tmp_repo_id = self.create_new_repo(self.admin_name) # copy folders data = { "src_repo_id": self.repo_id, "dst_repo_id": tmp_repo_id, "paths": [ {"src_path": '/', "dst_path": '/'}, {"src_path": '/', "dst_path": '/'}, ] } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_copy_dir_with_src_path_is_root_folder(self): self.login_as(self.user) # create two folders as parent dirs in dst repo for admin user tmp_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(tmp_repo_id, self.admin_name, self.user_name, 'rw') # copy folders data = { "src_repo_id": self.repo_id, "dst_repo_id": tmp_repo_id, "paths": [ {"src_path": '/', "dst_path": '/'}, ] } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 0 assert len(json_resp['failed']) == 1 assert json_resp['failed'][0]['error_msg'] == \ "The source path can not be '/'." self.remove_repo(tmp_repo_id) class ReposBatchCreateDirViewTest(BaseTestCase): def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.repo_id = self.repo.id self.url = reverse('api-v2.1-repos-batch-create-dir') def tearDown(self): self.remove_repo() self.remove_group() def get_random_path(self): return '/%s/%s/%s/' % (randstring(2), \ randstring(2), randstring(2)) def test_create_dir(self): if not LOCAL_PRO_DEV_ENV: return path_1 = self.get_random_path() path_2 = self.get_random_path() path_3 = self.get_random_path() self.login_as(self.user) data = { 'repo_id': self.repo_id, 'paths': [path_1, path_2, path_3], } resp = self.client.post(self.url, data) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 3 assert len(json_resp['failed']) == 0 assert seafile_api.get_dir_id_by_path(self.repo_id, path_1) is not None assert seafile_api.get_dir_id_by_path(self.repo_id, path_2) is not None assert seafile_api.get_dir_id_by_path(self.repo_id, path_3) is not None def test_create_dir_with_invalid_repo_permission(self): # admin has NO permission for user's repo self.login_as(self.admin) data = { 'repo_id': self.repo_id, 'paths': 'path', } resp = self.client.post(self.url, data) self.assertEqual(403, resp.status_code) def test_create_dir_with_invalid_folder_permission(self): if not LOCAL_PRO_DEV_ENV: return path_1 = self.get_random_path() path_2 = self.get_random_path() path_3 = self.get_random_path() self.login_as(self.user) data = { 'repo_id': self.repo_id, 'paths': [path_1, path_2, path_3], } resp = self.client.post(self.url, data) self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) assert len(json_resp['success']) == 3 assert len(json_resp['failed']) == 0 assert seafile_api.get_dir_id_by_path(self.repo_id, path_1) is not None assert seafile_api.get_dir_id_by_path(self.repo_id, path_2) is not None assert seafile_api.get_dir_id_by_path(self.repo_id, path_3) is not None class ReposAsyncBatchCopyItemView(BaseTestCase): def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.src_repo_id = self.repo.id self.dst_repo_id = self.create_new_repo(self.user_name) self.file_path = self.file self.file_name = os.path.basename(self.file_path) self.folder_path = self.folder self.folder_name = os.path.basename(self.folder) self.url = reverse('api-v2.1-repos-async-batch-copy-item') def tearDown(self): self.remove_repo(self.src_repo_id) self.remove_repo(self.dst_repo_id) def test_can_copy(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) task_id = json_resp['task_id'] assert len(task_id) == 36 # progress_url = reverse('api-v2.1-query-copy-move-progress') + '?task_id=%s' % task_id # count = 1 # while True: # count += 1 # resp = self.client.get(progress_url) # json_resp = json.loads(resp.content) # if json_resp['done'] == 1 or count == 10: # break # # # items remain in src folder # assert seafile_api.get_dir_id_by_path(self.src_repo_id, self.folder_path) is not None # assert seafile_api.get_file_id_by_path(self.src_repo_id, self.file_path) is not None # # # items in dst folder # assert seafile_api.get_file_id_by_path(self.dst_repo_id, self.file_path) is not None # assert seafile_api.get_dir_id_by_path(self.dst_repo_id, self.folder_path) is not None def test_copy_with_invalid_parameter(self): self.login_as(self.user) data = { "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) def test_copy_with_repo_not_exist(self): self.login_as(self.user) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": invalid_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": invalid_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_copy_with_folder_not_exist(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": 'invalid_folder', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": 'invalid_folder', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_copy_with_invalid_repo_permission(self): tmp_repo_id = self.create_new_repo(self.admin_name) self.login_as(self.user) data = { "src_repo_id": tmp_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": tmp_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_copy_with_invalid_src_folder_permission(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) # share admin's tmp repo to user with 'preivew' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preview') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) def test_copy_with_invalid_dst_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) if not LOCAL_PRO_DEV_ENV: return # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) # share admin's tmp repo to user with 'preview' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preivew') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) class ReposAsyncBatchMoveItemView(BaseTestCase): def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.src_repo_id = self.repo.id self.dst_repo_id = self.create_new_repo(self.user_name) self.file_path = self.file self.file_name = os.path.basename(self.file_path) self.folder_path = self.folder self.folder_name = os.path.basename(self.folder) self.url = reverse('api-v2.1-repos-async-batch-move-item') def tearDown(self): self.remove_repo(self.src_repo_id) self.remove_repo(self.dst_repo_id) def test_can_move(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) json_resp = json.loads(resp.content) task_id = json_resp['task_id'] assert len(task_id) == 36 # progress_url = reverse('api-v2.1-query-copy-move-progress') + '?task_id=%s' % task_id # count = 1 # while True: # count += 1 # resp = self.client.get(progress_url) # json_resp = json.loads(resp.content) # if json_resp['done'] == 1 or count == 10: # break # # # items NOT in src folder # assert seafile_api.get_dir_id_by_path(self.src_repo_id, self.folder_path) is None # assert seafile_api.get_file_id_by_path(self.src_repo_id, self.file_path) is None # # # items in dst folder # assert seafile_api.get_file_id_by_path(self.dst_repo_id, self.file_path) is not None # assert seafile_api.get_dir_id_by_path(self.dst_repo_id, self.folder_path) is not None def test_move_with_invalid_parameter(self): self.login_as(self.user) data = { "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) def test_move_with_repo_not_exist(self): self.login_as(self.user) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": invalid_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": invalid_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_move_with_folder_not_exist(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": 'invalid_folder', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": 'invalid_folder', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_move_with_invalid_repo_permission(self): tmp_repo_id = self.create_new_repo(self.admin_name) self.login_as(self.user) data = { "src_repo_id": tmp_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": tmp_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_move_with_invalid_src_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) if not LOCAL_PRO_DEV_ENV: return # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) # share admin's tmp repo to user with 'preivew' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preview') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) def test_move_with_invalid_dst_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) if not LOCAL_PRO_DEV_ENV: return # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) # share admin's tmp repo to user with 'preview' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preview') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_move_with_locked_file(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'rw') # admin lock file admin_file_name = randstring(6) seafile_api.post_empty_file(admin_repo_id, '/', admin_file_name, self.admin_name) seafile_api.lock_file(admin_repo_id, admin_file_name, self.admin_name, 0) # user move locked file data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[admin_file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) json_resp = json.loads(resp.content) assert json_resp['error_msg'] == 'File %s is locked.' % admin_file_name def test_move_with_r_permission_sub_folder(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'rw' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'rw') # admin set 'r' sub folder permission admin_folder_name = randstring(6) seafile_api.post_dir(admin_repo_id, '/', admin_folder_name, self.admin_name) seafile_api.add_folder_user_perm(admin_repo_id, '/' + admin_folder_name, 'r', self.user_name) # user move r permission folder data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[admin_folder_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) json_resp = json.loads(resp.content) assert json_resp['error_msg'] == "Can't move folder %s, please check its permission." % admin_folder_name class ReposSyncBatchCopyItemView(BaseTestCase): def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.src_repo_id = self.repo.id self.dst_repo_id = self.create_new_repo(self.user_name) self.file_path = self.file self.file_name = os.path.basename(self.file_path) self.folder_path = self.folder self.folder_name = os.path.basename(self.folder) self.url = reverse('api-v2.1-repos-sync-batch-copy-item') def tearDown(self): self.remove_repo(self.src_repo_id) self.remove_repo(self.dst_repo_id) def test_can_copy(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) # items remain in src folder assert seafile_api.get_dir_id_by_path(self.src_repo_id, self.folder_path) is not None assert seafile_api.get_file_id_by_path(self.src_repo_id, self.file_path) is not None # items in dst folder assert seafile_api.get_file_id_by_path(self.dst_repo_id, self.file_path) is not None assert seafile_api.get_dir_id_by_path(self.dst_repo_id, self.folder_path) is not None def test_copy_with_invalid_parameter(self): self.login_as(self.user) data = { "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) def test_copy_with_repo_not_exist(self): self.login_as(self.user) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": invalid_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": invalid_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_copy_with_folder_not_exist(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": 'invalid_folder', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": 'invalid_folder', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_copy_with_invalid_repo_permission(self): tmp_repo_id = self.create_new_repo(self.admin_name) self.login_as(self.user) data = { "src_repo_id": tmp_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": tmp_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_copy_with_invalid_src_folder_permission(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) # share admin's tmp repo to user with 'preivew' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preview') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) def test_copy_with_invalid_dst_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) if not LOCAL_PRO_DEV_ENV: return # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) # share admin's tmp repo to user with 'preview' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preivew') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) class ReposSyncBatchMoveItemView(BaseTestCase): def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.src_repo_id = self.repo.id self.dst_repo_id = self.create_new_repo(self.user_name) self.file_path = self.file self.file_name = os.path.basename(self.file_path) self.folder_path = self.folder self.folder_name = os.path.basename(self.folder) self.url = reverse('api-v2.1-repos-sync-batch-move-item') def tearDown(self): self.remove_repo(self.src_repo_id) self.remove_repo(self.dst_repo_id) def test_can_move(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) # items NOT in src folder assert seafile_api.get_dir_id_by_path(self.src_repo_id, self.folder_path) is None assert seafile_api.get_file_id_by_path(self.src_repo_id, self.file_path) is None # items in dst folder assert seafile_api.get_file_id_by_path(self.dst_repo_id, self.file_path) is not None assert seafile_api.get_dir_id_by_path(self.dst_repo_id, self.folder_path) is not None def test_move_with_invalid_parameter(self): self.login_as(self.user) data = { "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) def test_move_with_repo_not_exist(self): self.login_as(self.user) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": invalid_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": invalid_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_move_with_folder_not_exist(self): self.login_as(self.user) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": 'invalid_folder', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": 'invalid_folder', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_move_with_invalid_repo_permission(self): tmp_repo_id = self.create_new_repo(self.admin_name) self.login_as(self.user) data = { "src_repo_id": tmp_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": tmp_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_move_with_invalid_src_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) if not LOCAL_PRO_DEV_ENV: return # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) # share admin's tmp repo to user with 'preivew' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preview') data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": self.src_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) def test_move_with_invalid_dst_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) if not LOCAL_PRO_DEV_ENV: return # share admin's tmp repo to user with 'cloud-edit' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'cloud-edit') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) # share admin's tmp repo to user with 'preview' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'preview') data = { "src_repo_id": self.src_repo_id, "src_parent_dir": '/', "src_dirents":[self.folder_name, self.file_name], "dst_repo_id": admin_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_move_with_locked_file(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'rw' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'rw') # admin lock file admin_file_name = randstring(6) seafile_api.post_empty_file(admin_repo_id, '/', admin_file_name, self.admin_name) seafile_api.lock_file(admin_repo_id, admin_file_name, self.admin_name, 0) # user move locked file data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[admin_file_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) json_resp = json.loads(resp.content) assert json_resp['error_msg'] == 'File %s is locked.' % admin_file_name def test_move_with_r_permission_sub_folder(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'rw' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'rw') # admin set 'r' sub folder permission admin_folder_name = randstring(6) seafile_api.post_dir(admin_repo_id, '/', admin_folder_name, self.admin_name) seafile_api.add_folder_user_perm(admin_repo_id, '/' + admin_folder_name, 'r', self.user_name) # user move r permission folder data = { "src_repo_id": admin_repo_id, "src_parent_dir": '/', "src_dirents":[admin_folder_name], "dst_repo_id": self.dst_repo_id, "dst_parent_dir": '/', } resp = self.client.post(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) json_resp = json.loads(resp.content) assert json_resp['error_msg'] == "Can't move folder %s, please check its permission." % admin_folder_name class ReposBatchDeleteItemView(BaseTestCase): def create_new_repo(self, username): new_repo_id = seafile_api.create_repo(name=randstring(10), desc='', username=username, passwd=None) return new_repo_id def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.repo_id = self.repo.id self.file_path = self.file self.file_name = os.path.basename(self.file_path) self.folder_path = self.folder self.folder_name = os.path.basename(self.folder) self.url = reverse('api-v2.1-repos-batch-delete-item') def tearDown(self): self.remove_repo(self.repo_id) def test_can_delete(self): # items in parent folder assert seafile_api.get_dir_id_by_path(self.repo_id, self.folder_path) != None assert seafile_api.get_file_id_by_path(self.repo_id, self.file_path) != None self.login_as(self.user) data = { "repo_id": self.repo_id, "parent_dir": '/', "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(200, resp.status_code) # items NOT in parent folder assert seafile_api.get_dir_id_by_path(self.repo_id, self.folder_path) is None assert seafile_api.get_file_id_by_path(self.repo_id, self.file_path) is None def test_delete_with_invalid_parameter(self): self.login_as(self.user) data = { "parent_dir": '/', "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "repo_id": self.repo_id, "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) data = { "repo_id": self.repo_id, "parent_dir": '/', } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(400, resp.status_code) def test_delete_with_repo_not_exist(self): self.login_as(self.user) invalid_repo_id = 'd53fe97e-919a-42f9-a29f-042d285ba6fb' data = { "repo_id": invalid_repo_id, "parent_dir": '/', "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_delete_with_folder_not_exist(self): self.login_as(self.user) data = { "repo_id": self.repo_id, "parent_dir": 'invalid_folder', "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(404, resp.status_code) def test_delete_with_invalid_repo_permission(self): tmp_repo_id = self.create_new_repo(self.admin_name) self.login_as(self.user) data = { "repo_id": tmp_repo_id, "parent_dir": '/', "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) def test_delete_with_invalid_parent_folder_permission(self): self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'r') data = { "repo_id": admin_repo_id, "parent_dir": '/', "dirents":[self.folder_name, self.file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) self.remove_repo(admin_repo_id) def test_delete_with_locked_file(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'rw') # admin lock file admin_file_name = randstring(6) seafile_api.post_empty_file(admin_repo_id, '/', admin_file_name, self.admin_name) seafile_api.lock_file(admin_repo_id, admin_file_name, self.admin_name, 0) # user move locked file data = { "repo_id": admin_repo_id, "parent_dir": '/', "dirents":[admin_file_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) json_resp = json.loads(resp.content) assert json_resp['error_msg'] == 'File %s is locked.' % admin_file_name def test_delete_with_r_permission_sub_folder(self): if not LOCAL_PRO_DEV_ENV: return self.login_as(self.user) # share admin's tmp repo to user with 'r' permission admin_repo_id = self.create_new_repo(self.admin_name) seafile_api.share_repo(admin_repo_id, self.admin_name, self.user_name, 'rw') # admin set 'r' sub folder permission admin_folder_name = randstring(6) seafile_api.post_dir(admin_repo_id, '/', admin_folder_name, self.admin_name) seafile_api.add_folder_user_perm(admin_repo_id, '/' + admin_folder_name, 'r', self.user_name) # user move locked file data = { "repo_id": admin_repo_id, "parent_dir": '/', "dirents":[admin_folder_name], } resp = self.client.delete(self.url, json.dumps(data), 'application/json') self.assertEqual(403, resp.status_code) json_resp = json.loads(resp.content) assert json_resp['error_msg'] == "Can't delete folder %s, please check its permission." % admin_folder_name
35.229482
115
0.600307
8,530
65,245
4.261079
0.021219
0.088315
0.065205
0.046056
0.964729
0.958126
0.95012
0.947258
0.941096
0.938234
0
0.012744
0.280788
65,245
1,851
116
35.248514
0.761833
0.060158
0
0.855824
0
0
0.135027
0.009114
0
0
0
0
0.106534
1
0.056818
false
0.004972
0.007102
0.00142
0.088778
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
f037fa12798554325617299846403d48b553a986
160
py
Python
scanflow/setup/__init__.py
gusseppe/autodeploy
a3caf2eb7db86cd111138a8cb5443d3f1ee4152c
[ "MIT" ]
2
2019-11-17T11:24:23.000Z
2020-02-07T10:57:54.000Z
scanflow/setup/__init__.py
gusseppe/scanflow
16321a5380bebaa7ea9fff0bf5903c3bbf108cd2
[ "MIT" ]
6
2020-11-13T18:35:12.000Z
2022-02-10T01:55:33.000Z
scanflow/setup/__init__.py
gusseppe/autodeploy
a3caf2eb7db86cd111138a8cb5443d3f1ee4152c
[ "MIT" ]
3
2020-11-27T09:29:40.000Z
2021-07-27T09:16:40.000Z
from .setup import Setup from .setup import Node # from .setup import Setup2 from .setup import Executor from .setup import Tracker from .setup import Workflow
22.857143
27
0.8
24
160
5.333333
0.333333
0.421875
0.703125
0
0
0
0
0
0
0
0
0.007407
0.15625
160
6
28
26.666667
0.940741
0.15625
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
f064720ff511e69151cecb8d0e6b60a30d66a1f3
25,923
py
Python
Components/plark-game/plark_game/py_tests/test_parameter_overloading.py
vermashresth/plark_ai_public
95a446e9807c47cd13f17bc37c77344fd418787b
[ "Apache-2.0" ]
19
2020-06-26T18:45:35.000Z
2022-03-08T14:20:32.000Z
Components/plark-game/plark_game/py_tests/test_parameter_overloading.py
vermashresth/plark_ai_public
95a446e9807c47cd13f17bc37c77344fd418787b
[ "Apache-2.0" ]
4
2020-07-13T19:32:42.000Z
2022-03-12T00:37:32.000Z
Components/plark-game/plark_game/py_tests/test_parameter_overloading.py
vermashresth/plark_ai_public
95a446e9807c47cd13f17bc37c77344fd418787b
[ "Apache-2.0" ]
6
2021-02-19T18:41:57.000Z
2021-03-05T06:02:17.000Z
from ..classes import * import sys import os import gym from plark_game import classes import gym_plark import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) # # Game settings tests # def test_class_env_parameter_overload_maximum_turns(): # Overloads the maximum turn count of the game, this is seperate from the bingo state value. maximum_turns = 1 kwargs = { 'maximum_turns': maximum_turns } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.maxTurns == maximum_turns def test_gym_env_parameter_overload_maximum_turns(): # Overloads the maximum turn count of the game, this is seperate from the bingo state value. maximum_turns = 1 kwargs = { 'maximum_turns': maximum_turns } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.maxTurns == maximum_turns def test_class_env_parameter_overload_map_width(): # Overloads the map width, the starting location of the pelican and panther need to be within the available width # for this test to pass map_width = 2 kwargs = { 'map_width': map_width, 'panther_start_col': 0, 'panther_start_row': 0, 'pelican_start_col': 0, 'pelican_start_row': 0 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.map_width == map_width def test_gym_env_parameter_overload_map_width(): # Overloads the map width, the starting location of the pelican and panther need to be within the available width # for this test to pass map_width = 2 kwargs = { 'map_width': map_width, 'panther_start_col': 0, 'panther_start_row': 0, 'pelican_start_col': 0, 'pelican_start_row': 0 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.map_width == map_width def test_class_env_parameter_overload_map_height(): # Overloads the map height, the starting loation of the pelican and panther need to be within the available width # for this test to pass map_height = 2 kwargs = { 'map_height': map_height, 'panther_start_col': 0, 'panther_start_row': 0, 'pelican_start_col': 0, 'pelican_start_row': 0 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.map_height == map_height def test_gym_env_parameter_overload_map_height(): # Overloads the map height, the starting loation of the pelican and panther need to be within the available width # for this test to pass map_height = 2 kwargs = { 'map_height': map_height, 'panther_start_col': 0, 'panther_start_row': 0, 'pelican_start_col': 0, 'pelican_start_row': 0 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.map_height == map_height def test_class_env_parameter_overload_driving_agent_panther(): # this test overloads the driving agent to be panther, this test requires a pelican agent to be set kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.driving_agent == 'panther' def test_gym_env_parameter_overload_driving_agent_panther(): # this test overloads the driving agent to be panther, this test requires a pelican agent to be set kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.driving_agent == 'panther' def test_class_env_parameter_overload_driving_agent_pelican(): # this test overloads the driving agent to be pelican, this test requires a panther agent to be set kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.driving_agent == 'pelican' def test_gym_class_parameter_overload_driving_agent_pelican(): # this test overloads the driving agent to be pelican, this test requires a panther agent to be set kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.driving_agent == 'pelican' # # # # Render settings # # def test_class_env_parameter_overload_render_hex_scale(): # this test overloads the hex scale parameter. kwargs = { 'hex_scale':10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.hexScale == 10 def test_gym_env_parameter_overload_render_hex_scale(): # this test overloads the hex scale parameter. kwargs = { 'hex_scale':10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.hexScale == 10 def test_class_envparameter_overload_render_output_view_all(): # this test overloads the output_view_all parameter. This overrides the view state to allow # for debugging, easier training and to view both agents for evaluation kwargs = { 'output_view_all':False } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.output_view_all == False def test_gym_env_parameter_overload_render_output_view_all(): # this test overloads the output_view_all parameter. This overrides the view state to allow # for debugging, easier training and to view both agents for evaluation kwargs = { 'output_view_all':False } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.output_view_all == False # # # # Panther parameters tests # # def test_class_env_parameter_overload_panther_move_limit(): # this test overloads the panther move limit, a pelican agent and panther move limit must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_move_limit': 0 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.panther_parameters['move_limit'] == 0 def test_gym_env_parameter_overload_panther_move_limit(): # this test overloads the panther move limit, a pelican agent and panther move limit must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_move_limit': 0 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.panther_parameters['move_limit'] == 0 def test_class_env_parameter_overload_panther_start_col(): # this test overloads the panther start col, a pelican agent and panther start col must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_start_col': 0 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pantherPlayer.col == 0 def test_gym_env_parameter_overload_panther_start_col(): # this test overloads the panther start col, a pelican agent and panther start col must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_start_col': 0 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pantherPlayer.col == 0 def test_class_env_parameter_overload_panther_start_row(): # this test overloads the panther start row, a pelican agent and panther start row must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_start_row': 0 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pantherPlayer.row == 0 def test_gym_env_parameter_overload_panther_start_row(): # this test overloads the panther start row, a pelican agent and panther start row must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_start_row': 0 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pantherPlayer.row == 0 def test_class_env_parameter_overload_panther_render_height(): # this test overloads the panther render height, a pelican agent and panther render height must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_render_height': 10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.panther_parameters['render_height'] == 10 def test_gym_env_parameter_overload_panther_render_height(): # this test overloads the panther render height, a pelican agent and panther render height must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_render_height': 10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.panther_parameters['render_height'] == 10 def test_class_envparameter_overload_panther_render_width(): # this test overloads the panther render width, a pelican agent and panther render width must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_render_width': 10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.panther_parameters['render_width'] == 10 def test_gym_env_parameter_overload_panther_render_width(): # this test overloads the panther render width, a pelican agent and panther render width must be provided. kwargs = { 'driving_agent': 'panther', 'pelican_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pelicanAgent_3_buoys.py", 'pelican_agent_name': "Pelican_Agent_3_Bouys", 'panther_render_width': 10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.panther_parameters['render_width'] == 10 # # # # Pelican paramater tests # # def test_class_env_parameter_overload_pelican_move_limit(): # this test overloads the pelican move limit, a panther agent and pelican move limit must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'pelican_move_limit': 0 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pelican_parameters['move_limit'] == 0 def test_gym_env_parameter_overload_pelican_move_limit(): # this test overloads the pelican move limit, a panther agent and pelican move limit must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'pelican_move_limit': 0 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pelican_parameters['move_limit'] == 0 def test_class_env_parameter_overload_pelican_madman_range(): # this test overloads the pelican madman sensor range, a panther agent and madman_range must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'madman_range': 5 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pelican_parameters['madman_range'] == 5 def test_gym_env_parameter_overload_pelican_madman_range(): # this test overloads the pelican madman sensor range, a panther agent and madman_range must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'madman_range': 5 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pelican_parameters['madman_range'] == 5 def test_class_env_parameter_overload_pelican_default_torps(): # this test overloads the pelicans default torpedos, a panther agent and default_torps must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'default_torps': 5 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pelican_parameters['default_torps'] == 5 def test_gym_env_parameter_overload_pelican_default_torps(): # this test overloads the pelicans default torpedos, a panther agent and default_torps must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'default_torps': 5 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pelican_parameters['default_torps'] == 5 def test_class_env_parameter_overload_pelican_default_sonobuoys(): # this test overloads the pelicans default sonobuoys, a panther agent and default_sonobuoys must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'default_sonobuoys': 2 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pelican_parameters['default_sonobuoys'] == 2 def test_gym_env_parameter_overload_pelican_default_sonobuoys(): # this test overloads the pelicans default sonobuoys, a panther agent and default_sonobuoys must be provided. map_height = 2 kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'default_sonobuoys': 2 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pelican_parameters['default_sonobuoys'] == 2 def test_class_env_parameter_overload_pelican_render_height(): # this test overloads the pelican render height, a panther agent and pelican render height must be provided. kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'pelican_render_height': 10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pelican_parameters['render_height'] == 10 def test_gym_env_parameter_overload_pelican_render_height(): # this test overloads the pelican render height, a panther agent and pelican render height must be provided. kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'pelican_render_height': 10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pelican_parameters['render_height'] == 10 def test_class_env_parameter_overload_pelican_render_width(): # this test overloads the pelican render width, a panther agent and pelican render width must be provided. kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'pelican_render_width': 10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.pelican_parameters['render_width'] == 10 def test_gym_env_parameter_overload_pelican_render_width(): # this test overloads the pelican render width, a panther agent and pelican render width must be provided. kwargs = { 'driving_agent': 'pelican', 'panther_agent_filepath': "/Components/plark-game/plark_game/agents/basic/pantherAgent_move_north.py", 'panther_agent_name': "Panther_Agent_Move_North", 'pelican_render_width': 10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.pelican_parameters['render_width'] == 10 # # # # Torpedo parameters test # # def test_class_env_parameter_overload_torpedos_turn_limit(): # this test overloads the torpedo turn limit. kwargs = { 'torpedos_turn_limit': 5 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.torpedo_parameters['turn_limit'] == 5 def test_gym_env_parameter_overload_torpedos_turn_limit(): # this test overloads the torpedo turn limit. kwargs = { 'torpedos_turn_limit': 5 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.torpedo_parameters['turn_limit'] == 5 def test_class_env_parameter_overload_torpedos_hunt(): # this test overloads the torpedo turn parameter. kwargs = { 'torpedos_hunt': False } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.torpedo_parameters['hunt'] == False def test_gym_env_parameter_overload_torpedos_hunt(): # this test overloads the torpedo turn parameter. kwargs = { 'torpedos_hunt': False } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.torpedo_parameters['hunt'] == False def test_class_env_parameter_overload_torpedos_speed(): # this test overloads the torpedo speed parameter. kwargs = { 'torpedos_speed': [1,1,1,1,1] } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.torpedo_parameters['speed'] == [1,1,1,1,1] def test_gym_env_parameter_overload_torpedos_speed(): # this test overloads the torpedo speed parameter. kwargs = { 'torpedos_speed': [1,1,1,1,1] } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.torpedo_parameters['speed'] == [1,1,1,1,1] def test_class_env_parameter_overload_torpedos_search_range(): # this test overloads the torpedo search range parameter. kwargs = { 'torpedos_search_range': 10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.torpedo_parameters['search_range'] == 10 def test_gym_env_parameter_overload_torpedos_search_range(): # this test overloads the torpedo search range parameter. kwargs = { 'torpedos_search_range': 10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.torpedo_parameters['search_range'] == 10 # # # # Sonobouy settings tests # # def test_class_env_parameter_overload_sonobuoy_active_range(): # this test overloads the sonobuoy active range parameter. kwargs = { 'sonobuoy_active_range': 10 } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.sonobuoy_parameters['active_range'] == 10 def test_gym_env_parameter_overload_sonobuoy_active_range(): # this test overloads the sonobuoy active range parameter. kwargs = { 'sonobuoy_active_range': 10 } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.sonobuoy_parameters['active_range'] == 10 def test_class_env_parameter_overload_sonobuoy_display_range(): # this test overloads the sonobuoy display range parameter. # This either shows the sb range on the map or not kwargs = { 'display_range': False } env = Environment() env.createNewGame(**kwargs) game = env.activeGames[len(env.activeGames)-1] assert game.sonobuoy_parameters['display_range'] == False def test_gym_env_parameter_overload_sonobuoy_display_range(): # this test overloads the sonobuoy display range parameter. # This either shows the sb range on the map or not kwargs = { 'display_range': False } gym_env = gym.make('plark-env-v0', **kwargs) game = gym_env.env.activeGames[len(gym_env.env.activeGames)-1] assert game.sonobuoy_parameters['display_range'] == False
34.74933
118
0.669637
3,215
25,923
5.12224
0.040435
0.081613
0.049551
0.06121
0.985851
0.985851
0.982997
0.975043
0.96812
0.962594
0
0.011763
0.232612
25,923
746
119
34.74933
0.816066
0.181345
0
0.779661
0
0
0.266705
0.150956
0
0
0
0
0.101695
1
0.101695
false
0
0.014831
0
0.116525
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
b2c5634fc6fdcd1c622fc5e06e9318efb5a21a7a
154
py
Python
veracode/API/exceptions.py
ctcampbell/veracode-python
519706785c4ab18c3392cd64fd79d7894adde10e
[ "BSD-3-Clause" ]
13
2019-03-16T03:11:50.000Z
2021-03-16T13:02:45.000Z
veracode/API/exceptions.py
ctcampbell/veracode-python
519706785c4ab18c3392cd64fd79d7894adde10e
[ "BSD-3-Clause" ]
6
2020-01-14T21:45:55.000Z
2022-03-03T17:56:43.000Z
veracode/API/exceptions.py
ctcampbell/veracode-python
519706785c4ab18c3392cd64fd79d7894adde10e
[ "BSD-3-Clause" ]
10
2020-01-20T13:34:55.000Z
2021-09-28T21:21:22.000Z
class VeracodeAuthenticationError(Exception): pass class VeracodeNotImplemented(Exception): pass class VeracodeConfigError(Exception): pass
17.111111
45
0.792208
12
154
10.166667
0.5
0.319672
0.295082
0
0
0
0
0
0
0
0
0
0.149351
154
8
46
19.25
0.931298
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
1
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
7
b2c90d24c35808971a7a79106ac597c0cd1fc82b
7,880
py
Python
isiscb/isisdata/migrations/0086_auto_20200112_2037.py
bgopalachary/IsisCB
c28e3f504eea60ebeff38318d8bb2071abb28ebb
[ "MIT" ]
4
2016-01-25T20:35:33.000Z
2020-04-07T15:39:52.000Z
isiscb/isisdata/migrations/0086_auto_20200112_2037.py
bgopalachary/IsisCB
c28e3f504eea60ebeff38318d8bb2071abb28ebb
[ "MIT" ]
41
2015-08-19T17:34:41.000Z
2022-03-11T23:19:01.000Z
isiscb/isisdata/migrations/0086_auto_20200112_2037.py
bgopalachary/IsisCB
c28e3f504eea60ebeff38318d8bb2071abb28ebb
[ "MIT" ]
2
2020-11-25T20:18:18.000Z
2021-06-24T15:15:41.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2020-01-12 20:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('isisdata', '0085_auto_20190902_1843'), ] operations = [ migrations.AlterField( model_name='aarelation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='acrelation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='attribute', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='authority', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='authoritytracking', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='ccrelation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='ccrelation', name='type_controlled', field=models.CharField(blank=True, choices=[(b'IC', b'Includes Chapter'), (b'ISA', b'Includes Series Article'), (b'ICO', b'Includes'), (b'RO', b'Is Review Of'), (b'RE', b'Responds To'), (b'AS', b'Is Associated With'), (b'RB', b'Is Reviewed By')], help_text=b'Type of relationship between two citation records.', max_length=3, null=True), ), migrations.AlterField( model_name='citation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='dataset', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalacrelation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalattribute', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalauthority', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalauthoritytracking', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalccrelation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalccrelation', name='type_controlled', field=models.CharField(blank=True, choices=[(b'IC', b'Includes Chapter'), (b'ISA', b'Includes Series Article'), (b'ICO', b'Includes'), (b'RO', b'Is Review Of'), (b'RE', b'Responds To'), (b'AS', b'Is Associated With'), (b'RB', b'Is Reviewed By')], help_text=b'Type of relationship between two citation records.', max_length=3, null=True), ), migrations.AlterField( model_name='historicalcitation', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicallinkeddata', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicalperson', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='historicaltracking', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='linkeddata', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), migrations.AlterField( model_name='tracking', name='record_status_value', field=models.CharField(blank=True, choices=[(b'Active', b'Active'), (b'Duplicate', b'Delete'), (b'Redirect', b'Redirect'), (b'Inactive', b'Inactive')], db_index=True, default=b'Active', max_length=255, null=True), ), ]
65.123967
349
0.624619
969
7,880
4.964912
0.105263
0.082935
0.063189
0.126585
0.902723
0.902723
0.902723
0.902723
0.902723
0.902723
0
0.014701
0.197208
7,880
120
350
65.666667
0.745811
0.008756
0
0.778761
1
0
0.294314
0.006404
0
0
0
0
0
1
0
false
0
0.017699
0
0.044248
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
b2eada3664f0d6d721ecbd29a1e6b0ca8a4d63a4
7,184
py
Python
RGB/feature_extraction/pretrainedCNNs.py
cvai-repo/emotionprediction
e1514221378c24a3ab55bcc0e21803d3f6934a6d
[ "MIT" ]
10
2019-11-14T12:54:29.000Z
2021-05-31T05:54:58.000Z
RGB/feature_extraction/pretrainedCNNs.py
cvai-repo/emotionprediction
e1514221378c24a3ab55bcc0e21803d3f6934a6d
[ "MIT" ]
1
2020-07-16T08:24:12.000Z
2020-07-16T08:24:12.000Z
RGB/feature_extraction/pretrainedCNNs.py
cvai-repo/emotionprediction
e1514221378c24a3ab55bcc0e21803d3f6934a6d
[ "MIT" ]
1
2021-03-14T13:17:32.000Z
2021-03-14T13:17:32.000Z
import torch import torchvision.models as models from torch import optim, nn # Remove the last fc layr to extract 2048 (or 4069)-feature vector class FeatureExtraction_ResNet18(nn.Module): def __init__(self): """Load the pretrained ResNet-18 and replace top fc layer.""" super(FeatureExtraction_ResNet18, self).__init__() pretrained_model = models.resnet18(pretrained=True) for param in pretrained_model.parameters(): # freeze all parameters param.requires_grad = False modules = list(pretrained_model.children())[:-1] # delete the last fc layer self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(512) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.modified_pretrained(images) ftrs = ftrs.reshape(ftrs.size(0), -1) ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_ResNet34(nn.Module): def __init__(self): """Load the pretrained ResNet-34 and replace top fc layer.""" super(FeatureExtraction_ResNet34, self).__init__() pretrained_model = models.resnet34(pretrained=True) for param in pretrained_model.parameters(): # freeze all parameters param.requires_grad = False modules = list(pretrained_model.children())[:-1] # delete the last fc layer self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(512) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.modified_pretrained(images) ftrs = ftrs.reshape(ftrs.size(0), -1) ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_ResNet50(nn.Module): def __init__(self): """Load the pretrained ResNet-50 and replace top fc layer.""" super(FeatureExtraction_ResNet50, self).__init__() pretrained_model = models.resnet50(pretrained=True) for param in pretrained_model.parameters(): # freeze all parameters param.requires_grad = False modules = list(pretrained_model.children())[:-1] # delete the last fc layer self.modified_pretrained = nn.Sequential(*modules) #self.bn = nn.BatchNorm1d(2048) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.modified_pretrained(images) ftrs = ftrs.reshape(ftrs.size(0), -1) #ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_ResNet101(nn.Module): def __init__(self): """Load the pretrained ResNet-101 and replace top fc layer.""" super(FeatureExtraction_ResNet101, self).__init__() pretrained_model = models.resnet101(pretrained=True) for param in pretrained_model.parameters(): param.requires_grad = False modules = list(pretrained_model.children())[:-1] # delete the last fc layer. self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(2048) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.modified_pretrained(images) # ftrs means features ftrs = ftrs.reshape(ftrs.size(0), -1) # Extract a 2048-feature vector ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_ResNet152(nn.Module): def __init__(self): """Load the pretrained ResNet-152 and replace top fc layer.""" super(FeatureExtraction_ResNet152, self).__init__() pretrained_model = models.resnet152(pretrained=True) for param in pretrained_model.parameters(): param.requires_grad = False modules = list(pretrained_model.children())[:-1] # delete the last fc layer. self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(2048) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.modified_pretrained(images) # ftrs means features ftrs = ftrs.reshape(ftrs.size(0), -1) # Extract a 2048-feature vector ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_VGG19(nn.Module): def __init__(self): """Load the pretrained ResNet-152 and replace top fc layer.""" super(FeatureExtraction_VGG19, self).__init__() pretrained_model = models.vgg19(pretrained = True) for param in pretrained_model.parameters(): param.requires_grad = False self.features = pretrained_model.features # Convert all the layes to list and remove the last one modules = list(pretrained_model.classifier.children())[:-1] # delete the last linear layer. # Convert it into container and add it to our model class self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(4096) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.features(images) ftrs = ftrs.reshape(ftrs.size(0), -1) ftrs = self.modified_pretrained(ftrs) ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_VGG16(nn.Module): def __init__(self): """Load the pretrained ResNet-152 and replace top fc layer.""" super(FeatureExtraction_VGG16, self).__init__() pretrained_model = models.vgg16(pretrained = True) for param in pretrained_model.parameters(): param.requires_grad = False self.features = pretrained_model.features # Convert all the layes to list and remove the last one modules = list(pretrained_model.classifier.children())[:-1] # delete the last fc layer. # Convert it into container and add it to our model class self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(4096) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.features(images) ftrs = ftrs.reshape(ftrs.size(0), -1) ftrs = self.modified_pretrained(ftrs) ftrs = self.bn(ftrs) return ftrs class FeatureExtraction_AlexNet(nn.Module): def __init__(self): """Load the pretrained ResNet-152 and replace top fc layer.""" super(FeatureExtraction_AlexNet, self).__init__() pretrained_model = models.alexnet(pretrained = True) for param in pretrained_model.parameters(): param.requires_grad = False self.features = pretrained_model.features # Convert all the layes to list and remove the last one modules = list(pretrained_model.classifier.children())[:-1] # delete the last fc layer. # Convert it into container and add it to our model class self.modified_pretrained = nn.Sequential(*modules) self.bn = nn.BatchNorm1d(4096) def forward(self, images): """Extract feature vectors from input images.""" ftrs = self.features(images) ftrs = ftrs.reshape(ftrs.size(0), -1) ftrs = self.modified_pretrained(ftrs) ftrs = self.bn(ftrs) return ftrs
36.282828
100
0.660078
857
7,184
5.380397
0.106184
0.087833
0.076339
0.026025
0.928649
0.878334
0.878334
0.8419
0.8419
0.805465
0
0.026972
0.24137
7,184
197
101
36.467005
0.819083
0.225084
0
0.773109
0
0
0
0
0
0
0
0
0
1
0.134454
false
0
0.02521
0
0.294118
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3323ff948516df0ba92b8fd9aba3bced7e9a7005
151
py
Python
wikidata_tree_generator/__init__.py
lmallez/wikidata-tree-generator
4fe6b8af6615083e670bdd9495624f4292fd53c0
[ "MIT" ]
4
2020-07-06T09:48:30.000Z
2020-10-27T06:56:44.000Z
wikidata_tree_generator/__init__.py
lmallez/wikidata-tree-generator
4fe6b8af6615083e670bdd9495624f4292fd53c0
[ "MIT" ]
2
2020-10-10T13:59:19.000Z
2021-06-25T15:44:46.000Z
wikidata_tree_generator/__init__.py
lmallez/wikidata-tree-generator
4fe6b8af6615083e670bdd9495624f4292fd53c0
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 from .generate_from_yaml import generate_from_yaml from .launcher import Launcher from .launcher_creator import LauncherCreator
30.2
50
0.854305
21
151
5.904762
0.52381
0.193548
0.258065
0
0
0
0
0
0
0
0
0.007299
0.092715
151
4
51
37.75
0.89781
0.139073
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7