From ab288f29a0974d64fd8290db41080e5578be9651 Mon Sep 17 00:00:00 2001 From: Gustavo Sobral Date: Thu, 7 Nov 2019 13:37:11 +0100 Subject: [PATCH] Add tags attribute to Storage::File model --- .gitignore | 1 + lib/fog/aws/models/storage/file.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 0feb89006..a8bfa23eb 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ mkmf.log tests/.fog gemfiles/Gemfile-edge.lock +.idea diff --git a/lib/fog/aws/models/storage/file.rb b/lib/fog/aws/models/storage/file.rb index 4e16cb19a..15b1d3da3 100644 --- a/lib/fog/aws/models/storage/file.rb +++ b/lib/fog/aws/models/storage/file.rb @@ -25,6 +25,7 @@ module Fog attribute :encryption_key, :aliases => 'x-amz-server-side-encryption-customer-key' attribute :version, :aliases => 'x-amz-version-id' attribute :kms_key_id, :aliases => 'x-amz-server-side-encryption-aws-kms-key-id' + attribute :tags, :aliases => 'x-amz-tagging' # @note Chunk size to use for multipart uploads. # Use small chunk sizes to minimize memory. E.g. 5242880 = 5mb @@ -192,6 +193,7 @@ module Fog # @option options [String] expires sets number of seconds before AWS Object expires. # @option options [String] storage_class sets x-amz-storage-class HTTP header. Defaults to 'STANDARD'. Or, 'REDUCED_REDUNDANCY' # @option options [String] encryption sets HTTP encryption header. Set to 'AES256' to encrypt files at rest on S3 + # @option options [String] tags sets x-amz-tagging HTTP header. For example, 'Org-Id=1' or 'Org-Id=1&Service=MyService' # @return [Boolean] true if no errors # def save(options = {}) @@ -208,6 +210,7 @@ module Fog options['Expires'] = expires if expires options.merge!(metadata) options['x-amz-storage-class'] = storage_class if storage_class + options['x-amz-tagging'] = tags if tags options.merge!(encryption_headers) # With a single PUT operation you can upload objects up to 5 GB in size. Automatically set MP for larger objects.