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,36 +0,0 @@
1
- class Bluebox < Fog::Bin
2
- class << self
3
- def class_for(key)
4
- case key
5
- when :compute
6
- Fog::Compute::Bluebox
7
- when :dns
8
- Fog::DNS::Bluebox
9
- when :blb
10
- Fog::Bluebox::BLB
11
- else
12
- raise ArgumentError, "Unsupported #{self} service: #{key}"
13
- end
14
- end
15
-
16
- def [](service)
17
- @@connections ||= Hash.new do |hash, key|
18
- hash[key] = case key
19
- when :compute
20
- Fog::Logger.warning("Bluebox[:compute] is not recommended, use Compute[:bluebox] for portability")
21
- Fog::Compute.new(:provider => 'Bluebox')
22
- when :dns
23
- Fog::Logger.warning("Bluebox[:dns] is not recommended, use DNS[:bluebox] for portability")
24
- Fog::DNS.new(:provider => 'Bluebox')
25
- else
26
- raise ArgumentError, "Unrecognized service: #{service}"
27
- end
28
- end
29
- @@connections[service]
30
- end
31
-
32
- def services
33
- Fog::Bluebox.services
34
- end
35
- end
36
- end
@@ -1,3 +0,0 @@
1
- require 'fog/bluebox/blb'
2
- require 'fog/bluebox/compute'
3
- require 'fog/bluebox/dns'
@@ -1,82 +0,0 @@
1
- require 'fog/bluebox/core'
2
-
3
- module Fog
4
- module Bluebox
5
- class BLB < Fog::Service
6
- requires :bluebox_api_key, :bluebox_customer_id
7
- recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent
8
-
9
- model_path 'fog/bluebox/models/blb'
10
-
11
- model :lb_application
12
- collection :lb_applications
13
-
14
- model :lb_service
15
- collection :lb_services
16
-
17
- model :lb_backend
18
- collection :lb_backends
19
-
20
- request_path 'fog/bluebox/requests/blb'
21
-
22
- request :get_lb_application
23
- request :get_lb_applications
24
-
25
- request :get_lb_service
26
- request :get_lb_services
27
-
28
- request :get_lb_backend
29
- request :get_lb_backends
30
-
31
- request :add_machine_to_lb_application
32
-
33
- request :add_machine_to_lb_backend
34
-
35
- request :remove_machine_from_lb_backend
36
-
37
- request :update_lb_backend_machine
38
-
39
- class Mock
40
- end
41
-
42
- class Real
43
- def initialize(options={})
44
- @bluebox_api_key = options[:bluebox_api_key]
45
- @bluebox_customer_id = options[:bluebox_customer_id]
46
- @connection_options = options[:connection_options] || {}
47
- @host = options[:bluebox_host] || "boxpanel.bluebox.net"
48
- @persistent = options[:persistent] || false
49
- @port = options[:bluebox_port] || 443
50
- @scheme = options[:bluebox_scheme] || 'https'
51
- @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
52
- end
53
-
54
- def reload
55
- @connection.reset
56
- end
57
-
58
- def request(params)
59
- params[:headers] ||= {}
60
- params[:headers].merge!({
61
- 'Authorization' => "Basic #{Base64.encode64([@bluebox_customer_id, @bluebox_api_key].join(':')).delete("\r\n")}"
62
- })
63
-
64
- begin
65
- response = @connection.request(params)
66
- rescue Excon::Errors::HTTPStatusError => error
67
- raise case error
68
- when Excon::Errors::NotFound
69
- Fog::Compute::Bluebox::NotFound.slurp(error)
70
- else
71
- error
72
- end
73
- end
74
- unless response.body.empty? || params[:headers]['Accept'] == 'text/plain'
75
- response.body = Fog::JSON.decode(response.body)
76
- end
77
- response
78
- end
79
- end
80
- end
81
- end
82
- end
@@ -1,98 +0,0 @@
1
- require 'fog/bluebox/core'
2
-
3
- module Fog
4
- module Compute
5
- class Bluebox < Fog::Service
6
- requires :bluebox_api_key, :bluebox_customer_id
7
- recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent
8
-
9
- model_path 'fog/bluebox/models/compute'
10
- model :flavor
11
- collection :flavors
12
- model :image
13
- collection :images
14
- model :server
15
- collection :servers
16
- model :location
17
- collection :locations
18
-
19
- request_path 'fog/bluebox/requests/compute'
20
- request :create_block
21
- request :destroy_block
22
- request :get_block
23
- request :get_blocks
24
- request :get_location
25
- request :get_locations
26
- request :get_product
27
- request :get_products
28
- request :get_template
29
- request :get_templates
30
- request :create_template
31
- request :destroy_template
32
- request :reboot_block
33
-
34
- class Mock
35
- def self.data
36
- @data ||= Hash.new do |hash, key|
37
- hash[key] = {}
38
- end
39
- end
40
-
41
- def self.reset
42
- @data = nil
43
- end
44
-
45
- def initialize(options={})
46
- @bluebox_api_key = options[:bluebox_api_key]
47
- end
48
-
49
- def data
50
- self.class.data[@bluebox_api_key]
51
- end
52
-
53
- def reset_data
54
- self.class.data.delete(@bluebox_api_key)
55
- end
56
- end
57
-
58
- class Real
59
- def initialize(options={})
60
- @bluebox_api_key = options[:bluebox_api_key]
61
- @bluebox_customer_id = options[:bluebox_customer_id]
62
- @connection_options = options[:connection_options] || {}
63
- @host = options[:bluebox_host] || "boxpanel.bluebox.net"
64
- @persistent = options[:persistent] || false
65
- @port = options[:bluebox_port] || 443
66
- @scheme = options[:bluebox_scheme] || 'https'
67
- @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
68
- end
69
-
70
- def reload
71
- @connection.reset
72
- end
73
-
74
- def request(params)
75
- params[:headers] ||= {}
76
- params[:headers].merge!({
77
- 'Authorization' => "Basic #{Base64.encode64([@bluebox_customer_id, @bluebox_api_key].join(':')).delete("\r\n")}"
78
- })
79
-
80
- begin
81
- response = @connection.request(params)
82
- rescue Excon::Errors::HTTPStatusError => error
83
- raise case error
84
- when Excon::Errors::NotFound
85
- Fog::Compute::Bluebox::NotFound.slurp(error)
86
- else
87
- error
88
- end
89
- end
90
- unless response.body.empty?
91
- response.body = Fog::JSON.decode(response.body)
92
- end
93
- response
94
- end
95
- end
96
- end
97
- end
98
- end
@@ -1,12 +0,0 @@
1
- require 'fog/core'
2
- require 'fog/json'
3
-
4
- module Fog
5
- module Bluebox
6
- extend Fog::Provider
7
-
8
- service(:blb, 'BLB')
9
- service(:compute, 'Compute')
10
- service(:dns, 'DNS')
11
- end
12
- end
@@ -1,101 +0,0 @@
1
- require 'fog/bluebox/core'
2
-
3
- module Fog
4
- module DNS
5
- class Bluebox < Fog::Service
6
- requires :bluebox_api_key, :bluebox_customer_id
7
- recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent
8
-
9
- model_path 'fog/bluebox/models/dns'
10
- model :record
11
- collection :records
12
- model :zone
13
- collection :zones
14
-
15
- request_path 'fog/bluebox/requests/dns'
16
- request :create_record
17
- request :update_record
18
- request :delete_record
19
- request :create_zone
20
- request :update_zone
21
- request :delete_zone
22
- request :get_record
23
- request :get_records
24
- request :get_zone
25
- request :get_zones
26
-
27
- class Mock
28
- def self.data
29
- @data ||= Hash.new do |hash, key|
30
- hash[key] = {}
31
- end
32
- end
33
-
34
- def self.reset
35
- @data = nil
36
- end
37
-
38
- def initialize(options={})
39
- @bluebox_customer_id = options[:bluebox_customer_id]
40
- @bluebox_api_key = options[:bluebox_api_key]
41
- end
42
-
43
- def data
44
- self.class.data[@bluebox_customer_id]
45
- end
46
-
47
- def reset_data
48
- self.class.data.delete(@bluebox_customer_id)
49
- end
50
- end
51
-
52
- class Real
53
- def initialize(options ={})
54
- @bluebox_customer_id = options[:bluebox_customer_id]
55
- @bluebox_api_key = options[:bluebox_api_key]
56
- @connection_options = options[:connection_options] || {}
57
- @host = options[:bluebox_host] || "boxpanel.bluebox.net"
58
- @persistent = options[:persistent] || false
59
- @port = options[:bluebox_port] || 443
60
- @scheme = options[:bluebox_scheme] || 'https'
61
- @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
62
- end
63
-
64
- def reload
65
- @connection.reset
66
- end
67
-
68
- def request(params)
69
- params[:headers] ||= {}
70
-
71
- params[:headers]['Authorization'] = "Basic #{auth_header}"
72
-
73
- params[:headers]['Accept'] = 'application/xml'
74
- case params[:method]
75
- when 'POST', 'PUT'
76
- params[:headers]['Content-Type'] = 'application/xml'
77
- end
78
-
79
- begin
80
- response = @connection.request(params)
81
- rescue Excon::Errors::HTTPStatusError => error
82
- raise case error
83
- when Excon::Errors::NotFound
84
- Fog::DNS::Bluebox::NotFound.slurp(error)
85
- else
86
- error
87
- end
88
- end
89
-
90
- response
91
- end
92
-
93
- protected
94
-
95
- def auth_header
96
- @auth_header ||= Base64.encode64("#{@bluebox_customer_id}:#{@bluebox_api_key}").gsub("\n",'')
97
- end
98
- end
99
- end
100
- end
101
- end
@@ -1,29 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Bluebox
5
- class BLB
6
- class LbApplication < Fog::Model
7
- identity :id
8
-
9
- attribute :name
10
- attribute :ip_v4
11
- attribute :ip_v6
12
- attribute :description
13
- attribute :created, :aliases => 'created_at'
14
-
15
- def add_machine(lb_machine_id, options)
16
- requires :id
17
- service.add_machine_to_lb_application(id, lb_machine_id, options)
18
- end
19
-
20
- def lb_services
21
- Fog::Bluebox::BLB::LbServices.new({
22
- :service => service,
23
- :lb_application => self
24
- })
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,24 +0,0 @@
1
- require 'fog/bluebox/models/blb/lb_application'
2
-
3
- module Fog
4
- module Bluebox
5
- class BLB
6
- class LbApplications < Fog::Collection
7
- model Fog::Bluebox::BLB::LbApplication
8
-
9
- def all
10
- data = service.get_lb_applications.body
11
- load(data)
12
- end
13
-
14
- def get(application_id)
15
- if application_id && application = service.get_lb_application(application_id).body
16
- new(application)
17
- end
18
- rescue Fog::Bluebox::BLB::NotFound
19
- nil
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,19 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Bluebox
5
- class BLB
6
- class LbBackend < Fog::Model
7
- identity :id
8
-
9
- attribute :name
10
- attribute :lb_machines
11
- attribute :monitoring_url
12
- attribute :monitoring_url_hostname
13
- attribute :acl_name
14
- attribute :acl_rule
15
- attribute :check_interval
16
- end
17
- end
18
- end
19
- end
@@ -1,27 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/bluebox/models/blb/lb_backend'
3
-
4
- module Fog
5
- module Bluebox
6
- class BLB
7
- class LbBackends < Fog::Collection
8
- model Fog::Bluebox::BLB::LbBackend
9
-
10
- attr_accessor :lb_service
11
-
12
- def all
13
- data = service.get_lb_backends(lb_service.id).body
14
- load(data)
15
- end
16
-
17
- def get(lb_backend_id)
18
- if lb_backend = service.get_lb_backend(lb_service.id, lb_backend_id).body
19
- new(lb_backend)
20
- end
21
- rescue Fog::Compute::Bluebox::NotFound
22
- nil
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,32 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Bluebox
5
- class BLB
6
- class LbService < Fog::Model
7
- identity :id
8
-
9
- attribute :name
10
- attribute :port
11
- attribute :service_type
12
- attribute :private
13
-
14
- attribute :status_url
15
- attribute :status_username
16
- attribute :status_password
17
- attribute :created, :aliases => 'created_at'
18
-
19
- def lb_application
20
- collection.lb_application
21
- end
22
-
23
- def lb_backends
24
- Fog::Bluebox::BLB::LbBackends.new({
25
- :service => service,
26
- :lb_service => self
27
- })
28
- end
29
- end
30
- end
31
- end
32
- end