class SimpleIO(AdminSIO): """ Consult StatsElem's docstring for the description of output parameters. """ input_required = (UTC('start'), UTC('stop')) input_optional = ('service_name', Integer('n'), 'n_type') output_optional = ('service_name', 'usage', 'mean', 'rate', 'time', 'usage_trend', 'mean_trend', 'min_resp_time', 'max_resp_time', 'all_services_usage', 'all_services_time', 'mean_all_services', 'usage_perc_all_services', 'time_perc_all_services')
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_message_get_request' response_elem = 'zato_pubsub_message_get_response' input_required = ('cluster_id', AsIs('msg_id')) output_required = ('topic', 'producer', 'priority', 'mime_type', 'expiration', UTC('creation_time_utc'), UTC('expire_at_utc')) output_optional = ('payload', )
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_message_get_list_request' response_elem = 'zato_pubsub_message_get_list_response' input_required = ('cluster_id', 'source_type', 'source_name') output_required = (AsIs('msg_id'), 'topic', 'mime_type', Int('priority'), Int('expiration'), UTC('creation_time_utc'), UTC('expire_at_utc'), 'producer')
class SimpleIO(AdminSIO): request_elem = 'zato_pattern_delivery_definition_get_list_request' response_elem = 'zato_pattern_delivery_definition_get_list_response' input_required = ('cluster_id', 'target_type') output_required = ('id', 'name', 'target', 'target_type', 'expire_after', 'expire_arch_succ_after', 'expire_arch_fail_after', 'check_after', 'retry_repeats', 'retry_seconds', 'short_def', 'total_count', 'in_progress_count', 'in_doubt_count', 'confirmed_count', 'failed_count') output_optional = (UTC('last_updated_utc'), UTC('last_used_utc'), 'callback_list')
def test_sio(self): self.assertEquals(self.sio.request_elem, 'zato_stats_delete_request') self.assertEquals(self.sio.response_elem, 'zato_stats_delete_response') self.assertEquals(self.sio.input_required, (self.wrap_force_type( UTC('start')), self.wrap_force_type(UTC('stop')))) self.assertEquals(self.sio.namespace, zato_namespace) self.assertRaises(AttributeError, getattr, self.sio, 'input_optional') self.assertRaises(AttributeError, getattr, self.sio, 'output_required') self.assertRaises(AttributeError, getattr, self.sio, 'output_optional') self.assertRaises(AttributeError, getattr, self.sio, 'output_repeated')
class SimpleIO: input_required = (AsIs('should_as_is'), 'is_boolean', 'should_boolean', CSV('csv1'), Dict('dict'), Float('float'), Integer('integer'), Integer('integer2'), List('list'), ListOfDicts('list_of_dicts'), Unicode('unicode1'), Unicode('unicode2'), UTC('utc')) output_required = (AsIs('should_as_is'), 'is_boolean', 'should_boolean', CSV('csv1'), CSV('csv2'), CSV('csv3'), Dict('dict'), Float('float'), Integer('integer'), Integer('integer2'), List('list'), ListOfDicts('list_of_dicts'), Unicode('unicode1'), Unicode('unicode2'), UTC('utc'))
def test_sio(self): self.assertEquals(self.sio.input_required, (self.wrap_force_type( UTC('start')), self.wrap_force_type(UTC('stop')))) self.assertEquals( self.sio.input_optional, ('service_name', self.wrap_force_type(Integer('n')), 'n_type')) self.assertEquals( self.sio.output_optional, ('service_name', 'usage', 'mean', 'rate', 'time', 'usage_trend', 'mean_trend', 'min_resp_time', 'max_resp_time', 'all_services_usage', 'all_services_time', 'mean_all_services', 'usage_perc_all_services', 'time_perc_all_services')) self.assertEquals(self.sio.namespace, zato_namespace) self.assertRaises(AttributeError, getattr, self.sio, 'output_required') self.assertRaises(AttributeError, getattr, self.sio, 'output_repeated')
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_consumers_get_list_request' response_elem = 'zato_pubsub_consumers_get_list_response' input_required = ('cluster_id', 'topic_name') output_required = ('id', 'name', 'is_active', 'sec_type', Int('max_backlog'), Int('current_depth'), 'sub_key', 'delivery_mode') output_optional = (UTC('last_seen'), 'callback')
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_consumers_get_info_request' response_elem = 'zato_pubsub_consumers_get_info_response' input_required = ('id', ) output_required = ('cluster_id', 'name', UTC('last_seen'), Int('current_depth'), Int('in_flight_depth'), 'sub_key')
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_topics_get_list_request' response_elem = 'zato_pubsub_topics_get_list_response' input_required = ('cluster_id',) output_required = ('id', 'name', 'is_active', Int('current_depth'), Int('max_depth'), Int('consumers_count'), Int('producers_count')) output_optional = (UTC('last_pub_time'),)
def test_sio(self): self.assertEquals(self.sio.request_elem, 'zato_stats_get_by_service_request') self.assertEquals(self.sio.response_elem, 'zato_stats_get_by_service_response') self.assertEquals(self.sio.input_required, (self.wrap_force_type(UTC('start')), self.wrap_force_type(UTC('stop')), 'service_id')) self.assertEquals(self.sio.output_optional, ('service_name', 'usage', 'mean', 'rate', 'time', 'usage_trend', 'mean_trend', 'min_resp_time', 'max_resp_time',)) self.assertEquals(self.sio.namespace, zato_namespace) self.assertRaises(AttributeError, getattr, self.sio, 'output_required') self.assertRaises(AttributeError, getattr, self.sio, 'output_repeated')
class SimpleIO: input_required = (AsIs('is_a'), Boolean('b'), Bool('c'), CSV('d'), Dict('e'), Float('f'), Int('g'), Integer('h'), List('i'), ListOfDicts('j'), Nested('k'), Opaque('l'), Unicode('m'), UTC('n')) input_optional = (AsIs('is_aa'), Boolean('bb'), Bool('cc'), CSV('dd'), Dict('ee'), Float('ff'), Int('gg'), Integer('hh'), List('ii'), ListOfDicts('jj'), Nested('kk'), Opaque('ll'), Unicode('mm'), UTC('nn')) output_required = (AsIs('is_aaa'), Boolean('bbb'), Bool('ccc'), CSV('ddd'), Dict('eee'), Float('fff'), Int('ggg'), Integer('hhh'), List('iii'), ListOfDicts('jjj'), Nested('kkk'), Opaque('lll'), Unicode('mmm'), UTC('nnn')) output_optional = (AsIs('is_aaaa'), Boolean('bbbb'), Bool('cccc'), CSV('dddd'), Dict('eeee'), Float('ffff'), Int('gggg'), Integer('hhhh'), List('iiii'), ListOfDicts('jjjj'), Nested('kkkk'), Opaque('llll'), Unicode('mmmm'), UTC('nnnn'))
class SimpleIO(AdminSIO): request_elem = 'zato_stats_delete_request' response_elem = 'zato_stats_delete_response' input_required = (UTC('start'), UTC('stop'))
class SimpleIO: input_required = (UTC('utc1'), UTC('utc2')) output_required = (UTC('utc1'), UTC('utc2'))
class SimpleIO(GetSummaryBase.SimpleIO): request_elem = 'zato_stats_get_summary_by_range_request' response_elem = 'zato_stats_get_summary_by_range_response' input_required = GetSummaryBase.SimpleIO.input_required + (UTC('stop'),)
class SimpleIO(StatsReturningService.SimpleIO): input_required = (UTC('start'), Integer('n'), 'n_type') input_optional = ('service_name',)
class SimpleIO(StatsReturningService.SimpleIO): input_required = (UTC('start'), Integer('n'), 'n_type')
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_topics_get_info_request' response_elem = 'zato_pubsub_topics_get_info_response' input_required = ('id', ) output_required = ('cluster_id', 'name', UTC('last_seen'))
class SimpleIO(GetListAdminSIO): request_elem = 'zato_pubsub_producers_get_list_request' response_elem = 'zato_pubsub_producers_get_list_response' input_required = ('cluster_id', 'topic_name') output_required = ('id', 'name', 'is_active', 'sec_type') output_optional = (UTC('last_seen'), )
class SimpleIO(AdminSIO): request_elem = 'zato_pubsub_topics_get_info_request' response_elem = 'zato_pubsub_topics_get_info_response' input_required = ('cluster_id', 'name') output_required = (Int('current_depth'), Int('consumers_count'), Int('producers_count'), UTC('last_pub_time'))