示例#1
0
 class SimpleIO:
     input_required = ('topic_name',)
     input_optional = (AsIs('data'), List('data_list'), AsIs('msg_id'), 'has_gd', Int('priority'), Int('expiration'),
         'mime_type', AsIs('correl_id'), 'in_reply_to', AsIs('ext_client_id'), 'ext_pub_time', 'pub_pattern_matched',
         'security_id', 'ws_channel_id', 'service_id', 'data_parsed', 'meta', AsIs('group_id'),
         Int('position_in_group'), 'endpoint_id', List('reply_to_sk'), List('deliver_to_sk'))
     output_optional = (AsIs('msg_id'), List('msg_id_list'))
示例#2
0
文件: user.py 项目: sharkwing/zato
 class SimpleIO(_CtxInputUsing.SimpleIO):
     input_required = ('ust', 'current_app')
     input_optional = (AsIs('user_id'), 'username', 'email', 'display_name',
                       'first_name', 'middle_name',
                       'last_name', 'sign_up_status', 'approval_status',
                       Bool('paginate'), Int('cur_page'), Int('page_size'),
                       'name_op', 'is_name_exact')
     output_required = ('status', )
     output_optional = BaseSIO.output_optional + (
         Int('total'), Int('num_pages'), Int('page_size'), Int('cur_page'),
         'has_next_page', 'has_prev_page', Int('next_page'),
         Int('prev_page'), List('result'))
     default_value = _invalid
示例#3
0
    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'))
示例#4
0
文件: meta.py 项目: HarshCasper/zato
def get_io(attrs, elems_name, is_edit, is_required, is_output, is_get_list, has_cluster_id):

    # This can be either a list or an SQLAlchemy object
    elems = attrs.get(elems_name) or []
    columns = []

    # Generate elems out of SQLAlchemy tables, including calls to SIOElem's subclasses, such as Bool or Int.

    if elems and isclass(elems) and issubclass(elems, Base):

        columns_to_visit = list(elems._sa_class_manager.mapper.mapped_table.columns)
        columns_to_visit = get_columns_to_visit(columns_to_visit, is_required)

        for column in columns_to_visit:

            # Each model has a cluster_id column but it's not really needed for anything on output
            if column.name == 'cluster_id' and is_output:
                continue

            # We already have cluster_id and don't need a SIOElem'd one.
            if column.name == 'cluster_id' and has_cluster_id:
                continue

            if column.name in attrs.skip_input_params:
                continue

            # We never return passwords
            if column.name == 'password' and is_get_list:
                continue

            if column.name == 'id':
                if is_edit:
                    pass
                else:
                    continue # Create or GetList

            for k, v in sa_to_sio.items():
                if isinstance(column.type, k):
                    if column.name in attrs.request_as_is:
                        wrapper = AsIs
                    else:
                        wrapper = v
                    columns.append(wrapper(column.name))
                    break
            else:
                if column.name in attrs.request_as_is:
                    columns.append(AsIs(column.name))
                else:
                    columns.append(column.name)

    return columns
示例#5
0
class _UpdateSIO(AdminSIO):
    input_required = (AsIs('msg_id'), 'mime_type')
    input_optional = ('cluster_id', 'data', Int('expiration'),
                      AsIs('correl_id'), AsIs('in_reply_to'), Int('priority'),
                      Bool('exp_from_now'), 'server_name', 'server_pid',
                      Int('size'), AsIs('pub_correl_id'),
                      AsIs('expiration_time'))
    output_required = (Bool('found'), AsIs('msg_id'))
    output_optional = ('expiration_time', Int('size'))
示例#6
0
class CommonSubData:
    common = ('is_internal', 'topic_name', 'active_status', 'endpoint_type',
              'endpoint_id', 'endpoint_name', 'delivery_method',
              'delivery_data_format', 'delivery_batch_size',
              Bool('wrap_one_msg_in_list'), 'delivery_max_retry',
              Bool('delivery_err_should_block'), 'wait_sock_err',
              'wait_non_sock_err', 'server_id', 'out_http_method',
              'out_http_method', 'creation_time', 'last_interaction_time',
              Int('total_depth'), Int('current_depth_gd'),
              Int('current_depth_non_gd'), 'sub_key', 'has_gd',
              'is_staging_enabled', 'sub_id', 'name', AsIs('ws_ext_client_id'),
              AsIs('ext_client_id'), 'topic_id')
    amqp = ('out_amqp_id', 'amqp_exchange', 'amqp_routing_key')
    files = ('files_directory_list', )
    ftp = ('ftp_directory_list', )
    pubapi = ('security_id', )
    rest = ('out_rest_http_soap_id', 'rest_delivery_endpoint')
    service = ('service_id', )
    sms_twilio = ('sms_twilio_from', 'sms_twilio_to_list')
    smtp = (Bool('smtp_is_html'), 'smtp_subject', 'smtp_from', 'smtp_to_list',
            'smtp_body')
    soap = ('out_soap_http_soap_id', 'soap_delivery_endpoint')
    websockets = ('ws_channel_id', 'ws_channel_name', AsIs('ws_pub_client_id'),
                  'sql_ws_client_id', Opaque('web_socket'))
