pub struct PutBucketWebsiteFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to PutBucketWebsite
.
This operation is not supported by directory buckets.
Sets the configuration of the website that is specified in the website
subresource. To configure a bucket as a website, you can add this subresource on the bucket with website configuration information such as the file name of the index document and any redirect rules. For more information, see Hosting Websites on Amazon S3.
This PUT action requires the S3:PutBucketWebsite
permission. By default, only the bucket owner can configure the website attached to a bucket; however, bucket owners can allow other users to set the website configuration by writing a bucket policy that grants them the S3:PutBucketWebsite
permission.
To redirect all website requests sent to the bucket's website endpoint, you add a website configuration with the following elements. Because all requests are sent to another website, you don't need to provide index document name for the bucket.
-
WebsiteConfiguration
-
RedirectAllRequestsTo
-
HostName
-
Protocol
If you want granular control over redirects, you can use the following elements to add routing rules that describe conditions for redirecting requests and information about the redirect destination. In this case, the website configuration must provide an index document for the bucket, because some requests might not be redirected.
-
WebsiteConfiguration
-
IndexDocument
-
Suffix
-
ErrorDocument
-
Key
-
RoutingRules
-
RoutingRule
-
Condition
-
HttpErrorCodeReturnedEquals
-
KeyPrefixEquals
-
Redirect
-
Protocol
-
HostName
-
ReplaceKeyPrefixWith
-
ReplaceKeyWith
-
HttpRedirectCode
Amazon S3 has a limitation of 50 routing rules per website configuration. If you require more than 50 routing rules, you can use object redirect. For more information, see Configuring an Object Redirect in the Amazon S3 User Guide.
The maximum request length is limited to 128 KB.
Implementations§
source§impl PutBucketWebsiteFluentBuilder
impl PutBucketWebsiteFluentBuilder
sourcepub fn as_input(&self) -> &PutBucketWebsiteInputBuilder
pub fn as_input(&self) -> &PutBucketWebsiteInputBuilder
Access the PutBucketWebsite as a reference.
sourcepub async fn send(
self,
) -> Result<PutBucketWebsiteOutput, SdkError<PutBucketWebsiteError, HttpResponse>>
pub async fn send( self, ) -> Result<PutBucketWebsiteOutput, SdkError<PutBucketWebsiteError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self,
) -> CustomizableOperation<PutBucketWebsiteOutput, PutBucketWebsiteError, Self>
pub fn customize( self, ) -> CustomizableOperation<PutBucketWebsiteOutput, PutBucketWebsiteError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn set_bucket(self, input: Option<String>) -> Self
pub fn set_bucket(self, input: Option<String>) -> Self
The bucket name.
sourcepub fn get_bucket(&self) -> &Option<String>
pub fn get_bucket(&self) -> &Option<String>
The bucket name.
sourcepub fn content_md5(self, input: impl Into<String>) -> Self
pub fn content_md5(self, input: impl Into<String>) -> Self
The base64-encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
sourcepub fn set_content_md5(self, input: Option<String>) -> Self
pub fn set_content_md5(self, input: Option<String>) -> Self
The base64-encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
sourcepub fn get_content_md5(&self) -> &Option<String>
pub fn get_content_md5(&self) -> &Option<String>
The base64-encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
sourcepub fn checksum_algorithm(self, input: ChecksumAlgorithm) -> Self
pub fn checksum_algorithm(self, input: ChecksumAlgorithm) -> Self
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum
or x-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm
parameter.
sourcepub fn set_checksum_algorithm(self, input: Option<ChecksumAlgorithm>) -> Self
pub fn set_checksum_algorithm(self, input: Option<ChecksumAlgorithm>) -> Self
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum
or x-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm
parameter.
sourcepub fn get_checksum_algorithm(&self) -> &Option<ChecksumAlgorithm>
pub fn get_checksum_algorithm(&self) -> &Option<ChecksumAlgorithm>
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum
or x-amz-trailer
header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request
. For more information, see Checking object integrity in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm
parameter.
sourcepub fn website_configuration(self, input: WebsiteConfiguration) -> Self
pub fn website_configuration(self, input: WebsiteConfiguration) -> Self
Container for the request.
sourcepub fn set_website_configuration(
self,
input: Option<WebsiteConfiguration>,
) -> Self
pub fn set_website_configuration( self, input: Option<WebsiteConfiguration>, ) -> Self
Container for the request.
sourcepub fn get_website_configuration(&self) -> &Option<WebsiteConfiguration>
pub fn get_website_configuration(&self) -> &Option<WebsiteConfiguration>
Container for the request.
sourcepub fn expected_bucket_owner(self, input: impl Into<String>) -> Self
pub fn expected_bucket_owner(self, input: impl Into<String>) -> Self
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden
(access denied).
sourcepub fn set_expected_bucket_owner(self, input: Option<String>) -> Self
pub fn set_expected_bucket_owner(self, input: Option<String>) -> Self
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden
(access denied).
sourcepub fn get_expected_bucket_owner(&self) -> &Option<String>
pub fn get_expected_bucket_owner(&self) -> &Option<String>
The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden
(access denied).
Trait Implementations§
source§impl Clone for PutBucketWebsiteFluentBuilder
impl Clone for PutBucketWebsiteFluentBuilder
source§fn clone(&self) -> PutBucketWebsiteFluentBuilder
fn clone(&self) -> PutBucketWebsiteFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PutBucketWebsiteFluentBuilder
impl !RefUnwindSafe for PutBucketWebsiteFluentBuilder
impl Send for PutBucketWebsiteFluentBuilder
impl Sync for PutBucketWebsiteFluentBuilder
impl Unpin for PutBucketWebsiteFluentBuilder
impl !UnwindSafe for PutBucketWebsiteFluentBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)