0

我找不到与Java SDK中的changeOutputStorageClass方法相当的方法。我还听说有一种方法可以通过 AWS CLI 执行此操作,但我正在尝试使用 Ruby SDK。

4

1 回答 1

0

版本 2 在 S3 对象 PutObjectRequest 中有它

object.put({
  acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
  body: source_file, # file/IO object, or string data
  cache_control: "CacheControl",
  content_disposition: "ContentDisposition",
  content_encoding: "ContentEncoding",
  content_language: "ContentLanguage",
  content_length: 1,
  content_md5: "ContentMD5",
  content_type: "ContentType",
  expires: Time.now,
  grant_full_control: "GrantFullControl",
  grant_read: "GrantRead",
  grant_read_acp: "GrantReadACP",
  grant_write_acp: "GrantWriteACP",
  metadata: {
    "MetadataKey" => "MetadataValue",
  },
  server_side_encryption: "AES256", # accepts AES256, aws:kms
  storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
  website_redirect_location: "WebsiteRedirectLocation",
  sse_customer_algorithm: "SSECustomerAlgorithm",
  sse_customer_key: "SSECustomerKey",
  sse_customer_key_md5: "SSECustomerKeyMD5",
  ssekms_key_id: "SSEKMSKeyId",
  request_payer: "requester", # accepts requester
  tagging: "TaggingHeader",
  use_accelerate_endpoint: false,
})

http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Types/PutObjectRequest.html

并在 CopyObjectRequest

http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Types/CopyObjectRequest.html

于 2017-08-29T12:08:39.183 回答