def delete(collection_id): """ --- delete: summary: Delete a collection description: Delete the collection with id `collection_id` parameters: - description: The collection ID. in: path name: collection_id required: true schema: minimum: 1 type: integer - in: query description: Wait for delete to finish in backend. name: sync schema: type: boolean - in: query description: Delete only the contents, but not the collection itself. name: keep_metadata schema: type: boolean responses: '204': description: No Content tags: - Collection """ collection = get_db_collection(collection_id, request.authz.WRITE) keep_metadata = get_flag("keep_metadata", default=False) sync = get_flag("sync", default=True) delete_collection(collection, keep_metadata=keep_metadata, sync=sync) return ("", 204)
def test_delete_collection(self): collection = Collection.by_id(1000) res = self.client.get('/api/2/search?q="mention fruit"') assert res.json['total'] == 1, res.json delete_collection(collection) res = self.client.get('/api/2/search?q="mention fruit"') assert res.json['total'] == 0, res.json
def test_delete_collection(self): collection = Collection.by_id(1000) url = '/api/2/entities?filter:schemata=Thing&q="mention fruit"' res = self.client.get(url) assert res.json['total'] == 1, res.json delete_collection(collection) res = self.client.get(url) assert res.json['total'] == 0, res.json
def test_delete_collection(self): self.load_fixtures() url = "/api/2/entities?filter:schemata=Thing&q=kwazulu" res = self.client.get(url) assert res.json["total"] == 1, res.json delete_collection(self.public_coll) res = self.client.get(url) assert res.json["total"] == 0, res.json
def test_delete_when_collection_deleted(self): data = { 'label': 'hello', 'collection_id': str(self.col.id), } url = '/api/2/diagrams' res = self.client.post(url, json=data, headers=self.headers) assert res.status_code == 200, res diagram_id = res.json['id'] delete_collection(self.col) url = '/api/2/diagrams/%s' % diagram_id res = self.client.get(url, headers=self.headers) assert res.status_code == 404, res
def test_delete_when_collection_deleted(self): data = { "label": "hello", "type": "list", "collection_id": str(self.col.id), } url = "/api/2/entitysets" res = self.client.post(url, json=data, headers=self.headers) assert res.status_code == 200, res entityset_id = res.json["id"] delete_collection(self.col) url = "/api/2/entitysets/%s" % entityset_id res = self.client.get(url, headers=self.headers) assert res.status_code == 404, res
def delete(collection_id): """ --- delete: summary: Delete a collection description: Delete the collection with id `collection_id` parameters: - description: The collection ID. in: path name: collection_id required: true schema: minimum: 1 type: integer responses: '204': description: No Content tags: - Collection """ collection = get_db_collection(collection_id, request.authz.WRITE) sync = get_flag('sync', default=True) delete_collection(collection, sync=sync) return ('', 204)
def flush(foreign_id): """Reset the crawler state for a given collecton.""" collection = get_collection(foreign_id) delete_collection(collection)
def delete(id): collection = get_db_collection(id, request.authz.WRITE) delete_collection(collection, sync=True) return ('', 204)
def flush(foreign_id, sync=False): """Flush all the contents for a given collection.""" collection = get_collection(foreign_id) delete_collection(collection, keep_metadata=True, sync=sync)
def delete(foreign_id, sync=False): """Delete a given collection.""" collection = get_collection(foreign_id) delete_collection(collection, sync=sync)
def flush(foreign_id): """Reset the crawler state for a given collecton.""" collection = Collection.by_foreign_id(foreign_id, deleted=True) if collection is None: raise ValueError("No such collection: %r" % foreign_id) delete_collection(collection.id)
def delete(id): collection = get_db_collection(id, request.authz.WRITE) delete_collection(collection) refresh_index(collections_index()) return ('', 204)
def delete(id): collection = get_db_collection(id, request.authz.WRITE) delete_collection(collection) return jsonify({'status': 'accepted'}, status=202)
def delete(foreign_id): """Delete all the contents for a given collecton.""" collection = get_collection(foreign_id) delete_collection(collection)
def delete(collection_id): collection = get_db_collection(collection_id, request.authz.WRITE) sync = get_flag('sync', default=True) delete_collection(collection, sync=sync) return ('', 204)
def delete(foreign_id, keep_metadata=False): """Delete all the contents for a given collecton.""" collection = get_collection(foreign_id) delete_collection(collection, keep_metadata=keep_metadata)
def delete(id): collection = get_db_collection(id, request.authz.WRITE) sync = get_flag('sync', default=True) delete_collection(collection, sync=sync) return ('', 204)