AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
This operation applies only to Amazon Rekognition Custom Labels.
Copies a version of an Amazon Rekognition Custom Labels model from a source project to a destination project. The source and destination projects can be in different AWS accounts but must be in the same AWS Region. You can't copy a model to another AWS service.
To copy a model version to a different AWS account, you need to create a resource-based policy known as a project policy. You attach the project policy to the source project by calling PutProjectPolicy. The project policy gives permission to copy the model version from a trusting AWS account to a trusted account.
For more information creating and attaching a project policy, see Attaching a project policy (SDK) in the Amazon Rekognition Custom Labels Developer Guide.
If you are copying a model version to a project in the same AWS account, you don't need to create a project policy.
Copying project versions is supported only for Custom Labels models.
To copy a model, the destination project, source project, and source model version must already exist.
Copying a model version takes a while to complete. To get the current status, call
DescribeProjectVersions and check the value of Status
in the ProjectVersionDescription
object. The copy operation has finished when the value of Status
is COPYING_COMPLETED
.
This operation requires permissions to perform the rekognition:CopyProjectVersion
action.
For .NET Core this operation is only available in asynchronous form. Please refer to CopyProjectVersionAsync.
Namespace: Amazon.Rekognition
Assembly: AWSSDK.Rekognition.dll
Version: 3.x.y.z
public virtual CopyProjectVersionResponse CopyProjectVersion( CopyProjectVersionRequest request )
Container for the necessary parameters to execute the CopyProjectVersion service method.
Exception | Condition |
---|---|
AccessDeniedException | You are not authorized to perform the action. |
InternalServerErrorException | Amazon Rekognition experienced a service issue. Try your call again. |
InvalidParameterException | Input parameter violated a constraint. Validate your parameter before calling the API operation again. |
LimitExceededException | An Amazon Rekognition service limit was exceeded. For example, if you start too many jobs concurrently, subsequent calls to start operations (ex: StartLabelDetection) will raise a LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is below the Amazon Rekognition service limit. |
ProvisionedThroughputExceededException | The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition. |
ResourceInUseException | The specified resource is already being used. |
ResourceNotFoundException | The resource specified in the request cannot be found. |
ServiceQuotaExceededException | The size of the collection exceeds the allowed limit. For more information, see Guidelines and quotas in Amazon Rekognition in the Amazon Rekognition Developer Guide. |
ThrottlingException | Amazon Rekognition is temporarily unable to process the request. Try your call again. |
Copies a version of an Amazon Rekognition Custom Labels model from a source project to a destination project.
var client = new AmazonRekognitionClient(); var response = client.CopyProjectVersion(new CopyProjectVersionRequest { DestinationProjectArn = "arn:aws:rekognition:us-east-1:555555555555:project/DestinationProject/1656705098765", KmsKeyId = "arn:1234abcd-12ab-34cd-56ef-1234567890ab", OutputConfig = new OutputConfig { S3Bucket = "bucket-name", S3KeyPrefix = "path_to_folder" }, SourceProjectArn = "arn:aws:rekognition:us-east-1:111122223333:project/SourceProject/16565123456", SourceProjectVersionArn = "arn:aws:rekognition:us-east-1:111122223333:project/SourceProject/version/model_1/1656611123456", Tags = new Dictionary<string, string> { { "key1", "val1" } }, VersionName = "DestinationVersionName_cross_account" }); string projectVersionArn = response.ProjectVersionArn;
.NET Framework:
Supported in: 4.5 and newer, 3.5