fog-softlayer 0.3.30 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,6 @@
7
7
 
8
8
  module Fog
9
9
  module Softlayer
10
- VERSION = "0.3.30"
10
+ VERSION = "0.4.0"
11
11
  end
12
12
  end
@@ -0,0 +1,29 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | Item model", ["softlayer"]) do
9
+
10
+ tests("success") do
11
+
12
+ @service = Fog::Softlayer[:product]
13
+
14
+ # Setup
15
+ @item = @service.packages.first.items.get(299)
16
+
17
+ tests("#attributes") do
18
+ returns(299, "id") { @item.id }
19
+ returns(10.0, "capacity") { @item.capacity }
20
+ returns("10Mbps Hardware Firewall", "description") { @item.description }
21
+ returns(166, "category for item tax") { @item.item_tax_category_id }
22
+ returns("10MBPS_HARDWARE_FIREWALL", "key name") { @item.key_name }
23
+ returns(nil, "long description") { @item.long_description }
24
+ returns(0, "software description id") { @item.software_description_id }
25
+ returns("Mbps", "metric unit for item") { @item.units }
26
+ returns(0, "upgrade item id") { @item.upgrade_item_id }
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,27 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | Items model", ["softlayer"]) do
9
+
10
+ @service = Fog::Softlayer[:product]
11
+
12
+ tests("success") do
13
+
14
+ tests("#all") do
15
+ @items = @service.packages.first.items
16
+ @items.first(3).each do |item|
17
+ returns(Fog::Softlayer::Product::Item, "returns a "+item.description+" package item") { item.class }
18
+ end
19
+ end
20
+
21
+ tests("#get") do
22
+ returns(Fog::Softlayer::Product::Item) { @service.packages.first.items.get(299).class }
23
+ end
24
+
25
+ end
26
+ end
27
+
@@ -0,0 +1,31 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | Package model", ["softlayer"]) do
9
+
10
+ tests("success") do
11
+
12
+ @service = Fog::Softlayer[:product]
13
+
14
+ # Setup
15
+ @package = @service.packages.first
16
+
17
+ tests("#attributes") do
18
+ returns(0, "id") { @package.id }
19
+ returns(nil, "description") { @package.description }
20
+ returns(1, "if first step on order") { @package.first_order_step_id }
21
+ returns(1, "if is active") { @package.is_active }
22
+ returns("Additional Products", "package name") { @package.name }
23
+ returns(nil, "sub description") { @package.sub_description }
24
+ returns(0, "unit size") { @package.unit_size }
25
+ end
26
+
27
+ tests("#items") do
28
+ returns(Fog::Softlayer::Product::Items) { @package.items.class }
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,22 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | Packages model", ["softlayer"]) do
9
+
10
+ @service = Fog::Softlayer[:product]
11
+
12
+ tests("success") do
13
+
14
+ tests("#all") do
15
+ @packages = @service.packages
16
+ @packages.first(3).each do |package|
17
+ returns(Fog::Softlayer::Product::Package, "returns a #{package.name} package") { package.class }
18
+ end
19
+ end
20
+ end
21
+ end
22
+
@@ -0,0 +1,38 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | package_item_test", ["softlayer"]) do
9
+
10
+ @sl = Fog::Softlayer[:product]
11
+
12
+ tests('success') do
13
+ # should be an empty array
14
+ tests("#get_package_item") do
15
+ tests("for package id 0") do
16
+ tests("for item id 299") do
17
+ data_matches_schema(Array) { @sl.get_package_item(0, 299).body}
18
+ returns(1) { @sl.get_package_item(0, 299).body.size}
19
+ end
20
+ tests("for item id 5914") do
21
+ data_matches_schema(Array) { @sl.get_package_item(0, 5914).body}
22
+ returns(1) { @sl.get_package_item(0, 5914).body.size}
23
+ end
24
+ end
25
+
26
+ tests("for package id 242") do
27
+ tests("for item id 4123") do
28
+ data_matches_schema(Array) { @sl.get_package_item(242, 4123).body}
29
+ returns(1) { @sl.get_package_item(242, 4123).body.size}
30
+ end
31
+ tests("for item id 4097") do
32
+ data_matches_schema(Array) { @sl.get_package_item(242, 4097).body}
33
+ returns(1) { @sl.get_package_item(242, 4097).body.size}
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,26 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | package_items_test", ["softlayer"]) do
9
+
10
+ @sl = Fog::Softlayer[:product]
11
+
12
+ tests('success') do
13
+ # should be an empty array
14
+ tests("#get_package_items") do
15
+ tests("for id 0") do
16
+ data_matches_schema(Array) { @sl.get_package_items(0).body}
17
+ returns(261) { @sl.get_package_items(0).body.size}
18
+ end
19
+
20
+ tests("for id 242") do
21
+ data_matches_schema(Array) { @sl.get_package_items(242).body}
22
+ returns(28) { @sl.get_package_items(242).body.size}
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,19 @@
1
+ #
2
+ # Author:: Celso Fernandes (<fernandes@zertico.com>)
3
+ # © Copyright IBM Corporation 2015.
4
+ #
5
+ # LICENSE: MIT (http://opensource.org/licenses/MIT)
6
+ #
7
+
8
+ Shindo.tests("Fog::Softlayer[:product] | packages_test", ["softlayer"]) do
9
+
10
+ @sl = Fog::Softlayer[:product]
11
+
12
+ tests('success') do
13
+ # should be an empty array
14
+ tests("#get_packages") do
15
+ data_matches_schema(Array) { @sl.get_packages.body}
16
+ returns(129) { @sl.get_packages.body.size}
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-softlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.30
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Eldridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -198,6 +198,7 @@ files:
198
198
  - docs/cla-individual.md
