copy_package_versions
async
¶
copy_package_versions(
domain: DomainName,
source_repository: RepositoryName,
destination_repository: RepositoryName,
format: PackageFormat,
package: PackageName,
*,
config_overrides: Optional[AsynccodeartifactClientConfig] = None,
domain_owner: Optional[AccountId] = None,
namespace: Optional[PackageNamespace] = None,
versions: Optional[PackageVersionList] = None,
version_revisions: Optional[PackageVersionRevisionMap] = None,
allow_overwrite: Optional[BooleanOptional] = None,
include_from_upstream: Optional[BooleanOptional] = None,
) -> CopyPackageVersionsResult
Copies package versions from one repository to another repository in the same domain.
You must specify versions or versionRevisions. You cannot specify both.
Parameters:
-
domain(DomainName) –The name of the domain that contains the source and destination repositories.
-
domain_owner(Optional[AccountId], default:None) –The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
-
source_repository(RepositoryName) –The name of the repository that contains the package versions to be copied.
-
destination_repository(RepositoryName) –The name of the repository into which package versions are copied.
-
format(PackageFormat) –The format of the package versions to be copied.
-
namespace(Optional[PackageNamespace], default:None) –The namespace of the package versions to be copied. The package component that specifies its namespace depends on its type. For example:
The namespace is required when copying package versions of the following formats:
-
Maven
-
Swift
-
generic
-
The namespace of a Maven package version is its
groupId. -
The namespace of an npm or Swift package version is its
scope. -
The namespace of a generic package is its
namespace. -
Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.
-
-
package(PackageName) –The name of the package that contains the versions to be copied.
-
versions(Optional[PackageVersionList], default:None) –The versions of the package to be copied.
You must specify
versionsorversionRevisions. You cannot specify both. -
version_revisions(Optional[PackageVersionRevisionMap], default:None) –A list of key-value pairs. The keys are package versions and the values are package version revisions. A
CopyPackageVersionoperation succeeds if the specified versions in the source repository match the specified package version revision.You must specify
versionsorversionRevisions. You cannot specify both. -
allow_overwrite(Optional[BooleanOptional], default:None) –Set to true to overwrite a package version that already exists in the destination repository. If set to false and the package version already exists in the destination repository, the package version is returned in the
failedVersionsfield of the response with anALREADY_EXISTSerror code. -
include_from_upstream(Optional[BooleanOptional], default:None) –Set to true to copy packages from repositories that are upstream from the source repository to the destination repository. The default setting is false. For more information, see Working with upstream repositories.
Raises:
-
AccessDeniedException–The operation did not succeed because of an unauthorized access attempt.
-
ConflictException–The operation did not succeed because prerequisites are not met.
-
InternalServerException–The operation did not succeed because of an error that occurred inside CodeArtifact.
-
ResourceNotFoundException–The operation did not succeed because the resource requested is not found in the service.
-
ServiceQuotaExceededException–The operation did not succeed because it would have exceeded a service limit for your account.
-
ThrottlingException–The operation did not succeed because too many requests are sent to the service.
-
ValidationException–The operation did not succeed because a parameter in the request was sent with an invalid value.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codeartifact/_services/async_codeartifact.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | |