publish_package_version
¶
publish_package_version(
domain: DomainName,
repository: RepositoryName,
format: PackageFormat,
package: PackageName,
package_version: PackageVersion,
asset_content: Body[Iterator[bytes]] | Iterator[bytes] | bytes,
asset_name: AssetName,
asset_sha256: SHA256,
*,
config_overrides: Optional[codeartifactClientConfig] = 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[Iterator[bytes]] | Iterator[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/codeartifact.py
3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 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 | |