update_curation_policy
async
¶
update_curation_policy(
curation_policy_id: CurationPolicyId,
revision_id: CurationPolicyRevision,
*,
config_overrides: Optional[AsyncContextClientConfig] = 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.
>>> await 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.
>>> await 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/async_context.py
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 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 | |