示例#7
0
 class SimpleIO(AdminSIO):
     request_elem = 'zato_pattern_delivery_in_doubt_get_list_request'
     response_elem = 'zato_pattern_delivery_in_doubt_get_list_response'
     input_required = ('def_name', 'state')
     input_optional = (
         'batch_size',
         'current_batch',
         'start',
         'stop',
     )
     output_required = ('def_name', 'target_type', AsIs('task_id'),
                        'creation_time_utc', 'last_used_utc',
                        'source_count', 'target_count', 'resubmit_count',
                        'retry_repeats', 'check_after', 'retry_seconds')
     output_repeated = True
示例#8
0
 class SimpleIO(AdminSIO):
     input_required = 'cluster_id', 'id', AsIs('pub_client_id')
     input_optional = 'request_data', Int('timeout')
     output_optional = 'response_data'
     response_elem = None
示例#9
0
文件: topic.py 项目: lulzzz/zato
 class SimpleIO(GetListAdminSIO):
     input_required = ('cluster_id', 'topic_id')
     output_required = (AsIs('msg_id'), 'pub_time', 'data_prefix_short', 'pattern_matched')
     output_optional = (AsIs('correl_id'), 'in_reply_to', 'size', 'service_id', 'security_id', 'ws_channel_id', 'service_name',
         'sec_name', 'ws_channel_name', 'endpoint_id', 'endpoint_name')
     output_repeated = True
示例#10
0
文件: topic.py 项目: lulzzz/zato
 class SimpleIO:
     input_required = ('cluster_id', 'topic_id')
     output_required = ('name', 'is_active', 'is_internal', 'pattern_matched')
     output_optional = ('service_id', 'security_id', 'ws_channel_id', 'last_seen', 'last_pub_time', AsIs('last_msg_id'),
         AsIs('last_correl_id'), 'last_in_reply_to', 'service_name', 'sec_name', 'ws_channel_name', AsIs('ext_client_id'))
     output_repeated = True
示例#11
0
 class SimpleIO:
     input_required = (AsIs('id'), AsIs('a_id'), AsIs('b_count'),
                       AsIs('c_size'), AsIs('d_timeout'), AsIs('is_e'),
                       AsIs('needs_f'), AsIs('should_g'))
     output_required = (AsIs('id'), AsIs('a_id'), AsIs('b_count'),
                        AsIs('c_size'), AsIs('d_timeout'), AsIs('is_e'),
                        AsIs('needs_f'), AsIs('should_g'))
示例#12
0
文件: user.py 项目: sharkwing/zato
 class SimpleIO(BaseSIO):
     input_required = ('ust', 'current_app', AsIs('user_id'))
示例#13
0
文件: user.py 项目: sharkwing/zato
 class SimpleIO(BaseSIO):
     input_required = ('ust', 'current_app', 'totp_key', 'totp_label')
     input_optional = AsIs('user_id'),
     output_optional = BaseSIO.output_optional + ('totp_key', )
示例#14
0
 class SimpleIO(AdminSIO):
     input_required = ('cluster_id', 'topic_id')
     input_optional = (Bool('paginate'), Int('cur_page'), 'query')
     output_required = (AsIs('_meta'), )
     output_optional = (AsIs('response'), )
     response_elem = None
示例#15
0
 class SimpleIO(AdminSIO):
     input_required = ('sql_ws_client_id', 'channel_name',
                       AsIs('pub_client_id'), Opaque('web_socket'))
     input_optional = (List('sub_key_list'), )
     output_optional = (ListOfDicts('queue_depth'), )
示例#16
0
 class SimpleIO(AdminSIO):
     input_required = ('cluster_id', AsIs('msg_id'))
示例#17
0
 class SimpleIO(AdminSIO):
     input_required = ('cluster_id', AsIs('msg_id'))
     output_required = (Bool('found'), )
