Skip to content

create_premium_repository

create_premium_repository(
    repository_name: RepositoryName,
    marketplace_products: MarketplaceProductIdList,
    *,
    config_overrides: Optional[ECRPUBLICClientConfig] = None,
    catalog_data: Optional[RepositoryCatalogDataInput] = None,
    tags: Optional[TagList] = None,
) -> CreatePremiumRepositoryResponse

Creates a premium repository in a public registry for paid content that's sold through Amazon Web Services Marketplace. Your registry must be verified and have an approved custom registry alias; otherwise, the request fails with ValidationException. The repository starts in the DRAFT state, and you make it available with SetRepositoryState.

Parameters:

  • repository_name (RepositoryName) –

    The name to use for the premium repository. You can specify the name on its own (for example nginx-web-app) or prepend a namespace to group the repository into a category (for example project-a/nginx-web-app). You can give a premium repository the same name as a free repository in the same registry.

  • catalog_data (Optional[RepositoryCatalogDataInput], default: None ) –

    The details about the premium repository that are publicly visible in the Amazon ECR Public Gallery. A premium repository is listed in the Amazon ECR Public Gallery when it's AVAILABLE and at least one of its Amazon Web Services Marketplace products is public.

  • marketplace_products (MarketplaceProductIdList) –

    The list of Amazon Web Services Marketplace product IDs for the premium repository. You can specify from one to five product IDs. Your account must own each product, and each product must have an Amazon ECR Public Premium delivery option. You can't specify the same product ID more than once.

  • tags (Optional[TagList], default: None ) –

    The metadata that you apply to the premium repository to help categorize and organize your repositories. Each tag consists of a key and an optional value. You define both of them. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Raises:

  • InvalidParameterException –

    The specified parameter is invalid. Review the available parameters for the API request.

  • InvalidTagParameterException –

    An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

  • LimitExceededException –

    The operation didn't succeed because it would have exceeded a service limit for your account. For more information, see Amazon ECR Public service quotas in the Amazon Elastic Container Registry Public User Guide.

  • RepositoryAlreadyExistsException –

    The specified repository already exists in the specified registry. Choose a different repository name, or use the existing repository.

  • ServerException –

    These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact Amazon Web Services Support.

  • TooManyTagsException –

    The list of tags on the repository is over the limit. A repository can have up to 50 tags. Remove tags with UntagResource, or specify fewer tags, then try again.

  • UnsupportedCommandException –

    The action isn't supported in this Region. Check that the action is available in the Amazon Web Services Region that you're using, and try again in a supported Region.

  • ValidationException –

    There was an error validating the request. Check the request parameters and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To create a premium repository This example creates a premium repository called my-premium-repository and links it to one AWS Marketplace product. The new repository starts in the DRAFT state.

>>> client.create_premium_repository(repository_name='my-premium-repository', marketplace_products=['prod-ad8EXAMPLE651'], catalog_data={'description': 'Hardened base image with premium support', 'architectures': ['x86-64', 'ARM 64'], 'operatingSystems': ['Linux'], 'categories': ['BASE_IMAGES', 'SECURITY']})
Source code in docs_src/capo_ecr_public/_services/ecrpublic.py
def create_premium_repository(
    self,
    repository_name: "capo_ecr_public.types.repository_name.RepositoryName",
    marketplace_products: "capo_ecr_public.types.marketplace_product_id_list.MarketplaceProductIdList",
    *,
    config_overrides: Optional[ECRPUBLICClientConfig] = None,
    catalog_data: Optional[
        "capo_ecr_public.types.repository_catalog_data_input.RepositoryCatalogDataInput"
    ] = None,
    tags: Optional["capo_ecr_public.types.tag_list.TagList"] = None,
) -> "capo_ecr_public.types.create_premium_repository_response.CreatePremiumRepositoryResponse":
    """<p>Creates a premium repository in a public registry for paid content that's sold through Amazon Web Services Marketplace. Your registry must be verified and have an approved custom registry alias; otherwise, the request fails with <code>ValidationException</code>. The repository starts in the <code>DRAFT</code> state, and you make it available with <code>SetRepositoryState</code>.</p>

    Args:
        repository_name: <p>The name to use for the premium repository. You can specify the name on its own (for example <code>nginx-web-app</code>) or prepend a namespace to group the repository into a category (for example <code>project-a/nginx-web-app</code>). You can give a premium repository the same name as a free repository in the same registry.</p>
        catalog_data: <p>The details about the premium repository that are publicly visible in the Amazon ECR Public Gallery. A premium repository is listed in the Amazon ECR Public Gallery when it's <code>AVAILABLE</code> and at least one of its Amazon Web Services Marketplace products is public.</p>
        marketplace_products: <p>The list of Amazon Web Services Marketplace product IDs for the premium repository. You can specify from one to five product IDs. Your account must own each product, and each product must have an Amazon ECR Public Premium delivery option. You can't specify the same product ID more than once.</p>
        tags: <p>The metadata that you apply to the premium repository to help categorize and organize your repositories. Each tag consists of a key and an optional value. You define both of them. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</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.invalid_tag_parameter_exception.InvalidTagParameterException: <p>An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
        capo_ecr_public.errors.limit_exceeded_exception.LimitExceededException: <p>The operation didn't succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html">Amazon ECR Public service quotas</a> in the Amazon Elastic Container Registry Public User Guide.</p>
        capo_ecr_public.errors.repository_already_exists_exception.RepositoryAlreadyExistsException: <p>The specified repository already exists in the specified registry. Choose a different repository name, or use the existing repository.</p>
        capo_ecr_public.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact Amazon Web Services Support.</p>
        capo_ecr_public.errors.too_many_tags_exception.TooManyTagsException: <p>The list of tags on the repository is over the limit. A repository can have up to 50 tags. Remove tags with <code>UntagResource</code>, or specify fewer tags, then try again.</p>
        capo_ecr_public.errors.unsupported_command_exception.UnsupportedCommandException: <p>The action isn't supported in this Region. Check that the action is available in the Amazon Web Services Region that you're using, and try again in a supported Region.</p>
        capo_ecr_public.errors.validation_exception.ValidationException: <p>There was an error validating the request. Check the request parameters and try again.</p>
        capo_ecr_public.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To create a premium repository
        This example creates a premium repository called my-premium-repository and links it to one AWS Marketplace product. The new repository starts in the DRAFT state.

        >>> client.create_premium_repository(repository_name='my-premium-repository', marketplace_products=['prod-ad8EXAMPLE651'], catalog_data={'description': 'Hardened base image with premium support', 'architectures': ['x86-64', 'ARM 64'], 'operatingSystems': ['Linux'], 'categories': ['BASE_IMAGES', 'SECURITY']})
    """

    def _handler(
        req: "OperationRequest[capo_ecr_public.types.create_premium_repository_request.CreatePremiumRepositoryRequest]",
    ) -> OperationResponse[
        "capo_ecr_public.types.create_premium_repository_response.CreatePremiumRepositoryResponse"
    ]:
        import capo_ecr_public._operations.spencer_frontend_service.create_premium_repository

        output, http_response = (
            capo_ecr_public._operations.spencer_frontend_service.create_premium_repository.create_premium_repository(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePremiumRepository")
    )
    input_: capo_ecr_public.types.create_premium_repository_request.CreatePremiumRepositoryRequest = {
        "repository_name": repository_name,
        "marketplace_products": marketplace_products,
    }
    if catalog_data is not None:
        input_["catalog_data"] = catalog_data
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output