繁体   English   中英

如何使用Ruby SDK更改对象/目录的S3存储类?

[英]How can I change the S3 storage class of an Object / Directory using Ruby SDK?

我找不到与Java SDK中的changeOutputStorageClass方法相当的方法。 我也听说有一种方法可以通过AWS CLI进行,但是我正在尝试利用Ruby SDK。

版本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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM