

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 在 Snowball Edge 上使用 Snowball Edge 上的 Amazon S3 相容儲存取得儲存貯體
<a name="working-s3-snow-buckets-get-bucket-s3-snow"></a>

下列範例使用 在 Snowball Edge 儲存貯體上取得 Amazon S3 相容儲存 AWS CLI。若要使用此命令，請以您自己的資訊取代每個 使用者輸入預留位置。

```
aws s3control get-bucket --account-id 123456789012 --bucket amzn-s3-demo-bucket --endpoint-url https://s3ctrlapi-endpoint-ip --profile your-profile
```

如需此命令的詳細資訊，請參閱《 AWS CLI 命令參考》中的 [get-bucket](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3control/get-bucket.html)。

下列 Snowball Edge 上的 Amazon S3 相容儲存體範例會使用適用於 Java 的 SDK 取得儲存貯體。如需詳細資訊，請參閱 [Amazon Simple Storage Service API 參考](https://docs.aws.amazon.com/AmazonS3/latest/API/)中的 [GetBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html)。

```
import com.amazonaws.services.s3control.model.*;

public void getBucket(String bucketName) {

    GetBucketRequest reqGetBucket = new GetBucketRequest()
            .withBucket(bucketName)
            .withAccountId(AccountId);

    GetBucketResult respGetBucket = s3ControlClient.getBucket(reqGetBucket);
    System.out.printf("GetBucket Response: %s%n", respGetBucket.toString());
}
```