put_object
async
¶
put_object(
body: Body[AsyncIterator[bytes]] | AsyncIterator[bytes] | bytes,
path: PathNaming,
*,
config_overrides: Optional[AsyncMediaStoreDataClientConfig] = None,
content_type: Optional[ContentType] = None,
cache_control: Optional[StringPrimitive] = None,
storage_class: Optional[StorageClass] = None,
upload_availability: Optional[UploadAvailability] = None,
) -> PutObjectResponse
Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.
Parameters:
-
body(Body[AsyncIterator[bytes]] | AsyncIterator[bytes] | bytes) –The bytes to be stored.
-
path(PathNaming) –The path (including the file name) where the object is stored in the container. Format:
/ / For example, to upload the file
mlaw.avito the folder pathpremium\canadain the containermovies, enter the pathpremium/canada/mlaw.avi.Do not include the container name in this path.
If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing
premium/usasubfolder. If you specifypremium/canada, the service creates acanadasubfolder in thepremiumfolder. You then have two subfolders,usaandcanada, in thepremiumfolder.There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore.
For more information about folders and how they exist in a container, see the AWS Elemental MediaStore User Guide.
The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension.
-
content_type(Optional[ContentType], default:None) –The content type of the object.
-
cache_control(Optional[StringPrimitive], default:None) –An optional
CacheControlheader that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.Headers with a custom user-defined value are also accepted.
-
storage_class(Optional[StorageClass], default:None) –Indicates the storage class of a
Putrequest. Defaults to high-performance temporal storage class, and objects are persisted into durable storage shortly after being received. -
upload_availability(Optional[UploadAvailability], default:None) –Indicates the availability of an object while it is still uploading. If the value is set to
streaming, the object is available for downloading after some initial buffering but before the object is uploaded completely. If the value is set tostandard, the object is available for downloading only when it is uploaded completely. The default value for this header isstandard.To use this header, you must also set the HTTP
Transfer-Encodingheader tochunked.
Raises:
-
ContainerNotFoundException–The specified container was not found for the specified account.
-
InternalServerError–The service is temporarily unavailable.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_mediastore_data/_services/async_media_store_data.py
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 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | |