選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

GetBucketVersioning - Amazon Simple Storage Service
此頁面尚未翻譯為您的語言。 請求翻譯

GetBucketVersioning

Note

This operation returns the versioning state for S3 on Outposts buckets only. To return the versioning state for an S3 bucket, see GetBucketVersioning in the Amazon S3 API Reference.

Returns the versioning state for an S3 on Outposts bucket. With S3 Versioning, you can save multiple distinct copies of your objects and recover from unintended user actions and application failures.

If you've never set versioning on your bucket, it has no versioning state. In that case, the GetBucketVersioning request does not return a versioning state value.

For more information about versioning, see Versioning in the Amazon S3 User Guide.

All Amazon S3 on Outposts REST API requests for this action require an additional parameter of x-amz-outpost-id to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of s3-control. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id derived by using the access point ARN, see the Examples section.

The following operations are related to GetBucketVersioning for S3 on Outposts.

Request Syntax

GET /v20180820/bucket/name/versioning HTTP/1.1 Host: Bucket.s3-control.amazonaws.com x-amz-account-id: AccountId

URI Request Parameters

The request uses the following URI parameters.

name

The S3 on Outposts bucket to return the versioning state for.

Length Constraints: Minimum length of 3. Maximum length of 255.

Required: Yes

x-amz-account-id

The AWS account ID of the S3 on Outposts bucket.

Length Constraints: Maximum length of 64.

Pattern: ^\d{12}$

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <GetBucketVersioningResult> <Status>string</Status> <MfaDelete>string</MfaDelete> </GetBucketVersioningResult>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.

GetBucketVersioningResult

Root level tag for the GetBucketVersioningResult parameters.

Required: Yes

MFADelete

Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is returned only if the bucket has been configured with MFA delete. If MFA delete has never been configured for the bucket, this element is not returned.

Type: String

Valid Values: Enabled | Disabled

Status

The versioning state of the S3 on Outposts bucket.

Type: String

Valid Values: Enabled | Suspended

Examples

Sample GetBucketVersioning request on an S3 on Outposts bucket

This request returns the versioning state for an S3 on Outposts bucket that's named example-outpost-bucket.

GET /v20180820/bucket/example-outpost-bucket/?versioning HTTP/1.1 Host:s3-outposts.region-code.amazonaws.com x-amz-account-id: example-account-id x-amz-outpost-id: op-01ac5d28a6a232904 x-amz-date: Wed, 25 May 2022 00:14:21 GMT Authorization: signatureValue

Sample GetBucketVersioning response on a versioning-enabled S3 on Outposts bucket

If you enabled versioning on a bucket, the response is:

<VersioningConfiguration xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/"> <Status>Enabled</Status> </VersioningConfiguration>

Sample GetBucketVersioning response on a versioning-suspended bucket

If you suspended versioning on a bucket, the response is:

<VersioningConfiguration xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/"> <Status>Suspended</Status> </VersioningConfiguration>

Sample GetBucketVersioning response if you have never enabled versioning.

If you have never enabled versioning on a bucket, the response is:

<VersioningConfiguration xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/">

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

下一個主題:

GetDataAccess

上一個主題:

GetBucketTagging
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。