Class: Ansible::Ruby::Modules::S3
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::S3
- Defined in:
- lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb
Overview
This module allows the user to manage S3 buckets and the objects within them. Includes support for creating and deleting both objects and buckets, retrieving objects as files or strings and generating download links. This module has a dependency on python-boto.
Instance Method Summary collapse
-
#aws_access_key ⇒ Object?
AWS access key id.
-
#aws_secret_key ⇒ Object?
AWS secret key.
-
#bucket ⇒ String
Bucket name.
-
#dest ⇒ String?
The destination file path when downloading an object/key with a GET operation.
-
#encrypt ⇒ Boolean?
When set for PUT mode, asks for server-side encryption.
-
#expiration ⇒ Integer?
Time limit (in seconds) for the URL generated and returned by S3/Walrus when performing a mode=put or mode=geturl operation.
-
#headers ⇒ String?
Custom headers for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
-
#marker ⇒ String?
Specifies the key to start with when using list mode.
-
#max_keys ⇒ Integer?
Max number of results to return in list mode, set this if you want to retrieve fewer than the default 1000 keys.
-
#metadata ⇒ String?
Metadata for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
-
#mode ⇒ :get, ...
Switches the module behaviour between put (upload), get (download), geturl (return download url, Ansible 1.3+), getstr (download object as string (1.3+)), list (list keys, Ansible 2.0+), create (bucket), delete (bucket), and delobj (delete object, Ansible 2.0+).
-
#object ⇒ String?
Keyname of the object inside the bucket.
-
#overwrite ⇒ Boolean?
Force overwrite either locally on the filesystem or remotely with the object/key.
-
#permission ⇒ String?
This option lets the user set the canned permissions on the object/bucket that are created.
-
#prefix ⇒ String?
Limits the response to keys that begin with the specified prefix for list mode.
-
#region ⇒ String?
AWS region to create the bucket in.
-
#retries ⇒ Integer?
On recoverable failure, how many times to retry before actually failing.
-
#s3_url ⇒ Object?
S3 URL endpoint for usage with Eucalypus, fakes3, etc.
-
#src ⇒ String?
The source file path when performing a PUT operation.
-
#version ⇒ String?
Version ID of the object inside the bucket.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#aws_access_key ⇒ Object?
Returns AWS access key id. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
11 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 11 attribute :aws_access_key |
#aws_secret_key ⇒ Object?
Returns AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
14 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 14 attribute :aws_secret_key |
#bucket ⇒ String
Returns Bucket name.
17 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 17 attribute :bucket |
#dest ⇒ String?
Returns The destination file path when downloading an object/key with a GET operation.
21 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 21 attribute :dest |
#encrypt ⇒ Boolean?
Returns When set for PUT mode, asks for server-side encryption.
25 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 25 attribute :encrypt |
#expiration ⇒ Integer?
Returns Time limit (in seconds) for the URL generated and returned by S3/Walrus when performing a mode=put or mode=geturl operation.
29 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 29 attribute :expiration |
#headers ⇒ String?
Returns Custom headers for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
33 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 33 attribute :headers |
#marker ⇒ String?
Returns Specifies the key to start with when using list mode. Object keys are returned in alphabetical order, starting with key after the marker in order.
37 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 37 attribute :marker |
#max_keys ⇒ Integer?
Returns Max number of results to return in list mode, set this if you want to retrieve fewer than the default 1000 keys.
41 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 41 attribute :max_keys |
#metadata ⇒ String?
Returns Metadata for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
45 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 45 attribute :metadata |
#mode ⇒ :get, ...
Returns Switches the module behaviour between put (upload), get (download), geturl (return download url, Ansible 1.3+), getstr (download object as string (1.3+)), list (list keys, Ansible 2.0+), create (bucket), delete (bucket), and delobj (delete object, Ansible 2.0+).
49 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 49 attribute :mode |
#object ⇒ String?
Returns Keyname of the object inside the bucket. Can be used to create “virtual directories”, see examples.
53 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 53 attribute :object |
#overwrite ⇒ Boolean?
Returns Force overwrite either locally on the filesystem or remotely with the object/key. Used with PUT and GET operations. Boolean or one of [Always, Never, Different], new in 2.0.
69 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 69 attribute :overwrite |
#permission ⇒ String?
Returns This option lets the user set the canned permissions on the object/bucket that are created. The permissions that can be set are ‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’. Multiple permissions can be specified as a list.
57 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 57 attribute :permission |
#prefix ⇒ String?
Returns Limits the response to keys that begin with the specified prefix for list mode.
61 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 61 attribute :prefix |
#region ⇒ String?
Returns AWS region to create the bucket in. If not set then the value of the AWS_REGION and EC2_REGION environment variables are checked, followed by the aws_region and ec2_region settings in the Boto config file. If none of those are set the region defaults to the S3 Location: US Standard. Prior to ansible 1.8 this parameter could be specified but had no effect.
73 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 73 attribute :region |
#retries ⇒ Integer?
Returns On recoverable failure, how many times to retry before actually failing.
77 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 77 attribute :retries |
#s3_url ⇒ Object?
Returns S3 URL endpoint for usage with Eucalypus, fakes3, etc. Otherwise assumes AWS.
81 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 81 attribute :s3_url |
#src ⇒ String?
Returns The source file path when performing a PUT operation.
84 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 84 attribute :src |
#version ⇒ String?
Returns Version ID of the object inside the bucket. Can be used to get a specific version of a file if versioning is enabled in the target bucket.
65 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/amazon/s3.rb', line 65 attribute :version |