fog-softlayer 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +8 -8
  2. data/.travis.yml +37 -0
  3. data/CONTRIBUTING.md +30 -0
  4. data/README.md +8 -5
  5. data/docs/cla-corporate.md +133 -0
  6. data/docs/cla-individual.md +84 -0
  7. data/docs/fog-softlayer-CCLA.pdf +0 -0
  8. data/docs/fog-softlayer-CLA.pdf +0 -0
  9. data/examples/storage.md +107 -0
  10. data/fog-softlayer.gemspec +1 -0
  11. data/gemfiles/Gemfile-edge +14 -0
  12. data/gemfiles/Gemfile-ruby-1.8.7 +14 -0
  13. data/lib/fog/softlayer.rb +1 -0
  14. data/lib/fog/softlayer/compute.rb +1 -1
  15. data/lib/fog/softlayer/compute/shared.rb +1 -1
  16. data/lib/fog/softlayer/core.rb +17 -1
  17. data/lib/fog/softlayer/models/storage/directories.rb +40 -0
  18. data/lib/fog/softlayer/models/storage/directory.rb +50 -0
  19. data/lib/fog/softlayer/models/storage/file.rb +166 -0
  20. data/lib/fog/softlayer/models/storage/files.rb +99 -0
  21. data/lib/fog/softlayer/requests/storage/copy_object.rb +42 -0
  22. data/lib/fog/softlayer/requests/storage/delete_container.rb +38 -0
  23. data/lib/fog/softlayer/requests/storage/delete_multiple_objects.rb +67 -0
  24. data/lib/fog/softlayer/requests/storage/delete_object.rb +40 -0
  25. data/lib/fog/softlayer/requests/storage/delete_static_large_object.rb +43 -0
  26. data/lib/fog/softlayer/requests/storage/get_container.rb +68 -0
  27. data/lib/fog/softlayer/requests/storage/get_containers.rb +51 -0
  28. data/lib/fog/softlayer/requests/storage/get_object.rb +45 -0
  29. data/lib/fog/softlayer/requests/storage/get_object_https_url.rb +88 -0
  30. data/lib/fog/softlayer/requests/storage/head_container.rb +28 -0
  31. data/lib/fog/softlayer/requests/storage/head_containers.rb +25 -0
  32. data/lib/fog/softlayer/requests/storage/head_object.rb +23 -0
  33. data/lib/fog/softlayer/requests/storage/post_set_meta_temp_url_key.rb +37 -0
  34. data/lib/fog/softlayer/requests/storage/put_container.rb +32 -0
  35. data/lib/fog/softlayer/requests/storage/put_dynamic_obj_manifest.rb +43 -0
  36. data/lib/fog/softlayer/requests/storage/put_object.rb +61 -0
  37. data/lib/fog/softlayer/requests/storage/put_object_manifest.rb +16 -0
  38. data/lib/fog/softlayer/requests/storage/put_static_obj_manifest.rb +57 -0
  39. data/lib/fog/softlayer/storage.rb +283 -0
  40. data/lib/fog/softlayer/version.rb +1 -1
  41. data/tests/helper.rb +0 -29
  42. data/tests/helpers/mock_helper.rb +4 -98
  43. data/tests/softlayer/models/storage/directory_tests.rb +49 -0
  44. data/tests/softlayer/models/storage/file_tests.rb +56 -0
  45. data/tests/softlayer/requests/storage/auth_tests.rb +17 -0
  46. data/tests/softlayer/requests/storage/container_tests.rb +52 -0
  47. data/tests/softlayer/requests/storage/object_tests.rb +68 -0
  48. metadata +53 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjY5ZGRiZWQ0NGZlNTRjMTJmZjNjYTU5ODU4MGI3ZTA4NjQxM2M5Mg==
4
+ OWE5Yjc5YjM3MzM5ZmQxMGQ1ZjIzMmE0OWQ5YmVhNWJhNDFmNDAwNQ==
5
5
  data.tar.gz: !binary |-
