update_curation_policy
¶
update_curation_policy(
curation_policy_id: CurationPolicyId,
revision_id: CurationPolicyRevision,
*,
config_overrides: Optional[ContextClientConfig] = None,
client_token: Optional[ClientToken] = None,
name: Optional[ResourceName] = None,
description: Optional[UserDefinedString] = None,
policy_document: Optional[PolicyText] = None,
auto_reject_after_seconds: Optional[AutoRejectAfterSeconds] = None,
) -> UpdateCurationPolicyResponse
Updates a curation policy's working copy.
Parameters:
-
client_token(Optional[ClientToken], default:None) –Makes a retry safe: the same token with the same parameters returns the current policy instead of a ConflictException. A token used with different parameters is a ValidationException whose message names
clientToken, checked first. A retry with the same parameters after the policy was deleted is a ConflictException. -
curation_policy_id(CurationPolicyId) –The ID of the curation policy to update.
-
revision_id(CurationPolicyRevision) –The
revisionIdof the working copy that you edited, as you last read it. If a concurrent edit advanced the revision, the request fails withConflictException. -
name(Optional[ResourceName], default:None) –The new name. If you omit it, the name is unchanged. This operation updates only the members that you include. You can't use it to clear an optional member.
-
description(Optional[UserDefinedString], default:None) –The new description. If you omit it, the description is unchanged.
-
policy_document(Optional[PolicyText], default:None) –The new Cedar policy document. If you omit it, the document is unchanged.
-
auto_reject_after_seconds(Optional[AutoRejectAfterSeconds], default:None) –The new auto-reject window, in seconds, from 86,400 (1 day) to 15,552,000 (180 days). If you omit it, the window is unchanged. You can't clear it with this operation.
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:
Update a curation policy The following example changes the working copy of a curation policy to also hold change sets that ontology grounding generates, and extends the auto-reject window to 14 days.
>>> client.update_curation_policy(curation_policy_id='pol-3e7a9c1b5d2f4a6e8b0c2d4f6a8b1c3e', revision_id='e3a5c7b9-1d4f-4b6a-8c2e-9f0b1d3a5c7e', policy_document='forbid (\n principal,\n action == AWS::Context::Action::"PublishChangeSet",\n resource is AWS::Context::ChangeSet\n)\nwhen { resource has generatedBy && (resource.generatedBy == AWS::Context::Activity::"TRACE_ANALYSIS" || resource.generatedBy == AWS::Context::Activity::"ONTOLOGY_GROUNDING") };', auto_reject_after_seconds=1209600)
Update a curation policy with a stale revision ID, which fails with ConflictException
The following example fails because another edit changed the policy's working copy after the caller last read it, so the revision ID no longer matches.
>>> client.update_curation_policy(curation_policy_id='pol-3e7a9c1b5d2f4a6e8b0c2d4f6a8b1c3e', revision_id='8f14e45f-ceea-4e7a-9b1d-2c3a4b5c6d7e', description='Holds trace analysis and ontology grounding changes for review.')
Source code in docs_src/capo_context/_services/context.py
4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 | |