199
199
  - docs/fog-softlayer-CCLA.pdf
200
200
  - docs/fog-softlayer-CLA.pdf
201
+ - examples/README.md
201
202
  - examples/compute.md
202
203
  - examples/dns.md
203
204
  - examples/global_ip_address.md
@@ -239,11 +240,16 @@ files:
239
240
  - lib/fog/softlayer/models/network/subnets.rb
240
241
  - lib/fog/softlayer/models/network/tag.rb
241
242
  - lib/fog/softlayer/models/network/tags.rb
243
+ - lib/fog/softlayer/models/product/item.rb
244
+ - lib/fog/softlayer/models/product/items.rb
245
+ - lib/fog/softlayer/models/product/package.rb
246
+ - lib/fog/softlayer/models/product/packages.rb
242
247
  - lib/fog/softlayer/models/storage/directories.rb
243
248
  - lib/fog/softlayer/models/storage/directory.rb
244
249
  - lib/fog/softlayer/models/storage/file.rb
245
250
  - lib/fog/softlayer/models/storage/files.rb
246
251
  - lib/fog/softlayer/network.rb
252
+ - lib/fog/softlayer/product.rb
247
253
  - lib/fog/softlayer/requests/compute/create_bare_metal_server.rb
248
254
  - lib/fog/softlayer/requests/compute/create_bare_metal_tags.rb
249
255
  - lib/fog/softlayer/requests/compute/create_key_pair.rb
@@ -303,6 +309,9 @@ files:
303
309
  - lib/fog/softlayer/requests/network/list_subnets.rb
304
310
  - lib/fog/softlayer/requests/network/route_global_ip.rb
305
311
  - lib/fog/softlayer/requests/network/unroute_global_ip.rb
312
+ - lib/fog/softlayer/requests/product/get_package_item.rb
313
+ - lib/fog/softlayer/requests/product/get_package_items.rb
314
+ - lib/fog/softlayer/requests/product/get_packages.rb
306
315
  - lib/fog/softlayer/requests/storage/copy_object.rb
307
316
  - lib/fog/softlayer/requests/storage/delete_container.rb
308
317
  - lib/fog/softlayer/requests/storage/delete_multiple_objects.rb
@@ -352,6 +361,10 @@ files:
352
361
  - tests/softlayer/models/dns/domains_tests.rb
353
362
  - tests/softlayer/models/dns/record_tests.rb
354
363
  - tests/softlayer/models/dns/records_tests.rb
364
+ - tests/softlayer/models/product/item_tests.rb
365
+ - tests/softlayer/models/product/items_tests.rb
366
+ - tests/softlayer/models/product/package_tests.rb
367
+ - tests/softlayer/models/product/packages_tests.rb
355
368
  - tests/softlayer/models/storage/directory_tests.rb
356
369
  - tests/softlayer/models/storage/file_tests.rb
357
370
  - tests/softlayer/requests/compute/bmc_tests.rb
@@ -359,6 +372,9 @@ files:
359
372
  - tests/softlayer/requests/compute/tag_tests.rb
360
373
  - tests/softlayer/requests/compute/vm_tests.rb
361
374
  - tests/softlayer/requests/network/network_tests.rb
375
+ - tests/softlayer/requests/product/get_package_item.rb
376
+ - tests/softlayer/requests/product/get_package_items.rb
377
+ - tests/softlayer/requests/product/get_packages.rb
362
378
  - tests/softlayer/requests/storage/auth_tests.rb
363
379
  - tests/softlayer/requests/storage/container_tests.rb
364
380
  - tests/softlayer/requests/storage/object_tests.rb