fog-maestrodev 1.18.0.20131121075022 → 1.18.0.20131122203507
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/fog.gemspec +2 -2
- data/lib/fog/aws/models/auto_scaling/configuration.rb +1 -0
- data/lib/fog/aws/models/compute/flavors.rb +10 -0
- data/lib/fog/aws/models/glacier/vault.rb +1 -1
- data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +3 -0
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +1 -0
- data/lib/fog/aws/requests/dns/get_change.rb +1 -1
- data/lib/fog/aws/storage.rb +2 -1
- data/lib/fog/core/errors.rb +3 -3
- data/lib/fog/dreamhost/dns.rb +2 -4
- data/lib/fog/google/compute.rb +72 -62
- data/lib/fog/google/models/compute/zones.rb +1 -1
- data/lib/fog/google/requests/compute/delete_disk.rb +19 -2
- data/lib/fog/google/requests/compute/delete_server.rb +3 -3
- data/lib/fog/google/requests/compute/get_disk.rb +26 -2
- data/lib/fog/google/requests/compute/get_image.rb +3 -3
- data/lib/fog/google/requests/compute/get_server.rb +1 -0
- data/lib/fog/google/requests/compute/insert_disk.rb +37 -2
- data/lib/fog/google/requests/compute/insert_firewall.rb +2 -1
- data/lib/fog/google/requests/compute/insert_image.rb +1 -1
- data/lib/fog/google/requests/compute/insert_server.rb +31 -22
- data/lib/fog/google/requests/compute/list_disks.rb +8 -2
- data/lib/fog/google/requests/compute/list_images.rb +2 -2
- data/lib/fog/google/requests/compute/list_machine_types.rb +2 -2
- data/lib/fog/google/requests/compute/list_servers.rb +2 -2
- data/lib/fog/google/requests/compute/list_zone_operations.rb +1 -1
- data/lib/fog/google/requests/compute/list_zones.rb +1 -1
- data/lib/fog/hp.rb +1 -1
- data/lib/fog/hp/README.md +57 -0
- data/lib/fog/hp/articles/auth_caching.md +23 -0
- data/lib/fog/hp/docs/connect.md +152 -0
- data/lib/fog/hp/docs/install.md +133 -0
- data/lib/fog/hp/examples/block_storage.md +296 -0
- data/lib/fog/hp/examples/block_storage_v2.md +446 -0
- data/lib/fog/hp/examples/cdn.md +54 -0
- data/lib/fog/hp/examples/compute.md +794 -0
- data/lib/fog/hp/examples/compute_v2.md +848 -0
- data/lib/fog/hp/examples/getting_started_examples.md +30 -0
- data/lib/fog/hp/examples/networking.md +472 -0
- data/lib/fog/hp/examples/object_storage.md +387 -0
- data/lib/fog/json.rb +6 -3
- data/lib/fog/openstack/identity.rb +2 -3
- data/lib/fog/openstack/image.rb +1 -4
- data/lib/fog/openstack/metering.rb +1 -4
- data/lib/fog/openstack/network.rb +1 -3
- data/lib/fog/openstack/requests/compute/add_flavor_access.rb +1 -1
- data/lib/fog/openstack/requests/compute/allocate_address.rb +1 -1
- data/lib/fog/openstack/requests/compute/attach_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_key_pair.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -1
- data/lib/fog/openstack/requests/compute/remove_flavor_access.rb +1 -1
- data/lib/fog/openstack/requests/compute/update_quota.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_ec2_credential.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
- data/lib/fog/openstack/requests/identity/update_user.rb +1 -1
- data/lib/fog/openstack/requests/image/update_image_members.rb +1 -1
- data/lib/fog/openstack/requests/orchestration/create_stack.rb +2 -2
- data/lib/fog/openstack/requests/orchestration/update_stack.rb +1 -1
- data/lib/fog/openstack/requests/volume/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/volume.rb +1 -4
- data/lib/fog/rackspace/compute_v2.rb +1 -0
- data/lib/fog/rackspace/examples/queues/claim_messages.rb +60 -0
- data/lib/fog/rackspace/examples/queues/create_queue.rb +45 -0
- data/lib/fog/rackspace/examples/queues/delete_message.rb +72 -0
- data/lib/fog/rackspace/examples/queues/delete_queue.rb +53 -0
- data/lib/fog/rackspace/examples/queues/list_messages.rb +64 -0
- data/lib/fog/rackspace/examples/queues/post_message.rb +59 -0
- data/lib/fog/rackspace/models/queues/claim.rb +2 -0
- data/lib/fog/rackspace/models/queues/message.rb +5 -5
- data/lib/fog/rackspace/models/queues/queue.rb +1 -1
- data/lib/fog/rackspace/service.rb +1 -1
- data/lib/fog/riakcs.rb +2 -2
- data/lib/fog/riakcs/provisioning.rb +1 -3
- data/lib/fog/riakcs/requests/provisioning/create_user.rb +2 -2
- data/lib/fog/riakcs/requests/provisioning/get_user.rb +1 -1
- data/lib/fog/riakcs/requests/provisioning/list_users.rb +1 -1
- data/lib/fog/riakcs/requests/usage/get_usage.rb +1 -1
- data/lib/fog/riakcs/usage.rb +0 -2
- data/lib/fog/vsphere/compute.rb +1 -0
- data/lib/fog/vsphere/models/compute/datastore.rb +1 -0
- data/lib/fog/vsphere/requests/compute/list_datastores.rb +9 -8
- data/lib/fog/vsphere/requests/compute/set_vm_customvalue.rb +19 -0
- data/lib/tasks/changelog_task.rb +0 -1
- data/tests/google/models/compute/disk_tests.rb +5 -0
- data/tests/google/models/compute/disks_tests.rb +5 -0
- data/tests/google/models/compute/server_tests.rb +3 -0
- data/tests/google/models/compute/servers_tests.rb +5 -0
- data/tests/google/requests/compute/disk_tests.rb +2 -1
- data/tests/google/requests/compute/firewall_tests.rb +1 -0
- data/tests/google/requests/compute/image_tests.rb +3 -0
- data/tests/google/requests/compute/network_tests.rb +1 -0
- data/tests/google/requests/compute/operation_tests.rb +1 -0
- data/tests/google/requests/compute/server_tests.rb +2 -3
- data/tests/google/requests/compute/zone_tests.rb +1 -6
- data/tests/helpers/mock_helper.rb +3 -4
- data/tests/rackspace/models/queues/message_tests.rb +16 -0
- data/tests/vsphere/requests/compute/set_vm_customvalue_tests.rb +21 -0
- metadata +29 -3
- data/lib/fog/hp/README_HP.rdoc +0 -61
@@ -43,7 +43,6 @@ module Fog
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def initialize(options={})
|
46
|
-
require 'multi_json'
|
47
46
|
@openstack_username = options[:openstack_username]
|
48
47
|
@openstack_tenant = options[:openstack_tenant]
|
49
48
|
@openstack_auth_uri = URI.parse(options[:openstack_auth_url])
|
@@ -90,8 +89,6 @@ module Fog
|
|
90
89
|
attr_reader :current_tenant
|
91
90
|
|
92
91
|
def initialize(options={})
|
93
|
-
require 'multi_json'
|
94
|
-
|
95
92
|
@openstack_auth_token = options[:openstack_auth_token]
|
96
93
|
|
97
94
|
unless @openstack_auth_token
|
@@ -165,7 +162,7 @@ module Fog
|
|
165
162
|
end
|
166
163
|
end
|
167
164
|
unless response.body.empty?
|
168
|
-
response.body =
|
165
|
+
response.body = Fog::JSON.decode(response.body)
|
169
166
|
end
|
170
167
|
response
|
171
168
|
end
|
@@ -179,8 +179,6 @@ module Fog
|
|
179
179
|
attr_reader :current_tenant
|
180
180
|
|
181
181
|
def initialize(options={})
|
182
|
-
require 'multi_json'
|
183
|
-
|
184
182
|
@openstack_auth_token = options[:openstack_auth_token]
|
185
183
|
|
186
184
|
unless @openstack_auth_token
|
@@ -254,7 +252,7 @@ module Fog
|
|
254
252
|
end
|
255
253
|
end
|
256
254
|
unless response.body.empty?
|
257
|
-
response.body =
|
255
|
+
response.body = Fog::JSON.decode(response.body)
|
258
256
|
end
|
259
257
|
response
|
260
258
|
end
|
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
def update_quota(tenant_id, options = {})
|
7
7
|
options['tenant_id'] = tenant_id
|
8
8
|
request(
|
9
|
-
:body =>
|
9
|
+
:body => Fog::JSON.encode({ 'quota_set' => options }),
|
10
10
|
:expects => 200,
|
11
11
|
:method => 'PUT',
|
12
12
|
:path => "/os-quota-sets/#{tenant_id}"
|
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
def update_user(user_id, options = {})
|
7
7
|
url = options.delete('url') || "/users/#{user_id}"
|
8
8
|
request(
|
9
|
-
:body =>
|
9
|
+
:body => Fog::JSON.encode({ 'user' => options }),
|
10
10
|
:expects => 200,
|
11
11
|
:method => 'PUT',
|
12
12
|
:path => url
|
@@ -25,12 +25,12 @@ module Fog
|
|
25
25
|
:expects => 201,
|
26
26
|
:path => 'stacks',
|
27
27
|
:method => 'POST',
|
28
|
-
:body =>
|
28
|
+
:body => Fog::JSON.encode(params)
|
29
29
|
)
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
class Mock
|
35
35
|
def create_stack(stack_name, options = {})
|
36
36
|
stack_id = Fog::Mock.random_hex(32)
|
data/lib/fog/openstack/volume.rb
CHANGED
@@ -61,7 +61,6 @@ module Fog
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def initialize(options={})
|
64
|
-
require 'multi_json'
|
65
64
|
@openstack_username = options[:openstack_username]
|
66
65
|
@openstack_tenant = options[:openstack_tenant]
|
67
66
|
@openstack_auth_uri = URI.parse(options[:openstack_auth_url])
|
@@ -108,8 +107,6 @@ module Fog
|
|
108
107
|
attr_reader :current_tenant
|
109
108
|
|
110
109
|
def initialize(options={})
|
111
|
-
require 'multi_json'
|
112
|
-
|
113
110
|
@openstack_auth_token = options[:openstack_auth_token]
|
114
111
|
|
115
112
|
unless @openstack_auth_token
|
@@ -181,7 +178,7 @@ module Fog
|
|
181
178
|
end
|
182
179
|
end
|
183
180
|
unless response.body.empty?
|
184
|
-
response.body =
|
181
|
+
response.body = Fog::JSON.decode(response.body)
|
185
182
|
end
|
186
183
|
response
|
187
184
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This example demonstrates claiming messages with the Rackpace Open Cloud
|
4
|
+
|
5
|
+
require 'rubygems' #required for Ruby 1.8.x
|
6
|
+
require 'fog'
|
7
|
+
|
8
|
+
def get_user_input(prompt)
|
9
|
+
print "#{prompt}: "
|
10
|
+
gets.chomp
|
11
|
+
end
|
12
|
+
|
13
|
+
def select_queue(queues)
|
14
|
+
abort "\nThere are not any queues the Chicago region. Try running create_queue.rb\n\n" if queues.empty?
|
15
|
+
|
16
|
+
puts "\nSelect Queue To Delete:\n\n"
|
17
|
+
queues.each_with_index do |queue, i|
|
18
|
+
puts "\t #{i}. #{queue.name}"
|
19
|
+
end
|
20
|
+
|
21
|
+
delete_str = get_user_input "\nEnter Queue Number"
|
22
|
+
queues[delete_str.to_i]
|
23
|
+
end
|
24
|
+
|
25
|
+
# Use username defined in ~/.fog file, if absent prompt for username.
|
26
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
27
|
+
def rackspace_username
|
28
|
+
Fog.credentials[:rackspace_username] || get_user_input("Enter Rackspace Username")
|
29
|
+
end
|
30
|
+
|
31
|
+
# Use api key defined in ~/.fog file, if absent prompt for api key
|
32
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
33
|
+
def rackspace_api_key
|
34
|
+
Fog.credentials[:rackspace_api_key] || get_user_input("Enter Rackspace API key")
|
35
|
+
end
|
36
|
+
|
37
|
+
# create Queue Service
|
38
|
+
service = Fog::Rackspace::Queues.new({
|
39
|
+
:rackspace_username => rackspace_username,
|
40
|
+
:rackspace_api_key => rackspace_api_key,
|
41
|
+
:rackspace_region => :ord #Use Chicago Region
|
42
|
+
})
|
43
|
+
|
44
|
+
# retrieve list of queues
|
45
|
+
queues = service.queues
|
46
|
+
|
47
|
+
# prompt for queue
|
48
|
+
queue = select_queue(queues)
|
49
|
+
|
50
|
+
# prompt for number of messages to claim
|
51
|
+
num_claims = get_user_input "Enter Number of Messages to Claim"
|
52
|
+
|
53
|
+
# Claim messages
|
54
|
+
claim = queue.claims.create :ttl => 300, :grace => 100, :limit => num_claims
|
55
|
+
|
56
|
+
puts "The following messages have been claimed for the next 5 minutes [#{claim.id}]"
|
57
|
+
|
58
|
+
claim.messages.each do |message|
|
59
|
+
puts "\t[#{message.id}] #{message.body[0..50]}"
|
60
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This example demonstrates creating a queue with the Rackpace Open Cloud
|
4
|
+
|
5
|
+
require 'rubygems' #required for Ruby 1.8.x
|
6
|
+
require 'fog'
|
7
|
+
|
8
|
+
def get_user_input(prompt)
|
9
|
+
print "#{prompt}: "
|
10
|
+
gets.chomp
|
11
|
+
end
|
12
|
+
|
13
|
+
# Use username defined in ~/.fog file, if absent prompt for username.
|
14
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
15
|
+
def rackspace_username
|
16
|
+
Fog.credentials[:rackspace_username] || get_user_input("Enter Rackspace Username")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Use api key defined in ~/.fog file, if absent prompt for api key
|
20
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
21
|
+
def rackspace_api_key
|
22
|
+
Fog.credentials[:rackspace_api_key] || get_user_input("Enter Rackspace API key")
|
23
|
+
end
|
24
|
+
|
25
|
+
# create Queue Service
|
26
|
+
service = Fog::Rackspace::Queues.new({
|
27
|
+
:rackspace_username => rackspace_username,
|
28
|
+
:rackspace_api_key => rackspace_api_key,
|
29
|
+
:rackspace_region => :ord #Use Chicago Region
|
30
|
+
})
|
31
|
+
|
32
|
+
#prompt for queue name
|
33
|
+
queue_name = get_user_input "Enter name for queue"
|
34
|
+
|
35
|
+
begin
|
36
|
+
# create queue
|
37
|
+
queue = service.queues.create :name => queue_name
|
38
|
+
puts "Queue #{queue_name} was successfully created"
|
39
|
+
|
40
|
+
puts "To delete the queue please execute the delete_queue.rb script\n\n"
|
41
|
+
rescue Fog::Rackspace::Queues::ServiceError => e
|
42
|
+
if e.status_code == 204
|
43
|
+
puts "Queue #{queue_name} already exists"
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This example demonstrates deleting a message with the Rackpace Open Cloud
|
4
|
+
|
5
|
+
require 'rubygems' #required for Ruby 1.8.x
|
6
|
+
require 'fog'
|
7
|
+
|
8
|
+
def get_user_input(prompt)
|
9
|
+
print "#{prompt}: "
|
10
|
+
gets.chomp
|
11
|
+
end
|
12
|
+
|
13
|
+
def select_queue(queues)
|
14
|
+
abort "\nThere are not any queues in the Chicago region. Try running create_queue.rb\n\n" if queues.empty?
|
15
|
+
|
16
|
+
puts "\nSelect Queue To Delete:\n\n"
|
17
|
+
queues.each_with_index do |queue, i|
|
18
|
+
puts "\t #{i}. #{queue.name}"
|
19
|
+
end
|
20
|
+
|
21
|
+
delete_str = get_user_input "\nEnter Queue Number"
|
22
|
+
queues[delete_str.to_i]
|
23
|
+
end
|
24
|
+
|
25
|
+
def select_message(messages)
|
26
|
+
abort "\nThere are not any messages in the Chicago region. Try running post_message.rb\n\n" if messages.empty?
|
27
|
+
|
28
|
+
puts "\nSelect Message To Delete:\n\n"
|
29
|
+
messages.each_with_index do |message, i|
|
30
|
+
puts "\t #{i}. [#{message.id}] #{message.body[0..50]}"
|
31
|
+
end
|
32
|
+
|
33
|
+
delete_str = get_user_input "\nEnter Message Number"
|
34
|
+
messages[delete_str.to_i]
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
# Use username defined in ~/.fog file, if absent prompt for username.
|
39
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
40
|
+
def rackspace_username
|
41
|
+
Fog.credentials[:rackspace_username] || get_user_input("Enter Rackspace Username")
|
42
|
+
end
|
43
|
+
|
44
|
+
# Use api key defined in ~/.fog file, if absent prompt for api key
|
45
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
46
|
+
def rackspace_api_key
|
47
|
+
Fog.credentials[:rackspace_api_key] || get_user_input("Enter Rackspace API key")
|
48
|
+
end
|
49
|
+
|
50
|
+
# create Queue Service
|
51
|
+
service = Fog::Rackspace::Queues.new({
|
52
|
+
:rackspace_username => rackspace_username,
|
53
|
+
:rackspace_api_key => rackspace_api_key,
|
54
|
+
:rackspace_region => :ord #Use Chicago Region
|
55
|
+
})
|
56
|
+
|
57
|
+
# retrieve list of queues
|
58
|
+
queues = service.queues
|
59
|
+
|
60
|
+
# prompt for queue
|
61
|
+
queue = select_queue(queues)
|
62
|
+
|
63
|
+
#retrieve list of messages
|
64
|
+
messages = queue.messages
|
65
|
+
|
66
|
+
# prompt for message
|
67
|
+
message = select_message(messages)
|
68
|
+
|
69
|
+
# delete message
|
70
|
+
message.destroy
|
71
|
+
|
72
|
+
puts "\nMessage #{message.id} has been destroyed\n"
|