ExAws.S3.Client behaviour
The purpose of this module is to surface the ExAws.S3 API tied to a single configuration chosen, such that it does not need passed in with every request.
Usage:
defmodule MyApp.S3 do
use ExAws.S3.Client, otp_app: :my_otp_app
end
In your config
config :my_otp_app, ExAws,
s3: [], # S3 config goes here
You can now use MyApp.S3 as the root module for the S3 api without needing to pass in a particular configuration. This enables different otp apps to configure their AWS configuration separately.
The alignment with a particular OTP app while convenient is however entirely optional. The following also works:
defmodule MyApp.S3 do
use ExAws.S3.Client
def config_root do
Application.get_all_env(:my_aws_config_root)
end
end
ExAws now expects the config for that S3 client to live under
config :my_aws_config_root
s3: [] # S3 config goes here
This is in fact how the functions in ExAws.S3 that do not require a config work. Default config values can be found in ExAws.Config. The default configuration is always used, and then the configuration of a particular client is merged in and overrides the defaults.
Callbacks
Specs:
- abort_multipart_upload(bucket :: binary, object :: binary, upload_id :: binary) :: ExAws.Request.response_t
Abort a multipart upload
Specs:
- complete_multipart_upload(bucket :: binary, object :: binary, upload_id :: binary, parts :: %{}) :: ExAws.Request.response_t
Complete a multipart upload
Specs:
- config_root :: Keyword.t
Retrieves the root AWS config for this client
Specs:
- delete_bucket(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket
Specs:
- delete_bucket_cors(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket cors
Specs:
- delete_bucket_lifecycle(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket lifecycle
Specs:
- delete_bucket_policy(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket policy
Specs:
- delete_bucket_replication(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket replication
Specs:
- delete_bucket_tagging(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket tagging
Specs:
- delete_bucket_website(bucket :: binary) :: ExAws.Request.response_t
Delete a bucket website
Specs:
- delete_multiple_objects(bucket :: binary, objects :: [binary | {binary, binary}, ...]) :: ExAws.Request.response_t
Delete multiple objects within a bucket
Specs:
- delete_object(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Delete object object in bucket
Specs:
- get_bucket_acl(bucket :: binary) :: ExAws.Request.response_t
Get bucket acl
Specs:
- get_bucket_cors(bucket :: binary) :: ExAws.Request.response_t
Get bucket cors
Specs:
- get_bucket_lifecycle(bucket :: binary) :: ExAws.Request.response_t
Get bucket lifecycle
Specs:
- get_bucket_location(bucket :: binary) :: ExAws.Request.response_t
Get bucket location
Specs:
- get_bucket_logging(bucket :: binary) :: ExAws.Request.response_t
Get bucket logging
Specs:
- get_bucket_notification(bucket :: binary) :: ExAws.Request.response_t
Get bucket notification
Specs:
- get_bucket_object_versions(bucket :: binary) :: ExAws.Request.response_t
Get bucket object versions
Specs:
- get_bucket_object_versions(bucket :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- get_bucket_policy(bucket :: binary) :: ExAws.Request.response_t
Get bucket policy
Specs:
- get_bucket_replication(bucket :: binary) :: ExAws.Request.response_t
Get bucket replication
Specs:
- get_bucket_request_payment(bucket :: binary) :: ExAws.Request.response_t
Get bucket payment configuration
Specs:
- get_bucket_tagging(bucket :: binary) :: ExAws.Request.response_t
Get bucket tagging
Specs:
- get_bucket_versioning(bucket :: binary) :: ExAws.Request.response_t
Get bucket versioning
Specs:
- get_bucket_website(bucket :: binary) :: ExAws.Request.response_t
Get bucket website
Specs:
- get_object(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Get an object from a bucket
Specs:
- get_object(bucket :: binary, object :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- get_object_acl(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Get an object’s access control policy
Specs:
- get_object_acl(bucket :: binary, object :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- get_object_torrent(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Get a torrent for a bucket
Specs:
- head_bucket(bucket :: binary) :: ExAws.Request.response_t
Determine if a bucket exists
Specs:
- head_object(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Determine of an object exists
Specs:
- head_object(bucket :: binary, object :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- initiate_multipart_upload(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Initiate a multipart upload
Specs:
- initiate_multipart_upload(bucket :: binary, object :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- list_buckets :: ExAws.Request.response_t
List buckets
Specs:
- list_buckets(opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- list_multipart_uploads(bucket :: binary) :: ExAws.Request.response_t
List multipart uploads for a bucket
Specs:
- list_multipart_uploads(bucket :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- list_objects(bucket :: binary) :: ExAws.Request.response_t
List objects in bucket
Specs:
- list_parts(bucket :: binary, object :: binary, upload_id :: binary) :: ExAws.Request.response_t
List the parts of a multipart upload
Specs:
- list_parts(bucket :: binary, object :: binary, upload_id :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- options_object(bucket :: binary, object :: binary, origin :: binary, request_method :: atom) :: ExAws.Request.response_t
Determine the CORS configuration for an object
Specs:
- options_object(bucket :: binary, object :: binary, origin :: binary, request_method :: atom, request_headers :: [binary, ...]) :: ExAws.Request.response_t
Specs:
- post_object(bucket :: binary, object :: binary) :: ExAws.Request.response_t
Create an object within a bucket.
Generally speaking put_object ought to be used. AWS POST object exists to support the AWS UI.
Specs:
- post_object(bucket :: binary, object :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- post_object_restore(bucket :: binary, object :: binary, version_id :: binary, number_of_days :: pos_integer) :: ExAws.Request.response_t
Restore an object to a particular version FIXME
Specs:
- put_bucket(bucket :: binary, region :: binary) :: ExAws.Request.response_t
Creates a bucket. Same as create_bucket/2
Specs:
- put_bucket_acl(bucket :: binary, owner_id :: binary, owner_email :: binary, grants :: %{}) :: ExAws.Request.response_t
Update or create a bucket bucket access control
Specs:
- put_bucket_cors(bucket :: binary, cors_config :: %{}) :: ExAws.Request.response_t
Update or create a bucket CORS policy
Specs:
- put_bucket_lifecycle(bucket :: binary, lifecycle_config :: %{}) :: ExAws.Request.response_t
Update or create a bucket lifecycle configuration
Specs:
- put_bucket_logging(bucket :: binary, logging_config :: %{}) :: ExAws.Request.response_t
Update or create a bucket logging configuration
Specs:
- put_bucket_notification(bucket :: binary, notification_config :: %{}) :: ExAws.Request.response_t
Update or create a bucket notification configuration
Specs:
- put_bucket_policy(bucket :: binary, policy :: %{}) :: ExAws.Request.response_t
Update or create a bucket policy configuration
Specs:
- put_bucket_replication(bucket :: binary, replication_config :: %{}) :: ExAws.Request.response_t
Update or create a bucket replication configuration
Specs:
- put_bucket_requestpayment(bucket :: binary, payer :: :requester | :bucket_owner) :: ExAws.Request.response_t
Update or create a bucket requestpayment configuration
Specs:
- put_bucket_tagging(bucket :: binary, tags :: %{}) :: ExAws.Request.response_t
Update or create a bucket tagging configuration
Specs:
- put_bucket_versioning(bucket :: binary, version_config :: binary) :: ExAws.Request.response_t
Update or create a bucket versioning configuration
Specs:
- put_bucket_website(bucket :: binary, website_config :: binary) :: ExAws.Request.response_t
Update or create a bucket website configuration
Specs:
- put_object(bucket :: binary, object :: binary, body :: binary) :: ExAws.Request.response_t
Create an object within a bucket
Specs:
- put_object(bucket :: binary, object :: binary, body :: binary, opts :: Keyword.t) :: ExAws.Request.response_t
Specs:
- put_object_acl(bucket :: binary, object :: binary, acl :: %{}) :: ExAws.Request.response_t
Create or update an object’s access control FIXME
Specs:
- put_object_copy(dest_bucket :: binary, dest_object :: binary, src_bucket :: binary, src_object :: binary) :: ExAws.Request.response_t
Copy an object
Specs:
- put_object_copy(dest_bucket :: binary, dest_object :: binary, src_bucket :: binary, src_object :: binary, opts :: %{}) :: ExAws.Request.response_t
Specs:
- request(client :: %{}, http_method :: atom, bucket :: binary, path :: binary) :: ExAws.Request.response_t
Enables custom request handling.
By default this just forwards the request to the ExAws.S3.Request.request/4. However, this can be overriden in your client to provide pre-request adjustments to headers, params, etc.
Specs:
- request(client :: %{}, http_method :: atom, bucket :: binary, path :: binary, data :: Keyword.t) :: ExAws.Request.response_t
Specs:
- upload_part(bucket :: binary, object :: binary, upload_id :: binary, part_number :: pos_integer) :: ExAws.Request.response_t
Upload a part for a multipart upload
Specs:
- upload_part_copy(dest_bucket :: binary, dest_object :: binary, src_bucket :: binary, src_object :: binary) :: ExAws.Request.response_t
Upload a part for a multipart copy
Specs:
- upload_part_copy(dest_bucket :: binary, dest_object :: binary, src_bucket :: binary, src_object :: binary, opts :: %{}) :: ExAws.Request.response_t