fog 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +5 -5
  2. data/.github/stale.yml +17 -0
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +37 -0
  5. data/README.md +3 -3
  6. data/fog.gemspec +6 -6
  7. data/lib/fog.rb +0 -1
  8. data/lib/fog/bin.rb +0 -1
  9. data/lib/fog/bin/brightbox.rb +2 -2
  10. data/lib/fog/cloudstack/models/compute/server.rb +2 -0
  11. data/lib/fog/linode/requests/compute/avail_datacenters.rb +1 -0
  12. data/lib/fog/opennebula/compute.rb +6 -1
  13. data/lib/fog/opennebula/requests/compute/OpenNebulaVNC.rb +5 -1
  14. data/lib/fog/version.rb +1 -1
  15. data/lib/tasks/changelog_task.rb +1 -0
  16. data/spec/fog/bin/atmos_spec.rb +0 -10
  17. data/spec/fog/bin/aws_spec.rb +0 -18
  18. data/spec/fog/bin/baremetalcloud_spec.rb +0 -10
  19. data/spec/fog/bin/brightbox_spec.rb +2 -2
  20. data/spec/fog/bin_spec.rb +0 -3
  21. data/tests/cloudsigma/models/snapshot_tests.rb +2 -0
  22. data/tests/cloudsigma/models/snapshots_tests.rb +1 -0
  23. data/tests/cloudsigma/requests/snapshots_tests.rb +1 -0
  24. data/tests/cloudsigma/requests/volumes_tests.rb +1 -1
  25. data/tests/cloudstack/compute/models/volume_tests.rb +1 -1
  26. data/tests/compute/helper.rb +0 -9
  27. data/tests/dns/helper.rb +0 -6
  28. data/tests/helpers/mock_helper.rb +0 -2
  29. data/tests/opennebula/compute_tests.rb +5 -2
  30. data/tests/opennebula/models/compute/flavor_tests.rb +5 -1
  31. data/tests/opennebula/models/compute/flavors_tests.rb +5 -2
  32. data/tests/opennebula/models/compute/group_tests.rb +5 -2
  33. data/tests/opennebula/models/compute/groups_tests.rb +5 -2
  34. data/tests/opennebula/models/compute/network_tests.rb +5 -1
  35. data/tests/opennebula/models/compute/networks_tests.rb +5 -2
  36. data/tests/opennebula/requests/compute/vm_allocate_tests.rb +5 -1
  37. data/tests/opennebula/requests/compute/vm_suspend_resume_tests.rb +5 -2
  38. metadata +26 -375
  39. data/lib/fog/bin/bluebox.rb +0 -36
  40. data/lib/fog/bluebox.rb +0 -3
  41. data/lib/fog/bluebox/blb.rb +0 -82
  42. data/lib/fog/bluebox/compute.rb +0 -98
  43. data/lib/fog/bluebox/core.rb +0 -12
  44. data/lib/fog/bluebox/dns.rb +0 -101
  45. data/lib/fog/bluebox/models/blb/lb_application.rb +0 -29
  46. data/lib/fog/bluebox/models/blb/lb_applications.rb +0 -24
  47. data/lib/fog/bluebox/models/blb/lb_backend.rb +0 -19
  48. data/lib/fog/bluebox/models/blb/lb_backends.rb +0 -27
  49. data/lib/fog/bluebox/models/blb/lb_service.rb +0 -32
  50. data/lib/fog/bluebox/models/blb/lb_services.rb +0 -27
  51. data/lib/fog/bluebox/models/compute/flavor.rb +0 -41
  52. data/lib/fog/bluebox/models/compute/flavors.rb +0 -24
  53. data/lib/fog/bluebox/models/compute/image.rb +0 -30
  54. data/lib/fog/bluebox/models/compute/images.rb +0 -24
  55. data/lib/fog/bluebox/models/compute/location.rb +0 -13
  56. data/lib/fog/bluebox/models/compute/locations.rb +0 -24
  57. data/lib/fog/bluebox/models/compute/server.rb +0 -121
  58. data/lib/fog/bluebox/models/compute/servers.rb +0 -32
  59. data/lib/fog/bluebox/models/dns/record.rb +0 -52
  60. data/lib/fog/bluebox/models/dns/records.rb +0 -32
  61. data/lib/fog/bluebox/models/dns/zone.rb +0 -62
  62. data/lib/fog/bluebox/models/dns/zones.rb +0 -24
  63. data/lib/fog/bluebox/parsers/dns/create_record.rb +0 -22
  64. data/lib/fog/bluebox/parsers/dns/create_zone.rb +0 -22
  65. data/lib/fog/bluebox/parsers/dns/get_record.rb +0 -17
  66. data/lib/fog/bluebox/parsers/dns/get_records.rb +0 -24
  67. data/lib/fog/bluebox/parsers/dns/get_zone.rb +0 -22
  68. data/lib/fog/bluebox/parsers/dns/get_zones.rb +0 -26
  69. data/lib/fog/bluebox/requests/blb/add_machine_to_lb_application.rb +0 -33
  70. data/lib/fog/bluebox/requests/blb/add_machine_to_lb_backend.rb +0 -31
  71. data/lib/fog/bluebox/requests/blb/get_lb_application.rb +0 -32
  72. data/lib/fog/bluebox/requests/blb/get_lb_applications.rb +0 -30
  73. data/lib/fog/bluebox/requests/blb/get_lb_backend.rb +0 -35
  74. data/lib/fog/bluebox/requests/blb/get_lb_backends.rb +0 -35
  75. data/lib/fog/bluebox/requests/blb/get_lb_machine.rb +0 -34
  76. data/lib/fog/bluebox/requests/blb/get_lb_machines.rb +0 -34
  77. data/lib/fog/bluebox/requests/blb/get_lb_service.rb +0 -35
  78. data/lib/fog/bluebox/requests/blb/get_lb_services.rb +0 -35
  79. data/lib/fog/bluebox/requests/blb/remove_machine_from_lb_backend.rb +0 -28
  80. data/lib/fog/bluebox/requests/blb/update_lb_backend_machine.rb +0 -29
  81. data/lib/fog/bluebox/requests/compute/create_block.rb +0 -44
  82. data/lib/fog/bluebox/requests/compute/create_template.rb +0 -25
  83. data/lib/fog/bluebox/requests/compute/destroy_block.rb +0 -24
  84. data/lib/fog/bluebox/requests/compute/destroy_template.rb +0 -24
  85. data/lib/fog/bluebox/requests/compute/get_block.rb +0 -24
  86. data/lib/fog/bluebox/requests/compute/get_blocks.rb +0 -26
  87. data/lib/fog/bluebox/requests/compute/get_location.rb +0 -24
  88. data/lib/fog/bluebox/requests/compute/get_locations.rb +0 -22
  89. data/lib/fog/bluebox/requests/compute/get_product.rb +0 -24
  90. data/lib/fog/bluebox/requests/compute/get_products.rb +0 -23
  91. data/lib/fog/bluebox/requests/compute/get_template.rb +0 -24
  92. data/lib/fog/bluebox/requests/compute/get_templates.rb +0 -24
  93. data/lib/fog/bluebox/requests/compute/reboot_block.rb +0 -25
  94. data/lib/fog/bluebox/requests/dns/create_record.rb +0 -44
  95. data/lib/fog/bluebox/requests/dns/create_zone.rb +0 -48
  96. data/lib/fog/bluebox/requests/dns/delete_record.rb +0 -27
  97. data/lib/fog/bluebox/requests/dns/delete_zone.rb +0 -27
  98. data/lib/fog/bluebox/requests/dns/get_record.rb +0 -36
  99. data/lib/fog/bluebox/requests/dns/get_records.rb +0 -37
  100. data/lib/fog/bluebox/requests/dns/get_zone.rb +0 -40
  101. data/lib/fog/bluebox/requests/dns/get_zones.rb +0 -39
  102. data/lib/fog/bluebox/requests/dns/update_record.rb +0 -30
  103. data/lib/fog/bluebox/requests/dns/update_zone.rb +0 -26
  104. data/lib/fog/ovirt.rb +0 -1
  105. data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
  106. data/lib/fog/ovirt/requests/compute/deactivate_volume.rb +0 -22
  107. data/spec/fog/bin/bluebox_spec.rb +0 -55
  108. data/spec/fog/compute_spec.rb +0 -19
  109. data/spec/fog/dns_spec.rb +0 -19
  110. data/tests/bluebox/requests/blb/helper.rb +0 -64
  111. data/tests/bluebox/requests/blb/lb_tests.rb +0 -75
  112. data/tests/bluebox/requests/compute/block_tests.rb +0 -83
  113. data/tests/bluebox/requests/compute/helper.rb +0 -16
  114. data/tests/bluebox/requests/compute/location_tests.rb +0 -32
  115. data/tests/bluebox/requests/compute/product_tests.rb +0 -34
  116. data/tests/bluebox/requests/compute/template_tests.rb +0 -37
  117. data/tests/bluebox/requests/dns/dns_tests.rb +0 -258
