Amazon Elastic Container Registry Public
  1. Root
Amazon Elastic Container Registry Public
  • Root
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
    • /
      POST
  1. Root

/

POST
/
Applies a repository policy to the specified public repository to control access permissions. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/' \
--header 'X-Amz-Target;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "registryId": "string",
    "repositoryName": "string",
    "policyText": "string",
    "force": true
}'
Response Response Example
200 - Example 1
{
    "registryId": "string",
    "repositoryName": "string",
    "policyText": "string"
}

Request

Header Params
X-Amz-Target
string 
required
Body Params application/json
registryId
string 
optional
The Amazon Web Services account ID that's associated with the registry that contains the repository. If you do not specify a registry, the default public registry is assumed.
Match pattern:
[0-9]{12}
repositoryName
string 
required
The name of the repository to receive the policy.
>= 2 characters<= 205 characters
Match pattern:
(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*
policyText
string 
required
The JSON repository policy text to apply to the repository. For more information, see Amazon ECR Repository Policies in the Amazon Elastic Container Registry User Guide.
>= 0 characters<= 10240 characters
force
boolean 
optional
If the policy that you want to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This prevents accidental repository lockouts.
Examples

Responses

🟢200Success
application/json
Body
registryId
string 
optional
The registry ID that's associated with the request.
Match pattern:
[0-9]{12}
repositoryName
string 
optional
The repository name that's associated with the request.
>= 2 characters<= 205 characters
Match pattern:
(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*
policyText
string 
optional
The JSON repository policy text that's applied to the repository.
>= 0 characters<= 10240 characters
🟠480ServerException
🟠481InvalidParameterException
🟠482RepositoryNotFoundException
🟠483UnsupportedCommandException
Previous
/
Next
/
Built with