initiate_multipart_upload
async
¶
initiate_multipart_upload(
account_id: string,
vault_name: string,
*,
config_overrides: Optional[AsyncGlacierClientConfig] = None,
archive_description: Optional[string] = None,
part_size: Optional[string] = None,
) -> InitiateMultipartUploadOutput
This operation initiates a multipart upload. Amazon Glacier creates a multipart upload resource and returns its ID in the response. The multipart upload ID is used in subsequent requests to upload parts of an archive (see UploadMultipartPart).
When you initiate a multipart upload, you specify the part size in number of bytes. The part size must be a megabyte (1024 KB) multiplied by a power of 2-for example, 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8 MB), and so on. The minimum allowable part size is 1 MB, and the maximum is 4 GB.
Every part you upload to this resource (see UploadMultipartPart), except the last one, must have the same size. The last one can be the same size or smaller. For example, suppose you want to upload a 16.2 MB file. If you initiate the multipart upload with a part size of 4 MB, you will upload four parts of 4 MB each and one part of 0.2 MB.
You don't need to know the size of the archive when you start a multipart upload because Amazon Glacier does not require you to specify the overall archive size.
After you complete the multipart upload, Amazon Glacier (Glacier) removes the multipart upload resource referenced by the ID. Glacier also removes the multipart upload resource if you cancel the multipart upload or it may be removed if there is no activity for a period of 24 hours.
An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).
For conceptual information and underlying REST API, see Uploading Large Archives in Parts (Multipart Upload) and Initiate Multipart Upload in the Amazon Glacier Developer Guide.
Parameters:
-
account_id(string) –The
AccountIdvalue is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID. -
vault_name(string) –The name of the vault.
-
archive_description(Optional[string], default:None) –The archive description that you are uploading in parts.
The part size must be a megabyte (1024 KB) multiplied by a power of 2, for example 1048576 (1 MB), 2097152 (2 MB), 4194304 (4 MB), 8388608 (8 MB), and so on. The minimum allowable part size is 1 MB, and the maximum is 4 GB (4096 MB).
-
part_size(Optional[string], default:None) –The size of each part except the last, in bytes. The last part can be smaller than this part size.
Raises:
-
InvalidParameterValueException–Returned if a parameter of the request is incorrectly specified.
-
MissingParameterValueException–Returned if a required header or parameter is missing from the request.
-
NoLongerSupportedException–Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.
-
ResourceNotFoundException–Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.
-
ServiceUnavailableException–Returned if the service cannot complete the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To initiate a multipart upload The example initiates a multipart upload to a vault named my-vault with a part size of 1 MiB (1024 x 1024 bytes) per file.
>>> await client.initiate_multipart_upload(account_id='-', part_size='1048576', vault_name='my-vault')
Source code in docs_src/capo_glacier/_services/async_glacier.py
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 | |