update_change_set
¶
update_change_set(
change_set_id: ChangeSetId,
agent_context_id: AgentContextIdentifier,
change_set_version: ChangeSetVersionInteger,
operations_to_remove: ChangeSetOperationList,
*,
config_overrides: Optional[ContextClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> UpdateChangeSetResponse
Drops operations from a change set that is held for curator review. Returns the updated change set.
Parameters:
-
change_set_id(ChangeSetId) –The change set to edit: the
changeSetIdthat GetCurationProposal returns. -
agent_context_id(AgentContextIdentifier) –The agent context that the change set belongs to, by its ID or ARN. AWS Context authorizes the request on this agent context's ARN. If the change set belongs to another agent context, the request fails with
ResourceNotFoundException. -
change_set_version(ChangeSetVersionInteger) –The change set version that you read with GetChangeSet. The edit applies only if it's still the latest version. Otherwise, the request fails with
ConflictException. -
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier that you provide to make the request idempotent. For 8 hours, a retry of the same request with the same token returns the change set's latest version without writing again, and the same token used for another change set or a different request returns a
ValidationException. -
operations_to_remove(ChangeSetOperationList) –Operations to remove, copied unchanged from
ListChangeSetOperations. A retry must resend the same list with the same clientToken.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.
-
InternalServerException–The request failed because of an internal error. Retry the request.
-
ThrottlingException–The request was denied because it exceeded a request rate quota. Wait, then retry the request.
-
ValidationException–The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.
-
ConflictException–The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.
-
ResourceNotFoundException–The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Drop a link from a change set The following example drops one column link from a grounding change set that is held for review, copying the operation unchanged from ListChangeSetOperations, and returns the change set's new version.
>>> client.update_change_set(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', change_set_id='cs-6d8f0b2c4e1a4c7d9f3b5e7a9c1d3f5b', change_set_version=1, client_token='2c4e6a8b-0d1f-4c3e-a5b7-9d1f3b5d7f0a', operations_to_remove=[{'put': {'entity': {'edgeId': {'from': 'glueColumn:glueTable%3Aarn%253Aaws%253Aglue%253Aus-east-1%253A111122223333%253Atable%252Fsales_db%252Forders:region_code', 'to': 'iri:https://example.com/ontology/sales%23salesRegion'}}, 'properties': {'edgeType': {'stringValue': 'MAPPED_TO'}}}}])
Update a change set with a stale version, which fails with ConflictException
The following example fails with a ConflictException because the change set was edited after the caller read version 1 with GetChangeSet.
>>> client.update_change_set(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', change_set_id='cs-6d8f0b2c4e1a4c7d9f3b5e7a9c1d3f5b', change_set_version=1, operations_to_remove=[{'put': {'entity': {'edgeId': {'from': 'glueColumn:glueTable%3Aarn%253Aaws%253Aglue%253Aus-east-1%253A111122223333%253Atable%252Fsales_db%252Forders:order_total', 'to': 'iri:https://example.com/ontology/sales%23orderTotal'}}, 'properties': {'edgeType': {'stringValue': 'MAPPED_TO'}}}}])
Source code in docs_src/capo_context/_services/context.py
4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 | |