@@ -1,27 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/blb/lb_service'
3
-
4
- module Fog
5
- module Bluebox
6
- class BLB
7
- class LbServices < Fog::Collection
8
- model Fog::Bluebox::BLB::LbService
9
-
10
- attr_accessor :lb_application
11
-
12
- def all
13
- data = service.get_lb_services(lb_application.id).body
14
- load(data)
15
- end
16
-
17
- def get(lb_service_id)
18
- if lb_service = service.get_lb_service(lb_application.id, lb_service_id).body
19
- new(lb_service)
20
- end
21
- rescue Fog::Bluebox::BLB::NotFound
22
- nil
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,41 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Compute
5
- class Bluebox
6
- class Flavor < Fog::Model
7
- identity :id
8
-
9
- attribute :name
10
- attribute :cost
11
- attribute :description
12
-
13
- def bits
14
- # 64
15
- raise StandardError.new("Figure me out!?!")
16
- end
17
-
18
- def cores
19
- # # 2 quad-cores >= 2Ghz = 8 cores
20
- # 8 * case ram
21
- # when 256
22
- # 1/64.0
23
- # when 512
24
- # 1/32.0
25
- # when 1024
26
- # 1/16.0
27
- # when 2048
28
- # 1/8.0
29
- # when 4096
30
- # 1/4.0
31
- # when 8192
32
- # 1/2.0
33
- # when 15872
34
- # 1
35
- # end
36
- raise StandardError.new("Figure me out!?!")
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,24 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/compute/flavor'
3
-
4
- module Fog
5
- module Compute
6
- class Bluebox
7
- class Flavors < Fog::Collection
8
- model Fog::Compute::Bluebox::Flavor
9
-
10
- def all
11
- data = service.get_products.body
12
- load(data)
13
- end
14
-
15
- def get(product_id)
16
- response = service.get_product(product_id)
17
- new(response.body)
18
- rescue Fog::Compute::Bluebox::NotFound
19
- nil
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,30 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Compute
5
- class Bluebox
6
- class Image < Fog::Model
7
- identity :id
8
-
9
- attribute :block_id
10
- attribute :description
11
- attribute :public
12
- attribute :created_at, :aliases => 'created'
13
-
14
- def save
15
- requires :block_id
16
-
17
- data = service.create_template(block_id, attributes)
18
- true
19
- end
20
-
21
- def destroy
22
- requires :id
23
-
24
- data = service.destroy_template(id)
25
- true
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,24 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/compute/image'
3
-
4
- module Fog
5
- module Compute
6
- class Bluebox
7
- class Images < Fog::Collection
8
- model Fog::Compute::Bluebox::Image
9
-
10
- def all
11
- data = service.get_templates.body
12
- load(data)
13
- end
14
-
15
- def get(template_id)
16
- response = service.get_template(template_id)
17
- new(response.body)
18
- rescue Fog::Compute::Bluebox::NotFound
19
- nil
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,13 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Compute
5
- class Bluebox
6
- class Location < Fog::Model
7
- identity :id
8
-
9
- attribute :description
10
- end
11
- end
12
- end
13
- end
@@ -1,24 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/compute/location'
3
-
4
- module Fog
5
- module Compute
6
- class Bluebox
7
- class Locations < Fog::Collection
8
- model Fog::Compute::Bluebox::Location
9
-
10
- def all
11
- data = service.get_locations.body
12
- load(data)
13
- end
14
-
15
- def get(location_id)
16
- response = service.get_location(location_id)
17
- new(response.body)
18
- rescue Fog::Compute::Bluebox::NotFound
19
- nil
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,121 +0,0 @@
1
- require 'fog/compute/models/server'
2
-
3
- module Fog
4
- module Compute
5
- class Bluebox
6
- class BlockInstantiationError < StandardError; end
7
-
8
- class Server < Fog::Compute::Server
9
- identity :id
10
-
11
- attribute :cpu
12
- attribute :description
13
- attribute :flavor_id, :aliases => :product, :squash => 'id'
14
- attribute :hostname
15
- attribute :image_id
16
- attribute :location_id
17
- attribute :ips
18
- attribute :memory
19
- attribute :state, :aliases => "status"
20
- attribute :storage
21
- attribute :template
22
- attribute :ipv6_only
23
- attribute :vsh_id
24
-
25
- attr_accessor :hostname, :password, :lb_applications, :lb_services, :lb_backends
26
-
27
- def initialize(attributes={})
28
- self.flavor_id ||= '94fd37a7-2606-47f7-84d5-9000deda52ae' # Block 1GB Virtual Server
29
- self.image_id ||= 'a8f05200-7638-47d1-8282-2474ef57c4c3' # Scientific Linux 6
30
- self.location_id ||= '37c2bd9a-3e81-46c9-b6e2-db44a25cc675' # Seattle, WA
31
- super
32
- end
33
-
34
- def destroy
35
- requires :id
36
- service.destroy_block(id)
37
- true
38
- end
39
-
40
- def flavor
41
- requires :flavor_id
42
- service.flavors.get(flavor_id)
43
- end
44
-
45
- def image
46
- requires :image_id
47
- service.images.get(image_id)
48
- end
49
-
50
- def location
51
- requires :location_id
52
- service.locations.get(location_id)
53
- end
54
-
55
- def private_ip_address
56
- nil
57
- end
58
-
59
- def public_ip_address
60
- if ip = ips.first
61
- ip['address']
62
- end
63
- end
64
-
65
- def ready?
66
- self.state == 'running'
67
- end
68
-
69
- def reboot(type = 'SOFT')
70
- requires :id
71
- service.reboot_block(id, type)
72
- true
73
- end
74
-
75
- def save
76
- raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
77
- requires :flavor_id, :image_id, :location_id
78
- options = {}
79
-
80
- unless persisted? # new record
81
- raise(ArgumentError, "password or public_key is required for this operation") if !password && !public_key
82
- options['ssh_public_key'] = public_key if public_key
83
- options['password'] = password if @password
84
- end
85
-
86
- if @lb_backends
87
- options['lb_backends'] = lb_backends
88
- elsif @lb_services
89
- options['lb_services'] = lb_services
90
- elsif @lb_applications
91
- options['lb_applications'] = lb_applications
92
- end
93
-
94
- options['username'] = username
95
- options['hostname'] = hostname if @hostname
96
- options['ipv6_only'] = ipv6_only if ipv6_only
97
- data = service.create_block(flavor_id, image_id, location_id, options)
98
- merge_attributes(data.body)
99
- true
100
- end
101
-
102
- def setup(credentials = {})
103
- requires :identity, :ips, :public_key, :username
104
- Fog::SSH.new(ssh_ip_address, username, credentials).run([
105
- %{mkdir .ssh},
106
- %{echo "#{public_key}" >> ~/.ssh/authorized_keys},
107
- %{passwd -l #{username}},
108
- %{echo "#{Fog::JSON.encode(attributes)}" >> ~/attributes.json}
109
- ])
110
- rescue Errno::ECONNREFUSED
111
- sleep(1)
112
- retry
113
- end
114
-
115
- def username
116
- @username ||= 'deploy'
117
- end
118
- end
119
- end
120
- end
121
- end
@@ -1,32 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/compute/server'
3
-
4
- module Fog
5
- module Compute
6
- class Bluebox
7
- class Servers < Fog::Collection
8
- model Fog::Compute::Bluebox::Server
9
-
10
- def all
11
- data = service.get_blocks.body
12
- load(data)
13
- end
14
-
15
- def bootstrap(new_attributes = {})
16
- server = create(new_attributes)
17
- server.wait_for { ready? }
18
- server.setup(:key_data => [server.private_key])
19
- server
20
- end
21
-
22
- def get(server_id)
23
- if server_id && server = service.get_block(server_id).body
24
- new(server)
25
- end
26
- rescue Fog::Compute::Bluebox::NotFound
27
- nil
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,52 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module DNS
5
- class Bluebox
6
- class Record < Fog::Model
7
- extend Fog::Deprecation
8
- deprecate :ip, :value
9
- deprecate :ip=, :value=
10
-
11
- identity :id
12
-
13
- attribute :name
14
- attribute :domain_id, :aliases => 'domain-id'
15
- attribute :domain
16
- attribute :type
17
- attribute :value, :aliases => 'content'
18
-
19
- def initialize(attributes={})
20
- super
21
- end
22
-
23
- def destroy
24
- requires :identity
25
- service.delete_record(@zone.identity, identity)
26
- true
27
- end
28
-
29
- def zone
30
- @zone
31
- end
32
-
33
- def save
34
- requires :zone, :type, :name, :value
35
- data = unless identity
36
- service.create_record(zone.identity, type, name, value)
37
- else
38
- service.update_record(zone.identity, identity, {:type => type, :name => name, :content => value})
39
- end
40
- merge_attributes(data.body)
41
- true
42
- end
43
-
44
- private
45
-
46
- def zone=(new_zone)
47
- @zone = new_zone
48
- end
49
- end
50
- end
51
- end
52
- end
@@ -1,32 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/dns/record'
3
-
4
- module Fog
5
- module DNS
6
- class Bluebox
7
- class Records < Fog::Collection
8
- attribute :zone
9
-
10
- model Fog::DNS::Bluebox::Record
11
-
12
- def all
13
- requires :zone
14
- data = service.get_records(zone.identity).body['records']
15
- load(data)
16
- end
17
-
18
- def get(record_id)
19
- data = service.get_record(zone.identity, record_id).body
20
- new(data)
21
- rescue Fog::Service::NotFound
22
- nil
23
- end
24
-
25
- def new(attributes = {})
26
- requires :zone
27
- super({ :zone => zone }.merge!(attributes))
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,62 +0,0 @@
1
- require 'fog/core/model'
2
- require 'fog/bluebox/models/dns/records'
3
-
4
- module Fog
5
- module DNS
6
- class Bluebox
7
- class Zone < Fog::Model
8
- identity :id
9
-
10
- attribute :domain, :aliases => 'name'
11
- attribute :serial
12
- attribute :ttl
13
- attribute :retry
14
- attribute :expires
15
- attribute :record_count, :aliases => 'record-count'
16
- attribute :refresh
17
- attribute :minimum
18
-
19
- def initialize(attributes = {})
20
- super(attributes)
21
- end
22
-
23
- def destroy
24
- raise Fog::Errors::Error.new('Not implemented')
25
- end
26
-
27
- def records
28
- @records ||= begin
29
- Fog::DNS::Bluebox::Records.new(
30
- :zone => self,
31
- :service => service
32
- )
33
- end
34
- end
35
-
36
- def nameservers
37
- [
38
- 'ns1.blueblxgrid.com',
39
- 'ns2.blueblxgrid.com',
40
- 'ns3.blueblxgrid.com'
41
- ]
42
- end
43
-
44
- def destroy
45
- requires :identity
46
- service.delete_zone(identity)
47
- true
48
- end
49
-
50
- def save
51
- self.ttl ||= 3600
52
- requires :domain, :ttl
53
- options = attributes.dup
54
- options[:name] = options.delete(:domain)
55
- data = identity.nil? ? service.create_zone(options) : service.update_zone(identity, options)
56
- merge_attributes(data.body)
57
- true
58
- end
59
- end
60
- end
61
- end
62
- end