MCPcopy Create free account
hub / github.com/alephdata/aleph / update

Function update

aleph/views/entitysets_api.py:145–178  ·  view source on GitHub ↗

Update the entityset with ID `entityset_id`. --- post: summary: Update an entityset parameters: - description: The entityset ID. in: path name: entityset_id required: true schema: type: string example: 3a0d91ece2dce88ad32595

(entityset_id)

Source from the content-addressed store, hash-verified

143
144@blueprint.route("/api/2/entitysets/<entityset_id>", methods=["POST", "PUT"])
145def update(entityset_id):
146 """Update the entityset with ID `entityset_id`.
147 ---
148 post:
149 summary: Update an entityset
150 parameters:
151 - description: The entityset ID.
152 in: path
153 name: entityset_id
154 required: true
155 schema:
156 type: string
157 example: 3a0d91ece2dce88ad3259594c7b642485235a048
158 requestBody:
159 content:
160 application/json:
161 schema:
162 $ref: '#/components/schemas/EntitySetUpdate'
163 responses:
164 '200':
165 content:
166 application/json:
167 schema:
168 $ref: '#/components/schemas/EntitySet'
169 description: OK
170 tags:
171 - EntitySet
172 """
173 entityset = get_entityset(entityset_id, request.authz.WRITE)
174 data = parse_request("EntitySetUpdate")
175 entityset.update(data)
176 db.session.commit()
177 refresh_entityset(entityset_id)
178 return view(entityset_id)
179
180
181@blueprint.route("/api/2/entitysets/<entityset_id>", methods=["DELETE"])

Callers

nothing calls this directly

Calls 5

get_entitysetFunction · 0.90
parse_requestFunction · 0.90
refresh_entitysetFunction · 0.90
viewFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected