CodeArtifact.Client.copy_package_versions(**kwargs)¶Copies package versions from one repository to another repository in the same domain.
Note
You must specify versions or versionRevisions . You cannot specify both.
See also: AWS API Documentation
Request Syntax
response = client.copy_package_versions(
domain='string',
domainOwner='string',
sourceRepository='string',
destinationRepository='string',
format='npm'|'pypi'|'maven'|'nuget'|'generic',
namespace='string',
package='string',
versions=[
'string',
],
versionRevisions={
'string': 'string'
},
allowOverwrite=True|False,
includeFromUpstream=True|False
)
[REQUIRED]
The name of the domain that contains the source and destination repositories.
[REQUIRED]
The name of the repository that contains the package versions to be copied.
[REQUIRED]
The name of the repository into which package versions are copied.
[REQUIRED]
The format of the package versions to be copied.
The namespace of the package versions to be copied. The package version component that specifies its namespace depends on its type. For example:
groupId . The namespace is required when copying Maven package versions.scope .namespace .[REQUIRED]
The name of the package that contains the versions to be copied.
The versions of the package to be copied.
Note
You must specify versions or versionRevisions . You cannot specify both.
A list of key-value pairs. The keys are package versions and the values are package version revisions. A CopyPackageVersion operation succeeds if the specified versions in the source repository match the specified package version revision.
Note
You must specify versions or versionRevisions . You cannot specify both.
failedVersions field of the response with an ALREADY_EXISTS error code.dict
Response Syntax
{
'successfulVersions': {
'string': {
'revision': 'string',
'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
}
},
'failedVersions': {
'string': {
'errorCode': 'ALREADY_EXISTS'|'MISMATCHED_REVISION'|'MISMATCHED_STATUS'|'NOT_ALLOWED'|'NOT_FOUND'|'SKIPPED',
'errorMessage': 'string'
}
}
}
Response Structure
(dict) --
successfulVersions (dict) --
A list of the package versions that were successfully copied to your repository.
(string) --
(dict) --
Contains the revision and status of a package version.
revision (string) --
The revision of a package version.
status (string) --
The status of a package version.
failedVersions (dict) --
A map of package versions that failed to copy and their error codes. The possible error codes are in the PackageVersionError data type. They are:
ALREADY_EXISTSMISMATCHED_REVISIONMISMATCHED_STATUSNOT_ALLOWEDNOT_FOUNDSKIPPED(string) --
(dict) --
l An error associated with package.
errorCode (string) --
The error code associated with the error. Valid error codes are:
ALREADY_EXISTSMISMATCHED_REVISIONMISMATCHED_STATUSNOT_ALLOWEDNOT_FOUNDSKIPPEDerrorMessage (string) --
The error message associated with the error.
Exceptions
CodeArtifact.Client.exceptions.AccessDeniedExceptionCodeArtifact.Client.exceptions.ConflictExceptionCodeArtifact.Client.exceptions.InternalServerExceptionCodeArtifact.Client.exceptions.ResourceNotFoundExceptionCodeArtifact.Client.exceptions.ServiceQuotaExceededExceptionCodeArtifact.Client.exceptions.ThrottlingExceptionCodeArtifact.Client.exceptions.ValidationException