set_repository_state
¶
set_repository_state(
repository_name: RepositoryName,
repository_type: RepositoryType,
state: RepositoryState,
*,
config_overrides: Optional[ECRPUBLICClientConfig] = 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.
>>> client.set_repository_state(repository_name='my-premium-repository', repository_type='PREMIUM', state='AVAILABLE')
Source code in docs_src/capo_ecr_public/_services/ecrpublic.py
2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 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 | |