publish_package_version
async
¶
publish_package_version(
domain: DomainName,
repository: RepositoryName,
format: PackageFormat,
package: PackageName,
package_version: PackageVersion,
asset_content: Body[AsyncIterator[bytes]] | AsyncIterator[bytes] | bytes,
asset_name: AssetName,
asset_sha256: SHA256,
*,
config_overrides: Optional[AsynccodeartifactClientConfig] = None,
domain_owner: Optional[AccountId] = None,
namespace: Optional[PackageNamespace] = None,
unfinished: Optional[BooleanOptional] = None,
) -> PublishPackageVersionResult
Creates a new package version containing one or more assets (or files).
The unfinished flag can be used to keep the package version in the Unfinished state until all of its assets have been uploaded (see Package version status in the CodeArtifact user guide). To set the package version’s status to Published, omit the unfinished flag when uploading the final asset, or set the status using UpdatePackageVersionStatus. Once a package version’s status is set to Published, it cannot change back to Unfinished.
Only generic packages can be published using this API. For more information, see Using generic packages in the CodeArtifact User Guide.
Parameters:
-
domain(DomainName) –The name of the domain that contains the repository that contains the package version to publish.
-
domain_owner(Optional[AccountId], default:None) –The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
-
repository(RepositoryName) –The name of the repository that the package version will be published to.
-
format(PackageFormat) –A format that specifies the type of the package version with the requested asset file.
The only supported value is
generic. -
namespace(Optional[PackageNamespace], default:None) –The namespace of the package version to publish.
-
package(PackageName) –The name of the package version to publish.
-
package_version(PackageVersion) –The package version to publish (for example,
3.5.2). -
asset_content(Body[AsyncIterator[bytes]] | AsyncIterator[bytes] | bytes) –The content of the asset to publish.
-
asset_name(AssetName) –The name of the asset to publish. Asset names can include Unicode letters and numbers, and the following special characters:
~ ! @ ^ & ( ) - ` _ + [ ] { } ; , . ` -
asset_sha256(SHA256) –The SHA256 hash of the
assetContentto publish. This value must be calculated by the caller and provided with the request (see Publishing a generic package in the CodeArtifact User Guide).This value is used as an integrity check to verify that the
assetContenthas not changed after it was originally sent. -
unfinished(Optional[BooleanOptional], default:None) –Specifies whether the package version should remain in the
unfinishedstate. If omitted, the package version status will be set toPublished(see Package version status in the CodeArtifact User Guide).Valid values:
unfinished
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
3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 | |