--- post: summary: Update a collection description: > Change collection metadata and update statistics. parameters: - description: The collection ID. in: path name: collection_id required: true schema: minimum: 1
(collection_id)
| 112 | |
| 113 | @blueprint.route("/<int:collection_id>", methods=["POST", "PUT"]) |
| 114 | def update(collection_id): |
| 115 | """ |
| 116 | --- |
| 117 | post: |
| 118 | summary: Update a collection |
| 119 | description: > |
| 120 | Change collection metadata and update statistics. |
| 121 | parameters: |
| 122 | - description: The collection ID. |
| 123 | in: path |
| 124 | name: collection_id |
| 125 | required: true |
| 126 | schema: |
| 127 | minimum: 1 |
| 128 | type: integer |
| 129 | requestBody: |
| 130 | content: |
| 131 | application/json: |
| 132 | schema: |
| 133 | $ref: '#/components/schemas/CollectionUpdate' |
| 134 | tags: |
| 135 | - Collection |
| 136 | responses: |
| 137 | '200': |
| 138 | description: OK |
| 139 | content: |
| 140 | application/json: |
| 141 | schema: |
| 142 | $ref: '#/components/schemas/Collection' |
| 143 | """ |
| 144 | collection = get_db_collection(collection_id, request.authz.WRITE) |
| 145 | data = parse_request("CollectionUpdate") |
| 146 | sync = get_flag("sync") |
| 147 | collection.update(data, request.authz) |
| 148 | db.session.commit() |
| 149 | data = update_collection(collection, sync=sync) |
| 150 | return CollectionSerializer.jsonify(data) |
| 151 | |
| 152 | |
| 153 | @blueprint.route("/<int:collection_id>/reingest", methods=["POST", "PUT"]) |
nothing calls this directly
no test coverage detected