class QueueStatisticsSchema(_StatisticsPeriodSchema): queue_id = fields.Integer(default=None) queue_name = fields.String(default=None) received = fields.Integer(attribute='total', default=0) answered = fields.Integer(default=0) abandoned = fields.Integer(default=0) closed = fields.Integer(default=0) not_answered = fields.Integer(attribute='timeout', default=0) saturated = fields.Integer(default=0) blocked = fields.Integer(attribute='blocking', default=0) average_waiting_time = fields.Integer(default=None) answered_rate = fields.Float(default=None) quality_of_service = fields.Float(attribute='qos', default=None)
class SourceSchema(BaseSourceSchema): lookup_url = fields.URL(required=True) list_url = fields.URL(allownone=True, missing=None) verify_certificate = VerifyCertificateField(missing=True) delimiter = fields.String(Length(min=1, max=1), missing=',') timeout = fields.Float(Range(min=0), missing=10.0) unique_column = fields.String(Length(min=1, max=128), allownone=True, missing=None)
class AuthConfigSchema(BaseSchema): host = fields.String(validate=Length(min=1, max=1024), missing='localhost') port = fields.Integer(validate=Range(min=1, max=65535), missing=9497) key_file = fields.String(validate=Length(min=1, max=1024), allow_none=True) username = fields.String(validate=Length(min=1, max=512), allow_none=True) password = fields.String(validate=Length(min=1, max=512), allow_none=True) verify_certificate = VerifyCertificateField(missing=True) timeout = fields.Float(validate=Range(min=0, max=3660)) version = fields.String(validate=Length(min=1, max=16), missing='0.1') @validates_schema def validate_auth_info(self, data): key_file = data.get('key_file') username = data.get('username') if key_file and username: raise exceptions.ValidationError( 'a "key_file" or a "username" and "password" must be specified', ) if key_file or username: return raise exceptions.ValidationError( 'a "key_file" or a "username" and "password" must be specified', )
class ConfdConfigSchema(BaseSchema): host = fields.String(validate=Length(min=1, max=1024), missing='localhost') port = fields.Integer(validate=Range(min=1, max=65535), missing=9486) verify_certificate = VerifyCertificateField(missing=True) timeout = fields.Float(validate=Range(min=0, max=3660)) https = fields.Boolean(missing=True) version = fields.String(validate=Length(min=1, max=16), missing='1.1')
class SourceSchema(BaseSourceSchema): ldap_uri = fields.String(validate=Length(min=1, max=256), required=True) ldap_base_dn = fields.String(validate=Length(min=1, max=1024), required=True) ldap_username = fields.String(validate=Length(min=1), missing=None) ldap_password = fields.String(validate=Length(min=1), missing=None) ldap_custom_filter = fields.String(validate=Length(min=1, max=1024), missing=None) ldap_network_timeout = fields.Float(validate=Range(min=0), default=0.3) ldap_timeout = fields.Float(validate=Range(min=0), default=1.0) unique_column = fields.String(validate=Length(min=1, max=128), allow_none=True, missing=None) unique_column_format = fields.String(validate=OneOf( ['string', 'binary_uuid']), missing='string')
class BaseAuthConfigSchema(BaseSchema): host = fields.String(validate=Length(min=1, max=1024), missing='localhost') port = fields.Integer(validate=Range(min=1, max=65535), missing=443) https = fields.Boolean(missing=True) verify_certificate = VerifyCertificateField(missing=True) prefix = fields.String(allow_none=True, missing='/api/auth') version = fields.String(validate=Length(min=1, max=16), missing='0.1') timeout = fields.Float(validate=Range(min=0, max=3660))