Creates or updates the permissions policy for your registry.
A registry policy is used to specify permissions for another Amazon Web Services account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
Parameters:
-
policy_text
(RegistryPolicyText)
–
The JSON policy text to apply to your registry. The policy text follows the same format as IAM policy text. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
Raises:
Source code in docs_src/capo_ecr/_services/ecr.py
| def put_registry_policy(
self,
policy_text: "capo_ecr.types.registry_policy_text.RegistryPolicyText",
*,
config_overrides: Optional[ECRClientConfig] = None,
) -> "capo_ecr.types.put_registry_policy_response.PutRegistryPolicyResponse":
"""<p>Creates or updates the permissions policy for your registry.</p> <p>A registry policy is used to specify permissions for another Amazon Web Services account and is used when configuring cross-account replication. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html">Registry permissions</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
Args:
policy_text: <p>The JSON policy text to apply to your registry. The policy text follows the same format as IAM policy text. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html">Registry permissions</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
Raises:
capo_ecr.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
capo_ecr.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
capo_ecr.errors.validation_exception.ValidationException: <p>There was an exception validating this request.</p>
capo_ecr.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ecr.types.put_registry_policy_request.PutRegistryPolicyRequest]",
) -> OperationResponse[
"capo_ecr.types.put_registry_policy_response.PutRegistryPolicyResponse"
]:
import capo_ecr._operations.amazon_ec2_container_registry_v20150921.put_registry_policy
output, http_response = (
capo_ecr._operations.amazon_ec2_container_registry_v20150921.put_registry_policy.put_registry_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutRegistryPolicy")
)
input_: capo_ecr.types.put_registry_policy_request.PutRegistryPolicyRequest = {
"policy_text": policy_text
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|