Skip to content

delete_repository_policy async

delete_repository_policy(
    repository_name: RepositoryName,
    *,
    config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
    registry_id: Optional[RegistryId] = None,
) -> DeleteRepositoryPolicyResponse

Deletes the repository policy that's associated with the specified repository.

Parameters:

  • registry_id (Optional[RegistryId], default: None ) –

    The Amazon Web Services account ID that's associated with the public registry that contains the repository policy to delete. If you do not specify a registry, the default public registry is assumed.

  • repository_name (RepositoryName) –

    The name of the repository that's associated with the repository policy to delete.

Raises:

Source code in docs_src/capo_ecr_public/_services/async_ecrpublic.py
async def delete_repository_policy(
    self,
    repository_name: "capo_ecr_public.types.repository_name.RepositoryName",
    *,
    config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
    registry_id: Optional["capo_ecr_public.types.registry_id.RegistryId"] = None,
) -> "capo_ecr_public.types.delete_repository_policy_response.DeleteRepositoryPolicyResponse":
    """<p>Deletes the repository policy that's associated with the specified repository.</p>

    Args:
        registry_id: <p>The Amazon Web Services account ID that's associated with the public registry that contains the repository policy to delete. If you do not specify a registry, the default public registry is assumed.</p>
        repository_name: <p>The name of the repository that's associated with the repository policy to delete.</p>

    Raises:
        capo_ecr_public.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr_public.errors.repository_not_found_exception.RepositoryNotFoundException: <p>The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.</p>
        capo_ecr_public.errors.repository_policy_not_found_exception.RepositoryPolicyNotFoundException: <p>The specified repository and registry combination doesn't have an associated repository policy.</p>
        capo_ecr_public.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr_public.errors.unsupported_command_exception.UnsupportedCommandException: <p>The action isn't supported in this Region.</p>
        capo_ecr_public.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecr_public.types.delete_repository_policy_request.DeleteRepositoryPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecr_public.types.delete_repository_policy_response.DeleteRepositoryPolicyResponse"
    ]:
        import capo_ecr_public._operations.spencer_frontend_service.delete_repository_policy

        (
            output,
            http_response,
        ) = await capo_ecr_public._operations.spencer_frontend_service.delete_repository_policy.async_delete_repository_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteRepositoryPolicy")
    )
    input_: capo_ecr_public.types.delete_repository_policy_request.DeleteRepositoryPolicyRequest = {
        "repository_name": repository_name
    }
    if registry_id is not None:
        input_["registry_id"] = registry_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output