6
- ODkzYmYxMWZjODc1OWViZjdiMjNiMjgyMjk0ZWZjYTVkOTcwMzE4MQ==
6
+ ZDY5YTQyZTkzZGM1NjhkMGIyYThmMTYwNTM0MzY4NTczY2UxNDU3ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGYyYTkxMTMwOWMzMGY1ZWQyMDZiMDVjM2JlZGY2ZGFkMDQ2NDA2ZWY0Njk4
10
- YTFjNDFhMDYxMzMxMjdjZTM3MmZiNzY4NTliMTg0NjFlYzMyZjM3ZDQ3MzM3
11
- ZDI0YWI5ODBmNDZkNWI4MzJjMzY5OGE4MmFhNGE0Nzg3MWQyZTc=
9
+ MDlmN2Q2YWM4N2I3YzNhZmUzNzM3ZmNhOTJhNmYwZjM1Y2E1MzdmMTFjOTY4
10
+ NzVmY2RlMjkyODQxYWNlOWRmNzcyMDhlMDdhZjNjYjE0YWQ0N2YyODFmNGU5
11
+ Yzk5MGI1MDMxMGEzYzQ2ODhlZmQwYjRiZWI2MjYzZGU1YjA1MWU=
12
12
  data.tar.gz: !binary |-
