class GenericFormTemplate(GatewayForm): """Form template to generate html and javascript for page""" workflow_name = "table_component" workflow_permission = "table_component_page" object_type = CustomSelectField( workflow_name=workflow_name, permissions=workflow_permission, label="Object Type", choices_function=get_object_types, required=True, is_disabled_on_start=False, ) keyword = CustomStringField(label="Keyword", is_disabled_on_start=False, required=True) search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default="Search Objects", inputs={ "keyword": "keyword", "object_type": "object_type" }, server_side_method=find_objects_by_type_endpoint, display_message=True, on_complete=["call_output_table", "call_server_table"], is_disabled_on_start=False, ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label="", data_function=raw_table_data, on_complete=["custom_js_table_loaded"], ) server_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label="Server table", server_side_method=server_table_data_endpoint, data_function=raw_table_data, table_features={ "searching": False, "paging": False, "ordering": False, "info": False }, inputs={ "keyword": "keyword", "object_type": "object_type" }, )
class GenericFormTemplate(GatewayForm): """ Form template to generate html and javascript for page """ workflow_name = 'table_component' workflow_permission = 'table_component_page' object_type = CustomSelectField( workflow_name=workflow_name, permissions=workflow_permission, label='Object Type', choices_function=get_object_types, required=True, is_disabled_on_start=False ) keyword = CustomStringField( label='Keyword', is_disabled_on_start=False, required=True ) search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default='Search Objects', inputs={'keyword': 'keyword', 'object_type': 'object_type'}, server_side_method=find_objects_by_type_endpoint, display_message=True, on_complete=['call_output_table', 'call_server_table'], is_disabled_on_start=False ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, on_complete=['custom_js_table_loaded'] ) server_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label='Server table', server_side_method=server_table_data_endpoint, data_function=raw_table_data, table_features={ 'searching': False, 'paging': False, 'ordering': False, 'info': False }, inputs={'keyword': 'keyword', 'object_type': 'object_type'} )
class GenericFormTemplate(GatewayForm): """ Generic form Template Note: When updating the form, remember to make the corresponding changes to the workflow pages """ workflow_name = 'get_audit_info' workflow_permission = 'get_audit_info_page' interval = CustomSelectField(workflow_name=workflow_name, permissions=workflow_permission, label='Time Interval', choices=[('Please Select', 'Please Select'), ('1 hours', '1 hours'), ('2 hours', '2 hours'), ('5 hours', '5 hours'), ('12 hours', '12 hours'), ('24 hours', '24 hours')], required=True, enable_on_complete=['search'], is_disabled_on_start=False) search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default='Search Objects', inputs={'interval': 'interval'}, server_side_method=find_objects_by_type_endpoint, display_message=True, on_complete=['call_server_table'], enable_on_complete=['submit'], is_disabled_on_start=True) server_table = TableField(workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, table_features={ 'searching': True, 'paging': True, 'ordering': True, 'info': True }, inputs={'ip4_network': 'ip4_network'})
class GenericFormTemplate(GatewayForm): """ Generic form Template Note: When updating the form, remember to make the corresponding changes to the workflow pages """ workflow_name = 'bulk_record_export' workflow_permission = 'bulk_record_export_page' ip4_network = IP4Network(workflow_name=workflow_name, permissions=workflow_permission, label='Network', required=True, one_off=False, enable_on_complete=['search'], is_disabled_on_start=False) search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default='Search Objects', inputs={'ip4_network': 'ip4_network'}, server_side_method=find_objects_by_type_endpoint, display_message=True, on_complete=['call_server_table'], enable_on_complete=['submit'], is_disabled_on_start=True) server_table = TableField(workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, table_features={ 'searching': True, 'paging': True, 'ordering': True, 'info': True }, inputs={'ip4_network': 'ip4_network'})
class GenericFormTemplate(GatewayForm): workflow_name = 'lease_history_mac' workflow_permission = 'lease_history_mac_page' text = get_resource_text() mac_address = CustomStringField( label=text['label_mac_address'], default='FF:FF:FF:FF:FF:FF', validators=[DataRequired(message=text['require_message']), MacAddress()], required=True, is_disabled_on_start=False ) query_history = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, label=text['label_query'], default='Search Objects', inputs={'mac_address': 'mac_address'}, server_side_method=query_history_by_mac_endpoint, display_message=True, on_complete=['call_output_table'], is_disabled_on_start=False ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, table_features={ 'searching': False, 'ordering': False, 'info': False, 'lengthChange': False }, is_disabled_on_start=False )
class GenericFormTemplate(GatewayForm): workflow_name = 'query_unused_mac_address' workflow_permission = 'query_unused_mac_address_page' text = get_resource_text() expire_time = DateTimeField( text['label_expire_time'], default=datetime.datetime.now(), format='%Y-%m-%d' ) query_history = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, label=text['label_query'], default='Search Objects', inputs={'expire_time': 'expire_time'}, server_side_method=query_unused_mac_address_endpoint, display_message=True, on_complete=['call_output_table'], is_disabled_on_start=False ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, table_features={ 'searching': False, 'ordering': False, 'info': False, 'lengthChange': False }, is_disabled_on_start=False )
class GenericFormTemplate(GatewayForm): """ Form to generate HTML and Javascript for the update_text_record workflow Note: When updating the form, remember to make the corresponding changes to the workflow pages """ workflow_name = 'update_text_record' workflow_permission = 'update_text_record_page' configuration = Configuration( workflow_name=workflow_name, permissions=workflow_permission, label='Configuration', required=True, coerce=int, clear_below_on_change=False, is_disabled_on_start=False, on_complete=['call_view'], enable_dependencies={'on_complete': ['view']}, disable_dependencies={'on_change': ['view']}, clear_dependencies={'on_change': ['view']}) view = View(workflow_name=workflow_name, permissions=workflow_permission, label='View', required=True, one_off=True, clear_below_on_change=False, display_message=True, enable_dependencies={'on_complete': ['parent_zone']}, disable_dependencies={'on_change': ['parent_zone']}, clear_dependencies={'on_change': ['parent_zone']}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True) parent_zone = Zone( workflow_name=workflow_name, permissions=workflow_permission, label='Zone', required=True, start_initialized=True, display_message=True, inputs={ 'zone': 'parent_zone', 'configuration': 'configuration', 'view': 'view' }, clear_below_on_change=False, enable_dependencies={'on_complete': ['text_record', 'search']}, disable_dependencies={'on_change': ['text_record', 'search']}, clear_dependencies={'on_change': ['text_record', 'search']}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True) text_record = CustomStringField(label='Text Record') search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default='Search', inputs={ 'configuration': 'configuration', 'view': 'view', 'parent_zone': 'parent_zone', 'name': 'text_record' }, server_side_method=get_text_records_endpoint, display_message=True, on_complete=['call_txt_list'], enable_dependencies={'on_complete': ['txt_filter', 'txt_list']}, disable_dependencies={ 'on_change': ['txt_filter', 'txt_list'], 'on_click': ['txt_filter', 'txt_list'] }, clear_dependencies={ 'on_change': ['txt_filter', 'txt_list'], 'on_click': ['txt_filter', 'txt_list'] }, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True) txt_filter = CustomStringField(label='Filter', is_disabled_on_error=True) txt_list = FilteredSelectField( workflow_name=workflow_name, permissions=workflow_permission, label='Text', size=12, filter_field='txt_filter', choices=[(0, '')], coerce=int, is_disabled_on_error=True, on_complete=['call_name_js', 'call_text'], inputs={ 'configuration': 'configuration', 'view': 'view', 'parent_zone': 'parent_zone', 'name': 'text_record' }, clear_dependencies={'on_change': ['name', 'text']}, server_side_method=get_text_records_endpoint, enable_dependencies={'on_complete': ['name', 'text', 'submit']}, disable_dependencies={'on_change': ['name', 'text', 'submit']}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True) plain_1 = PlainHTML('<hr>') name = CustomStringField(label='New Name', is_disabled_on_error=True) text = CustomStringField(label='New Text', inputs={'text': 'txt_list'}, is_disabled_on_error=True) submit = CustomSubmitField(label='Update')
class GenericFormTemplate(GatewayForm): """ Form to generate HTML and Javascript for the snow_add_host_record_example workflow Note: When updating the form, remember to make the corresponding changes to the workflow pages """ workflow_name = 'service_request_host' workflow_permission = 'service_request_host_page' zone = CustomZone( workflow_name=workflow_name, permissions=workflow_permission, label='Zone', required=True, is_disabled_on_start=False ) input_x1_button_x1_aligned_open_1 = PlainHTML('<div class="input_x1_button_x1_aligned">') input_x1_aligned_open_1 = PlainHTML('<div class="input_x1_aligned">') ip4_network = IP4Network( workflow_name=workflow_name, permissions=workflow_permission, label='Network (Optional)', required=False, one_off=False, is_disabled_on_start=False ) input_x1_aligned_close_1 = PlainHTML('</div>') get_next_available_ip4 = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, label='Get Next IPv4', server_side_method=get_next_ip4_address_endpoint, on_complete=['populate_ip4_address'], is_disabled_on_start=False, ) input_x1_button_x1_aligned_close_1 = PlainHTML('</div>') clearfix_2 = PlainHTML('<div class="clearfix"> </div>') ip4_address = CustomIP4Address( workflow_name=workflow_name, permissions=workflow_permission, label='IP Address', required=True, inputs={'address': 'ip4_address'}, result_decorator=filter_reserved, should_cascade_disable_on_change=True, is_disabled_on_start=False ) hostname = CustomStringField( label='Hostname', required=True, is_disabled_on_start=False ) deploy_now = CustomBooleanField( label='Deploy Now', is_disabled_on_start=False ) submit = CustomSubmitField( label='Submit', is_disabled_on_start=False )
class GenericFormTemplate(GatewayForm): # When updating the form, remember to make the corresponding changes to the workflow pages workflow_name = 'update_text_record_example' workflow_permission = 'update_text_record_example_page' configuration = Configuration(workflow_name=workflow_name, permissions=workflow_permission, label='Configuration', required=True, coerce=int, validators=[], is_disabled_on_start=False, on_complete=['call_view'], enable_on_complete=['view']) view = View(workflow_name=workflow_name, permissions=workflow_permission, label='View', required=True, one_off=True, on_complete=[], enable_on_complete=['parent_zone']) parent_zone = Zone(workflow_name=workflow_name, permissions=workflow_permission, label='Zone', required=True, start_initialized=True, inputs={ 'zone': 'parent_zone', 'configuration': 'configuration', 'view': 'view' }, enable_on_complete=['text_record', 'search']) text_record = CustomStringField(label='Text Record') search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default='Search', inputs={ 'configuration': 'configuration', 'view': 'view', 'parent_zone': 'parent_zone', 'name': 'text_record' }, server_side_method=get_text_records_endpoint, message_field='search_message', on_click=['populate_txt_list'], enable_on_complete=['txt_filter', 'txt_list']) plain_0 = PlainHTML('<div id="search_message"></div>') txt_filter = CustomStringField(label='Filter', is_disabled_on_error=True) txt_list = FilteredSelectField( workflow_name=workflow_name, permissions=workflow_permission, label='Text', size=12, filter_field='txt_filter', choices=[(0, '')], coerce=int, is_disabled_on_error=True, on_complete=['call_name_js', 'call_text'], enable_on_complete=['name', 'text', 'submit']) plain_1 = PlainHTML('<hr>') name = CustomStringField(label='New Name', is_disabled_on_error=True) text = CustomStringField(label='New Text', inputs={'text': 'txt_list'}, is_disabled_on_error=True) submit = SubmitField(label='Update', render_kw={'disabled': True})
class GenericFormTemplate(GatewayForm): """ Cisco ACI form Note: When updating the form, remember to make the corresponding changes to the workflow pages """ workflow_name = 'cisco_aci' workflow_permission = 'cisco_aci_page' apic_ip = CustomStringField( label='APIC IP', required=True, default='', validators=[DataRequired()], is_disabled_on_start=False, ) apic_username = CustomStringField( label='APIC USERNAME', default='', required=True, validators=[DataRequired()], is_disabled_on_start=False, ) apic_password = CustomPasswordField( label='APIC PASSWORD', default='abc', validators=[DataRequired()], is_disabled_on_start=False, ) optional = PlainHTML( '<hr/><h4>OPTIONAL</h4><p>Import ACI Fabric only if you wish to import APIC, SPINE, and' ' LEAF devices to the selected BAM configuration.</p><br/>') import_devices_checkbox = CustomBooleanField( label='Import ACI Fabric Devices to', on_checked=['enable_configuration'], on_unchecked=['disable_configuration', 'disable_import_fabric'], is_disabled_on_start=False, ) configuration = Configuration( workflow_name=workflow_name, permissions=workflow_permission, coerce=int, label='', validators=[], enable_dependencies={'on_complete': ['import_fabric']}, disable_dependencies={'on_change': ['import_fabric']}, clear_below_on_change=False, ) import_fabric = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, label='IMPORT FABRIC', default='IMPORT', server_side_method=add_fabric, display_message=True, ) html = PlainHTML('<br/><br/><hr/>') discover = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, label='DISCOVER TENANTS', is_disabled_on_start=False, default='Search', on_complete=[ 'call_output_table', 'add_checkall_button', 'add_on_page_change_listener' ], server_side_method=get_tenants, display_message=True, ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, is_disabled_on_start=False, ) import_tenants = SimpleButtonField( workflow_name=workflow_name, permissions=workflow_permission, label='IMPORT INFRASTRUCTURE', is_disabled_on_start=False, default='Search', )
class GenericFormTemplate(GatewayForm): """class used to structure all the elements on the page""" workflow_name = 'selective_deployment' workflow_permission = 'selective_deployment_page' configuration = Configuration( workflow_name=workflow_name, permissions=workflow_permission, label='Configuration', required=True, coerce=int, clear_below_on_change=False, is_disabled_on_start=False, on_complete=['call_view'], enable_dependencies={'on_complete': ['view']}, disable_dependencies={'on_change': ['view']}, clear_dependencies={'on_change': ['view']}) view = View(workflow_name=workflow_name, permissions=workflow_permission, label='View', required=True, one_off=True, clear_below_on_change=False, display_message=True, enable_dependencies={'on_complete': ['zone']}, disable_dependencies={'on_change': ['zone']}, clear_dependencies={'on_change': ['zone']}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True) zone = Zone( workflow_name=workflow_name, permissions=workflow_permission, label='Zone', required=True, start_initialized=True, display_message=True, inputs={ 'zone': 'zone', 'configuration': 'configuration', 'view': 'view' }, clear_below_on_change=False, enable_dependencies={'on_complete': ['search']}, disable_dependencies={ 'on_change': ['search'], 'on_click': ['search'] }, clear_dependencies={ 'on_change': ['search'], 'on_click': ['search'] }, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default='Search Objects', inputs={ 'zone': 'zone', 'view': 'view', 'configuration': 'configuration' }, server_side_method=find_objects_by_type_endpoint, display_message=True, label='SEARCH DNS', on_complete=['call_output_table'], enable_dependencies={'on_complete': ['deploy', 'output_table']}, disable_dependencies={'on_change': ['deploy', 'output_table']}, clear_below_on_change=False, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label='', data_function=raw_table_data, table_features={'lengthMenu': [10, 20, 30, 40, 50, 100, 500, 1000]}) deploy = CustomButtonField( workflow_name=workflow_name, permissions=workflow_permission, label='Deploy', display_message=True, )
class GenericFormTemplate(GatewayForm): """class used to structure all the elements on the page""" workflow_name = "selective_deployment" workflow_permission = "selective_deployment_page" configuration = Configuration( workflow_name=workflow_name, permissions=workflow_permission, label="Configuration", required=True, coerce=int, clear_below_on_change=False, is_disabled_on_start=False, on_complete=["call_view"], enable_dependencies={"on_complete": ["view"]}, disable_dependencies={"on_change": ["view"]}, clear_dependencies={"on_change": ["view"]}, ) view = View( workflow_name=workflow_name, permissions=workflow_permission, label="View", required=True, one_off=True, clear_below_on_change=False, display_message=True, enable_dependencies={"on_complete": ["zone"]}, disable_dependencies={"on_change": ["zone"]}, clear_dependencies={"on_change": ["zone"]}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) zone = Zone( workflow_name=workflow_name, permissions=workflow_permission, label="Zone", required=True, start_initialized=True, display_message=True, inputs={ "zone": "zone", "configuration": "configuration", "view": "view" }, clear_below_on_change=False, enable_dependencies={"on_complete": ["search"]}, disable_dependencies={ "on_change": ["search"], "on_click": ["search"] }, clear_dependencies={ "on_change": ["search"], "on_click": ["search"] }, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default="Search Objects", inputs={ "zone": "zone", "view": "view", "configuration": "configuration" }, server_side_method=find_objects_by_type_endpoint, display_message=True, label="SEARCH DNS", on_complete=["call_output_table"], enable_dependencies={"on_complete": ["deploy", "output_table"]}, disable_dependencies={"on_change": ["deploy", "output_table"]}, clear_below_on_change=False, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) output_table = TableField( workflow_name=workflow_name, permissions=workflow_permission, label="", data_function=raw_table_data, table_features={"lengthMenu": [10, 20, 30, 40, 50, 100, 500, 1000]}, ) deploy = CustomButtonField( workflow_name=workflow_name, permissions=workflow_permission, label="Deploy", display_message=True, )
class GenericFormTemplate(GatewayForm): """Form to generate HTML and Javascript for the update_text_record workflow Note: When updating the form, remember to make the corresponding changes to the workflow pages """ workflow_name = "update_text_record" workflow_permission = "update_text_record_page" configuration = Configuration( workflow_name=workflow_name, permissions=workflow_permission, label="Configuration", required=True, coerce=int, clear_below_on_change=False, is_disabled_on_start=False, on_complete=["call_view"], enable_dependencies={"on_complete": ["view"]}, disable_dependencies={"on_change": ["view"]}, clear_dependencies={"on_change": ["view"]}, ) view = View( workflow_name=workflow_name, permissions=workflow_permission, label="View", required=True, one_off=True, clear_below_on_change=False, display_message=True, enable_dependencies={"on_complete": ["parent_zone"]}, disable_dependencies={"on_change": ["parent_zone"]}, clear_dependencies={"on_change": ["parent_zone"]}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) parent_zone = Zone( workflow_name=workflow_name, permissions=workflow_permission, label="Zone", required=True, start_initialized=True, display_message=True, inputs={"zone": "parent_zone", "configuration": "configuration", "view": "view"}, clear_below_on_change=False, enable_dependencies={"on_complete": ["text_record", "search"]}, disable_dependencies={"on_change": ["text_record", "search"]}, clear_dependencies={"on_change": ["text_record", "search"]}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) text_record = CustomStringField(label="Text Record") search = CustomSearchButtonField( workflow_name=workflow_name, permissions=workflow_permission, default="Search", inputs={ "configuration": "configuration", "view": "view", "parent_zone": "parent_zone", "name": "text_record", }, server_side_method=get_text_records_endpoint, display_message=True, on_complete=["call_txt_list"], enable_dependencies={"on_complete": ["txt_filter", "txt_list"]}, disable_dependencies={ "on_change": ["txt_filter", "txt_list"], "on_click": ["txt_filter", "txt_list"], }, clear_dependencies={ "on_change": ["txt_filter", "txt_list"], "on_click": ["txt_filter", "txt_list"], }, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) txt_filter = CustomStringField(label="Filter", is_disabled_on_error=True) txt_list = FilteredSelectField( workflow_name=workflow_name, permissions=workflow_permission, label="Text", size=12, filter_field="txt_filter", choices=[(0, "")], coerce=int, is_disabled_on_error=True, on_complete=["call_name_js", "call_text"], inputs={ "configuration": "configuration", "view": "view", "parent_zone": "parent_zone", "name": "text_record", }, clear_dependencies={"on_change": ["name", "text"]}, server_side_method=get_text_records_endpoint, enable_dependencies={"on_complete": ["name", "text", "submit"]}, disable_dependencies={"on_change": ["name", "text", "submit"]}, should_cascade_disable_on_change=True, should_cascade_clear_on_change=True, ) plain_1 = PlainHTML("<hr>") name = CustomStringField(label="New Name", is_disabled_on_error=True) text = CustomStringField( label="New Text", inputs={"text": "txt_list"}, is_disabled_on_error=True ) submit = CustomSubmitField(label="Update")