set_repository_state
async
¶
set_repository_state(
repository_name: RepositoryName,
repository_type: RepositoryType,
state: RepositoryState,
*,
config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
registry_id: Optional[RegistryId] = None,
) -> SetRepositoryStateResponse
Sets the state of a premium repository. Use the state to control whether the repository is shown 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.
Parameters:
-
registry_id(Optional[RegistryId], default:None) –The Amazon Web Services account ID that's associated with the public registry that contains the repository. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.
-
repository_name(RepositoryName) –The name of the repository to set the state for.
-
repository_type(RepositoryType) –The type of the repository. Currently, you can set the state only for a
PREMIUMrepository.FREEisn't supported, and the request fails withInvalidParameterException. -
state(RepositoryState) –The state to set on the repository. Valid values:
-
AVAILABLE: Entitled buyers can pull from the repository, and it's listed in the Amazon ECR Public Gallery when at least one of its Amazon Web Services Marketplace products is public. -
HIDDEN: The repository isn't listed in the Amazon ECR Public Gallery. Buyers with an active entitlement can still pull from it.
A repository can move from
DRAFTtoAVAILABLE, and betweenAVAILABLEandHIDDEN. It can't return toDRAFT. Other changes fail withInvalidParameterException. If you specify the current state, the request succeeds and nothing changes. -
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
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.
-
RepositoryNotFoundException–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.
-
ServerException–These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact Amazon Web Services Support.
-
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.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To make a premium repository available This example moves the premium repository my-premium-repository from the DRAFT state to the AVAILABLE state.
>>> await client.set_repository_state(repository_name='my-premium-repository', repository_type='PREMIUM', state='AVAILABLE')
Source code in docs_src/capo_ecr_public/_services/async_ecrpublic.py
2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 | |