class InfraDatabaseSchema(Schema): URL_SCHEMES = {u'mysql', u'sam+mysql', u'pgsql', u'sam+pgsql'} master = fields.String(validate=Url(schemes=URL_SCHEMES), required=True) slave = fields.String(validate=Url(schemes=URL_SCHEMES), required=True) max_pool_size = fields.Integer(validate=validate.Range(min=0), allow_none=True) max_pool_overflow = fields.Integer(validate=validate.Range(min=0), allow_none=True) jdbc_url_parameters = fields.String(attribute='jdbc.urlParameters', load_from='jdbc.urlParameters', allow_none=True)
class InfraKafkaSchema(Schema): URL_SCHEMES = {u'kafka', u'sam+kafka'} url = fields.String(validate=Url(schemes=URL_SCHEMES), required=True) group_id = fields.String(attribute='group.id', load_from='group.id', allow_none=True)
class InfraOssSchema(Schema): URL_SCHEMES = {u'http', u'sam+http'} url = fields.String(validate=Url(schemes=URL_SCHEMES), required=True) max_pool_size = fields.Integer(validate=validate.Range(min=0), allow_none=True) connect_timeout_ms = fields.Integer(validate=validate.Range(min=0), allow_none=True) idle_timeout_ms = fields.Integer(validate=validate.Range(min=0), allow_none=True) max_error_retry = fields.Integer(validate=validate.Range(min=0), allow_none=True)
class InfraAmqpSchema(Schema): URL_SCHEMES = {u'amqp', u'sam+amqp'} url = fields.String(validate=Url(schemes=URL_SCHEMES), required=True) connection_pool_size = fields.Integer(validate=validate.Range(min=0), allow_none=True) channel_pool_size = fields.Integer(validate=validate.Range(min=0), allow_none=True) write_timeout = fields.Integer(validate=validate.Range(min=0), allow_none=True) auto_recover = fields.Boolean(default=True, allow_none=True) heartbeat = fields.Integer(validate=validate.Range(min=0), allow_none=True)
class InfraRedisSchema(Schema): URL_SCHEMES = {u'redis', u'sam+redis'} url = fields.String(validate=Url(schemes=URL_SCHEMES), required=True) max_pool_size = fields.Integer(validate=validate.Range(min=0), allow_none=True) connect_timeout_ms = fields.Integer(validate=validate.Range(min=0), allow_none=True) test_on_borrow = fields.Boolean(attribute='jedis.testOnBorrow', load_from='jedis.testOnBorrow', default=False, allow_none=True) test_on_return = fields.Boolean(attribute='jedis.testOnReturn', load_from='jedis.testOnReturn', default=False, allow_none=True)
class InfraMongoSchema(Schema): URL_SCHEMES = {u'mongo', u'sam+mongo'} url = fields.String(validate=Url(schemes=URL_SCHEMES), required=True)
class InfraElasticSearchSchema(Schema): URL_SCHEMES = {u'http', u'sam+http', u'transport', u'sam+transport'} url = fields.String(validate=Url(schemes=URL_SCHEMES), required=True)