13
- MDE5OWJmNTQ3YjQyZGNlMTljYTFlMzcwNWEyODJkYmFmOTI3MmI2NzVkMjNi
14
- ZjgzMDhlMGQzMmJmNzc0N2ZjOGQ0YWI0NjAyOTVkZDdhM2Y5NWJkMGRhMGRk
15
- MmIyNDI2YzQyMjIyYzNkNjU4NTg3MTdiYjQ5MzcwN2EzOWI3NGU=
13
+ OTU4ZGU1OTU5Y2Q5MGUxYjg4NjYzODc1Mzk1YTk1Nzg1YTkwOThmNjAxYjMw
14
+ MzczMTdkNGY2ZDdmZTUzZTNhNjZhMTc4M2ZlMTcwM2M4MmYzMGNjNTNhZGI0
15
+ ZmZmMzQ1ZTlkYTRiYzExNjBhYTFjMWQwMDliMWYyMTVmZDM3M2Y=
data/.travis.yml ADDED
@@ -0,0 +1,37 @@
1
+ language: ruby
2
+
3
+ script: bundle exec rake travis
4
+
5
+ matrix:
6
+ fast_finish: true
7
+ include:
8
+ - rvm: 1.8.7
9
+ gemfile: gemfiles/Gemfile-ruby-1.8.7
10
+ - rvm: 1.9.3
11
+ gemfile: Gemfile
12
+ - rvm: 2.0.0
13
+ gemfile: Gemfile
14
+ - rvm: 2.1.0
15
+ gemfile: Gemfile
16
+ - rvm: 2.1.1
17
+ gemfile: Gemfile
18
+ env: COVERAGE=true
19
+ - rvm: 2.1.1
20
+ gemfile: gemfiles/Gemfile-edge
21
+ - rvm: jruby-18mode
22
+ gemfile: gemfiles/Gemfile-ruby-1.8.7
23
+ - rvm: jruby-19mode
24
+ gemfile: Gemfile
25
+ - rvm: jruby-head
26
+ gemfile: Gemfile
27
+
28
+ allow_failures:
29
+ - rvm: jruby-head
30
+ - rvm: 1.8.7
31
+
32
+ notifications:
33
+ email:
34
+ - matt.eldridge@us.ibm.com
35
+
36
+ before_install:
37
+ - gem update --system # todo: workaround for https://github.com/rubygems/rubygems/pull/763
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,30 @@
1
+ # Contributing to fog-softlayer
2
+
3
+ We are happy to accept contributions to fog-softlayer. Please follow the guidelines below.
4
+
5
+ * Sign our contributor agreement (CLA) You can find the [CLA here](./docs/cla-individual.pdf).
6
+
7
+ * If you're contributing on behalf of your employer we'll need a signed copy of our corporate contributor agreement (CCLA) as well. You can find the [CCLA here](./docs/cla-corporate.pdf).
8
+
9
+ * Fork the repo, make your changes, and open a pull request.
10
+
11
+ ## Issue Tracking
12
+
13
+ You can file tickets to describe the bug you'd like to fix or feature you'd
14
+ like to add on the [fog-softlayer project](https://github.com/softlayer/fog-softlayer/issues) on github.
15
+
16
+ ## Testing Instructions
17
+
18
+ To run tests, run the following Ruby tool commands from the root of your local copy of
19
+ fog-softlayer:
20
+
21
+ bundle install
22
+ bundle exec rake travis
23
+
24
+ **All tests must pass** before your contribution can be merged. Thus it's a good idea
25
+ to execute the tests without your change to be sure you understand how to run
26
+ them, as well as after to validate that you've avoided regressions.
27
+
28
+ All but the most trivial changes should include **at least one unit test case** to exercise the
29
+ new / changed code; please add tests to your pull request in this common case.
30
+
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # SoftLayer Cloud module for fog (The Ruby cloud services library)
1
+ ### `fog-softlayer` - SoftLayer module for fog (The Ruby cloud services library).
2
+ [![Gem Version](https://badge.fury.io/rb/fog-softlayer.png)](http://badge.fury.io/rb/knife-softlayer)
3
+ [![Build Status](https://api.travis-ci.org/softlayer/fog-softlayer.svg)](https://travis-ci.org/softlayer/knife-softlayer)
4
+ [![Dependency Status](https://gemnasium.com/softlayer/fog-softlayer.svg)](https://gemnasium.com/softlayer/knife-softlayer)
2
5
 
3
6
  This gem is a module for the `fog` gem that allows you to manage resources in
4
7
  the SoftLayer Cloud.
@@ -15,7 +18,7 @@ Additional services coming soon:
15
18
  * Image
16
19
  * Network
17
20
 
18
- ## Installation
21
+ #### Installation
19
22
 
20
23
  Add this line to your application's Gemfile:
21
24
 
@@ -29,7 +32,7 @@ Or install it yourself as:
29
32
 
30
33
  $ gem install fog-softlayer
31
34
 
32
- ## Usage
35
+ #### Usage
33
36
 
34
37
  Please see the following references for instructions using the main `fog` gem
35
38
  and its modules:
@@ -38,11 +41,11 @@ and its modules:
38
41
  * http://fog.io/
39
42
  * http://rubydoc.info/gems/fog/
40
43
 
41
- ## Contributing
44
+ #### Contributing
42
45
 
43
46
  `fog` modules are kept within the main repo.
44
47
 
45
- 1. Fork it ( http://github.com/fog/fog/fork )
48
+ 1. Fork it ( http://github.com/softlayer/fog-softlayer/fork )
46
49
  2. Create your feature branch (`git checkout -b my-new-feature`)
47
50
  3. Commit your changes (`git commit -am 'Add some feature'`)
48
51
  4. Push to the branch (`git push origin my-new-feature`)
@@ -0,0 +1,133 @@
1
+
2
+ #### International Business Machines, Inc.
3
+ #####Software Grant and Corporate Contributor License Agreement ("Agreement")
4
+
5
+ http://www.github.org/softlayer/fog-softlayer/
6
+
7
+
8
+ Thank you for your interest in IBM’s fog-softlayer project (“the
9
+ Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, IBM must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms
10
+ below. This license is for your protection as a Contributor as well
11
+ as the protection of IBM and its users; it does not change your rights to use your own Contributions for any other purpose.
12
+
13
+ This version of the Agreement allows an entity (the "Corporation") to submit Contributions to the Project, to authorize Contributions
14
+ submitted by its designated employees to the Project, and to grant
15
+ copyright and patent licenses thereto
16
+
17
+ If you have not already done so, please complete and sign, then scan and email a pdf file of this Agreement to pjackson@softlayer.com.
18
+
19
+
20
+
21
+ Please read this document carefully before signing and keep a copy for your records.
22
+
23
+ Corporation name: ________________________________________________
24
+
25
+ Corporation address: ________________________________________________
26
+
27
+ Point of Contact: ________________________________________________
28
+
29
+ E-Mail: ________________________________________________
30
+
31
+ Telephone: _____________________
32
+
33
+
34
+ You accept and agree to the following terms and conditions for Your
35
+ present and future Contributions submitted to the Project. Except
36
+ for the license granted herein to IBM and recipients of software distributed by IBM, You reserve all right, title, and interest in and to Your Contributions.
37
+
38
+ 1. Definitions.
39
+
40
+ "You" (or "Your") shall mean the copyright owner or legal entity
41
+ authorized by the copyright owner that is making this Agreement
42
+ with IBM. For legal entities, the entity making a Contribution and
43
+ all other entities that control, are controlled by, or are under
44
+ common control with that entity are considered to be a single
45
+ Contributor. For the purposes of this definition, "control" means
46
+ (i) the power, direct or indirect, to cause the direction or
47
+ management of such entity, whether by contract or otherwise, or
48
+ (ii) ownership of fifty percent (50%) or more of the outstanding
49
+ shares, or (iii) beneficial ownership of such entity.
50
+
51
+ "Contribution" shall mean the code, documentation or other original
52
+ works of authorship expressly identified in Schedule B, as well as
53
+ any original work of authorship, including any modifications or
54
+ additions to an existing work, that is intentionally submitted by You to IBM for inclusion in, or documentation of, the Project managed by IBM (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to IBM or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, IBM for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
55
+
56
+ 2. Grant of Copyright License. Subject to the terms and conditions
57
+ of this Agreement, You hereby grant to IBM and to
58
+ recipients of software distributed by IBM a perpetual,
59
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
60
+ copyright license to reproduce, prepare derivative works of,
61
+ publicly display, publicly perform, sublicense, and distribute
62
+ Your Contributions and such derivative works.
63
+
64
+ 3. Grant of Patent License. Subject to the terms and conditions of
65
+ this Agreement, You hereby grant to IBM and to recipients
66
+ of software distributed by IBM a perpetual, worldwide,
67
+ non-exclusive, no-charge, royalty-free, irrevocable (except as
68
+ stated in this section) patent license to make, have made, use,
69
+ offer to sell, sell, import, and otherwise transfer the Work,
70
+ where such license applies only to those patent claims licensable
71
+ by You that are necessarily infringed by Your Contribution(s)
72
+ alone or by combination of Your Contribution(s) with the Work to
73
+ which such Contribution(s) were submitted. If any entity institutes
74
+ patent litigation against You or any other entity (including a
75
+ cross-claim or counterclaim in a lawsuit) alleging that your
76
+ Contribution, or the Work to which you have contributed, constitutes
77
+ direct or contributory patent infringement, then any patent licenses
78
+ granted to that entity under this Agreement for that Contribution or
79
+ Work shall terminate as of the date such litigation is filed.
80
+
81
+ 4. You represent that You are legally entitled to grant the above
82
+ license. You represent further that each employee of the
83
+ Corporation designated on Schedule A below (or in a subsequent
84
+ written modification to that Schedule) is authorized to submit
85
+ Contributions on behalf of the Corporation.
86
+
87
+ 5. You represent that each of Your Contributions is Your original
88
+ creation (see section 7 for submissions on behalf of others).
89
+
90
+ 6. You are not expected to provide support for Your Contributions,
91
+ except to the extent You desire to provide support. You may provide
92
+ support for free, for a fee, or not at all. Unless required by
93
+ applicable law or agreed to in writing, You provide Your
94
+ Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
95
+ OF ANY KIND, either express or implied, including, without
96
+ limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
97
+ MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
98
+
99
+ 7. Should You wish to submit work that is not Your original creation,
100
+ You may submit it to IBM separately from any
101
+ Contribution, identifying the complete details of its source and
102
+ of any license or other restriction (including, but not limited
103
+ to, related patents, trademarks, and license agreements) of which
104
+ you are personally aware, and conspicuously marking the work as
105
+ "Submitted on behalf of a third-party: [named here]".
106
+
107
+ 8. It is your responsibility to notify IBM when any change
108
+ is required to the list of designated employees authorized to submit
109
+ Contributions on behalf of the Corporation, or to the Corporation's
110
+ Point of Contact with IBM.
111
+
112
+
113
+
114
+ Please sign: __________________________________ Date: _______________
115
+
116
+ Title: __________________________________
117
+
118
+ Corporation: __________________________________
119
+
120
+
121
+ Schedule A
122
+
123
+ [Initial list of designated employees. NB: authorization is not
124
+ tied to particular Contributions.]
125
+
126
+
127
+
128
+
129
+ Schedule B
130
+
131
+ [Identification of optional concurrent software grant. Would be
132
+ left blank or omitted if there is no concurrent software grant.]
133
+
@@ -0,0 +1,84 @@
1
+ #### International Business Machines, Inc. (IBM)
2
+ #####Individual Contributor License Agreement ("Agreement")
3
+
4
+ http://www.github.com/softlayer/fog-softlayer
5
+
6
+ Thank you for your interest in the fog-softlayer project ("the Project").
7
+
8
+ In order to clarify the intellectual property license granted with Contributions from any person or entity, IBM must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of IBM and its customers; it does not change your rights to use your own Contributions for any other purpose.
9
+
10
+ If you have not already done so, please complete and sign, then scan and email a pdf file of this Agreement to pjackson@softlayer.com
11
+
12
+ Please read this document carefully before signing and keep a copy for your records.
13
+
14
+ Full name: ______________________________________________________
15
+
16
+ (optional) Public name: _________________________________________
17
+
18
+ Mailing Address: ________________________________________________
19
+
20
+ Country: ______________________________________________________
21
+
22
+ Telephone: ______________________________________________________
23
+
24
+ E-Mail: ______________________________________________________
25
+
26
+
27
+ You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Project. Except for the license granted herein to IBM and recipients of software distributed by IBM, You reserve all right, title, and interest in and to Your Contributions.
28
+
29
+ 1. Definitions.
30
+
31
+ "You" (or "Your") shall mean the copyright owner or legal entity
32
+ authorized by the copyright owner that is making this Agreement
33
+ with IBM. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
34
+
35
+ "Contribution" shall mean any original work of authorship,
36
+ including any modifications or additions to an existing work, that
37
+ is intentionally submitted by You to the Project for inclusion
38
+ in, or documentation of, the Project (”the Work”). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Project or its representatives,including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
39
+
40
+ 2. Grant of Copyright License. Subject to the terms and conditions of
41
+ this Agreement, You hereby grant to IBM and to recipients of software distributed by IBM a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
42
+
43
+ 3. Grant of Patent License. Subject to the terms and conditions of
44
+ this Agreement, You hereby grant to IBM and to recipients of software distributed by IBM a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work to which Your Contribution(s) were submitted, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
45
+
46
+ 4. You represent that you are legally entitled to grant the above
47
+ license. If your employer(s) has rights to intellectual property
48
+ that you create that includes your Contributions, you represent
49
+ that you have received permission to make Contributions on behalf
50
+ of that employer, that your employer has waived such rights for
51
+ your Contributions to the Project, or that your employer has
52
+ executed a separate Corporate CLA with IBM.
53
+
54
+ 5. You represent that each of Your Contributions is Your original
55
+ creation (see section 7 for submissions on behalf of others). You
56
+ represent that Your Contribution submissions include complete
57
+ details of any third-party license or other restriction (including,
58
+ but not limited to, related patents and trademarks) of which you
59
+ are personally aware and which are associated with any part of Your
60
+ Contributions.
61
+
62
+ 6. You are not expected to provide support for Your Contributions,
63
+ except to the extent You desire to provide support. You may provide
64
+ support for free, for a fee, or not at all. Unless required by
65
+ applicable law or agreed to in writing, You provide Your
66
+ Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
67
+ OF ANY KIND, either express or implied, including, without
68
+ limitation, any warranties or conditions of TITLE, NON-
69
+ INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
70
+
71
+ 7. Should You wish to submit work that is not Your original creation,
72
+ You may submit it to the Project separately from any
73
+ Contribution, identifying the complete details of its source and of
74
+ any license or other restriction (including, but not limited to,
75
+ related patents, trademarks, and license agreements) of which you
76
+ are personally aware, and conspicuously marking the work as
77
+ "Submitted on behalf of a third-party: [named here]".
78
+
79
+ 8. You agree to notify IBM of any facts or circumstances of
80
+ which you become aware that would make these representations
81
+ inaccurate in any respect.
82
+
83
+ Please sign: __________________________________ Date: ________________
84
+
Binary file
Binary file
@@ -0,0 +1,107 @@
1
+ ### Storage Examples
2
+
3
+ These examples all assume you have `~/.fog` which contains the following
4
+
5
+
6
+ ```yaml
7
+ :softlayer_username: example-username
8
+ :softlayer_api_key: 1a1a1a1a1a1a1a1a1a11a1a1a1a1a1a1a1a1a1
9
+ :softlayer_cluster: cluster # currently supported clusters are dal05, sng01, ams01
10
+ ```
11
+
12
+ #### Create a connection to SoftLayer Object Storage
13
+
14
+ ```ruby
15
+ require 'fog/softlayer'
16
+ @sl = Fog::Storage[:softlayer]
17
+ ```
18
+
19
+ #### Use the Models
20
+ 1. List directories/containers.
21
+
22
+ ```ruby
23
+ dirs = @sl.directories
24
+ dirs.size # the number of directories
25
+ ```
26
+ 1. Create a directory/container.
27
+
28
+ ```ruby
29
+ @sl.directories.create(:key => 'a-container')
30
+ ```
31
+
32
+ 1. Get a directory/container
33
+
34
+ ```ruby
35
+ dir = @sl.directories.get('a-container')
36
+ dir.key # => 'a-container'
37
+ ```
38
+
39
+
40
+ 1. Create a new file/object
41
+
42
+ ```ruby
43
+ dir = @sl.directories.get('a-container')
44
+ # Pass a string.
45
+ dir.files.create(:key => 'data.txt', :body => 'The quick brown fox jumps over the lazy dog.")
46
+ # From a file.
47
+ dir.files.create(:key => 'file-data.txt', :body => File.open('/path/to/file-data.txt')
48
+ ```
49
+
50
+
51
+ 1. Get an existing file/object
52
+
53
+ ```ruby
54
+ dir = @sl.directories.get('a-container')
55
+ file = dir.files.get('data.txt')
56
+ file.body # => 'The quick brown fox jumps over the lazy dog.'
57
+ ```
58
+
59
+
60
+
61
+ 1. Copy a file/object
62
+
63
+ ```ruby
64
+ file = @sl.directories.get('a-container').files.get('data.txt')
65
+ copy = file.copy('a-container', 'copy-of-data.txt')
66
+ copy.body # => 'The quick brown fox jumps over the lazy dog.'
67
+ ```
68
+
69
+
70
+
71
+ 1. List the files in a directory/container
72
+
73
+ ```ruby
74
+ @sl.directories.get('a-container').files
75
+ # => [
76
+ # <Fog::Storage::Softlayer::File
77
+ # key="a-container/data.txt",
78
+ # content_length=43,
79
+ # content_type="text/plain",
80
+ # content_disposition=nil,
81
+ # etag="a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
82
+ # last_modified=1970-00-00 00:00:00 -0000,
83
+ # access_control_allow_origin=nil,
84
+ # origin=nil
85
+ # >
86
+ # ...
87
+ ```
88
+
89
+ 1. Get a signed [temporary] url for a file/object
90
+
91
+ ```ruby
92
+ file = @sl.directories.get('a-container').files.get('data.txt')
93
+ file.url(Time.now + 300) # url expires in 5 minutes
94
+ ```
95
+
96
+ 1. Delete files/objects from a directory/container.
97
+
98
+ ```ruby
99
+ dir = @sl.directories('a-container')
100
+ dir.files.get('data.txt').destroy
101
+ dir.files.get('file-data.txt').destroy
102
+ dir.files.get('copy-of-data.txt').destroy
103
+ # Must destroy all files/objects before destroying container.
104
+ dir.destroy
105
+ ```
106
+
107
+