

# CreatePremiumRepository

Creates a premium repository in a public registry for paid content that's sold through AWS 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`.

## Request Syntax
<a name="API_CreatePremiumRepository_RequestSyntax"></a>

```
{
   "catalogData": { 
      "aboutText": "{{string}}",
      "architectures": [ "{{string}}" ],
      "categories": [ "{{string}}" ],
      "description": "{{string}}",
      "logoImageBlob": {{blob}},
      "operatingSystems": [ "{{string}}" ],
      "usageText": "{{string}}"
   },
   "marketplaceProducts": [ "{{string}}" ],
   "repositoryName": "{{string}}",
   "tags": [ 
      { 
         "Key": "{{string}}",
         "Value": "{{string}}"
      }
   ]
}
```

## Request Parameters
<a name="API_CreatePremiumRepository_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [catalogData](#API_CreatePremiumRepository_RequestSyntax) **   <a name="ecrpublic-CreatePremiumRepository-request-catalogData"></a>
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 AWS Marketplace products is public.  
Type: [RepositoryCatalogDataInput](API_RepositoryCatalogDataInput.md) object  
Required: No

 ** [marketplaceProducts](#API_CreatePremiumRepository_RequestSyntax) **   <a name="ecrpublic-CreatePremiumRepository-request-marketplaceProducts"></a>
The list of AWS 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.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 5 items.  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[A-Za-z0-9_-]+`   
Required: Yes

 ** [repositoryName](#API_CreatePremiumRepository_RequestSyntax) **   <a name="ecrpublic-CreatePremiumRepository-request-repositoryName"></a>
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.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 205.  
Pattern: `[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*`   
Required: Yes

 ** [tags](#API_CreatePremiumRepository_RequestSyntax) **   <a name="ecrpublic-CreatePremiumRepository-request-tags"></a>
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.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

## Response Syntax
<a name="API_CreatePremiumRepository_ResponseSyntax"></a>

```
{
   "catalogData": { 
      "aboutText": "string",
      "architectures": [ "string" ],
      "artifactTypes": [ "string" ],
      "badges": [ "string" ],
      "categories": [ "string" ],
      "description": "string",
      "logoUrl": "string",
      "marketplaceCertified": boolean,
      "operatingSystems": [ "string" ],
      "usageText": "string"
   },
   "premiumRepository": { 
      "associatedRepositories": [ 
         { 
            "repositoryName": "string",
            "repositoryType": "string"
         }
      ],
      "createdAt": number,
      "marketplaceProducts": [ "string" ],
      "registryId": "string",
      "repositoryArn": "string",
      "repositoryName": "string",
      "repositoryUri": "string",
      "state": "string"
   }
}
```

## Response Elements
<a name="API_CreatePremiumRepository_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [catalogData](#API_CreatePremiumRepository_ResponseSyntax) **   <a name="ecrpublic-CreatePremiumRepository-response-catalogData"></a>
The catalog data for the premium repository that was created.  
Type: [RepositoryCatalogData](API_RepositoryCatalogData.md) object

 ** [premiumRepository](#API_CreatePremiumRepository_ResponseSyntax) **   <a name="ecrpublic-CreatePremiumRepository-response-premiumRepository"></a>
The premium repository that was created.  
Type: [PremiumRepository](API_PremiumRepository.md) object

## Errors
<a name="API_CreatePremiumRepository_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
The specified parameter is invalid. Review the available parameters for the API request.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

 ** 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.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

 ** 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](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html) in the Amazon Elastic Container Registry Public User Guide.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

 ** RepositoryAlreadyExistsException **   
The specified repository already exists in the specified registry. Choose a different repository name, or use the existing repository.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

 ** ServerException **   
These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact AWS Support.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 500

 ** 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.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

 ** UnsupportedCommandException **   
The action isn't supported in this Region. Check that the action is available in the AWS Region that you're using, and try again in a supported Region.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

 ** ValidationException **   
There was an error validating the request. Check the request parameters and try again.    
 ** message **   
The error message associated with the exception.
HTTP Status Code: 400

## See Also
<a name="API_CreatePremiumRepository_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/ecr-public-2020-10-30/CreatePremiumRepository) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ecr-public-2020-10-30/CreatePremiumRepository) 