detach_policy
async
¶
detach_policy(
directory_arn: Arn,
policy_reference: ObjectReference,
object_reference: ObjectReference,
*,
config_overrides: Optional[AsyncCloudDirectoryClientConfig] = None,
) -> DetachPolicyResponse
Detaches a policy from an object.
Parameters:
-
directory_arn(Arn) – -
policy_reference(ObjectReference) –Reference that identifies the policy object.
-
object_reference(ObjectReference) –Reference that identifies the object whose policy object will be detached.
Raises:
-
AccessDeniedException–Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling ListDirectories and check your permissions.
-
DirectoryNotEnabledException–Operations are only permitted on enabled directories.
-
InternalServiceException–Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the AWS Service Health Dashboard site to see if there are any operational issues with the service.
-
InvalidArnException–Indicates that the provided ARN value is not valid.
-
LimitExceededException–Indicates that limits are exceeded. See Limits for more information.
-
NotPolicyException–Indicates that the requested operation can only operate on policy objects.
-
ResourceNotFoundException–The specified resource could not be found.
-
RetryableConflictException–Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.
-
ValidationException–Indicates that your request is malformed in some manner. See the exception message.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To detach a policy from an object
>>> await client.detach_policy(directory_arn='arn:aws:clouddirectory:us-west-2:45132example:directory/AYb8AOV81kHNgdj8mAO3dNY', policy_reference={'Selector': '$AQGG_ADlfNZBzYHY_JgDt3TWgcBsTVmcQEWs6jlygfhuew'}, object_reference={'Selector': '$AQGG_ADlfNZBzYHY_JgDt3TWQoovm1s3Ts2v0NKrzdVnPw'})
Source code in docs_src/capo_clouddirectory/_services/async_cloud_directory.py
1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 | |