示例#18
0
 class SimpleIO(AdminSIO):
     input_required = ('cluster_id', AsIs('msg_id'))
     output_optional = ('topic_id', 'topic_name', AsIs('msg_id'), AsIs('correl_id'), 'in_reply_to', 'pub_time', \
         'ext_pub_time', 'pattern_matched', 'priority', 'data_format', 'mime_type', 'size', 'data',
         'expiration', 'expiration_time', 'endpoint_id', 'endpoint_name', Bool('has_gd'),
         'pub_hook_service_id', 'pub_hook_service_name', AsIs('ext_client_id'))
示例#19
0
 class SimpleIO(AdminSIO):
     input_required = ('cluster_id', AsIs('msg_id'), 'mime_type')
     input_optional = ('data', Int('expiration'), AsIs('correl_id'),
                       AsIs('in_reply_to'), Int('priority'))
     output_required = (Bool('found'), )
     output_optional = ('expiration_time', Int('size'))
示例#20
0
 class SimpleIO(AdminSIO):
     input_required = (AsIs('pub_client_id'), )
示例#21
0
 class SimpleIO(AdminSIO):
     input_required = (AsIs('pub_client_id'), 'channel_name',
                       AsIs('request'))
     output_optional = (AsIs('r'), )
     response_elem = 'r'
示例#22
0
label = 'a pub/sub topic'
get_list_docs = 'pub/sub topics'
broker_message = BROKER_MSG_PUBSUB
broker_message_prefix = 'TOPIC_'
list_func = pubsub_topic_list
skip_input_params = [
    'is_internal', 'current_depth_gd', 'last_pub_time', 'last_pub_msg_id',
    'last_endpoint_id', 'last_endpoint_name'
]
input_optional_extra = ['needs_details', 'on_no_subs_pub']
output_optional_extra = [
    'is_internal',
    Int('current_depth_gd'),
    Int('current_depth_non_gd'), 'last_pub_time', 'hook_service_name',
    'last_pub_time',
    AsIs('last_pub_msg_id'), 'last_endpoint_id', 'last_endpoint_name',
    Bool('last_pub_has_gd'), 'last_pub_server_pid', 'last_pub_server_name',
    'on_no_subs_pub'
]

# ################################################################################################################################

sub_broker_attrs = ('active_status', 'active_status', 'cluster_id',
                    'creation_time', 'endpoint_id', 'has_gd', 'id',
                    'is_durable', 'is_internal', 'name', 'out_amqp_id',
                    'out_http_soap_id', 'sub_key', 'topic_id', 'ws_channel_id',
                    'ws_sub_id', 'delivery_group_size')

# ################################################################################################################################

示例#23
0
 class SimpleIO:
     input_required = ('cluster_id', AsIs('id'))
     output_required = ('id', 'name', 'is_active', 'is_internal', 'has_gd',
                        'max_depth_gd', 'max_depth_non_gd',
                        'current_depth_gd')
     output_optional = ('last_pub_time', 'on_no_subs_pub')
示例#24
0
 class SimpleIO:
     input_required = 'service',
     input_optional = AsIs('request'),
     output_optional = 'sub_key',
     skip_empty_keys = True
示例#25
0
 class SimpleIO(GetListAdminSIO):
     input_required = ('cluster_id', 'sub_id')
     output_required = (AsIs('msg_id'), 'recv_time', 'data_prefix_short')
     output_optional = (Int('delivery_count'), 'last_delivery_time',
                        'is_in_staging', 'queue_name', 'endpoint_id')
     output_repeated = True
示例#26
0
文件: pubapi.py 项目: XmingTec/zato
class TopicSIO(BaseSIO):
    input_optional = ('data', AsIs('msg_id'), 'has_gd', Int('priority'),
                      Int('expiration'),
                      'mime_type', AsIs('correl_id'), 'in_reply_to',
                      AsIs('ext_client_id'), 'ext_pub_time', 'sub_key')
    output_optional = (AsIs('msg_id'), )
示例#27
0
文件: user.py 项目: sharkwing/zato
 class SimpleIO(BaseSIO):
     input_required = ('ust', 'current_app', 'new_password')
     input_optional = (AsIs('user_id'), 'old_password',
                       Int('password_expiry'), Bool('must_change'))
示例#28
0
文件: topic.py 项目: lulzzz/zato
 class SimpleIO:
     input_required = ('cluster_id', AsIs('id'))
示例#29
0
 class SimpleIO(AdminSIO):
     input_required = ('cid', AsIs('topic_id'), 'topic_name', 'is_bg_call',
                       Opaque('pub_time_max'))
     input_optional = (Opaque('subscriptions'), Opaque('non_gd_msg_list'),
                       'has_gd_msg_list')
示例#30
0
 class SimpleIO:
     input_required = ('service', )
     input_optional = (AsIs('request'), )