Exemplo n.º 1
0
    def get(self, source_uuid):
        visible_tenants = get_tenant_uuids(recurse=True)
        list_params = contact_list_param_schema.load(request.args)
        source_config = self._source_service.get('wazo', source_uuid, visible_tenants)

        lister = ContactLister(registry.get(source_config))
        response = lister.list(**list_params)

        return {
            'total': response['total'],
            'filtered': response['total'],
            'items': contact_list_schema.dump(response['items']),
        }
Exemplo n.º 2
0
    def load(self, dependencies):
        config = dependencies['config']
        self._searched_columns = config.get(self.SEARCHED_COLUMNS, [])
        self._first_matched_columns = config.get(self.FIRST_MATCHED_COLUMNS, [])
        self.name = config['name']
        self._client = registry.get(config)

        self._SourceResult = make_result_class(
            'conference',
            self.name,
            'id',
            format_columns=config.get(self.FORMAT_COLUMNS),
        )
        logger.info('Wazo %s successfully loaded', config['name'])
Exemplo n.º 3
0
    def get(self, source_uuid):
        tenant_uuid = Tenant.autodetect().uuid
        visible_tenants = self.get_visible_tenants(tenant_uuid)
        list_params = contact_list_param_schema.load(request.args).data
        source_config = self._source_service.get('wazo', source_uuid,
                                                 visible_tenants)

        lister = ContactLister(registry.get(source_config))
        response = lister.list(**list_params)

        return {
            'total': response['total'],
            'filtered': response['total'],
            'items': contact_list_schema.dump(response['items']).data,
        }
Exemplo n.º 4
0
    def get(self, source_uuid):
        tenant_uuid = Tenant.autodetect().uuid
        visible_tenants = self.get_visible_tenants(tenant_uuid)
        list_params = contact_list_param_schema.load(request.args).data
        source_config = self._source_service.get('conference', source_uuid,
                                                 visible_tenants)

        confd = registry.get(source_config)
        try:
            response = confd.conferences.list(**list_params)
        except Exception as e:
            raise exception.XiVOConfdError(confd, e)

        return {
            'total': response['total'],
            'filtered': response['total'],
            'items': contact_list_schema.dump(response['items']).data,
        }
Exemplo n.º 5
0
    def get(self, source_uuid):
        visible_tenants = get_tenant_uuids(recurse=True)
        list_params = contact_list_param_schema.load(request.args)
        source_config = self._source_service.get(
            'conference', source_uuid, visible_tenants
        )

        confd = registry.get(source_config)
        try:
            response = confd.conferences.list(**list_params)
        except Exception as e:
            raise exception.WazoConfdError(confd, e)

        return {
            'total': response['total'],
            'filtered': response['total'],
            'items': contact_list_schema.dump(response['items']),
        }