fog-maestrodev 1.18.0.20131121075022 → 1.18.0.20131122203507

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +8 -8
  2. data/fog.gemspec +2 -2
  3. data/lib/fog/aws/models/auto_scaling/configuration.rb +1 -0
  4. data/lib/fog/aws/models/compute/flavors.rb +10 -0
  5. data/lib/fog/aws/models/glacier/vault.rb +1 -1
  6. data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +3 -0
  7. data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +1 -0
  8. data/lib/fog/aws/requests/dns/get_change.rb +1 -1
  9. data/lib/fog/aws/storage.rb +2 -1
  10. data/lib/fog/core/errors.rb +3 -3
  11. data/lib/fog/dreamhost/dns.rb +2 -4
  12. data/lib/fog/google/compute.rb +72 -62
  13. data/lib/fog/google/models/compute/zones.rb +1 -1
  14. data/lib/fog/google/requests/compute/delete_disk.rb +19 -2
  15. data/lib/fog/google/requests/compute/delete_server.rb +3 -3
  16. data/lib/fog/google/requests/compute/get_disk.rb +26 -2
  17. data/lib/fog/google/requests/compute/get_image.rb +3 -3
  18. data/lib/fog/google/requests/compute/get_server.rb +1 -0
  19. data/lib/fog/google/requests/compute/insert_disk.rb +37 -2
  20. data/lib/fog/google/requests/compute/insert_firewall.rb +2 -1
  21. data/lib/fog/google/requests/compute/insert_image.rb +1 -1
  22. data/lib/fog/google/requests/compute/insert_server.rb +31 -22
  23. data/lib/fog/google/requests/compute/list_disks.rb +8 -2
  24. data/lib/fog/google/requests/compute/list_images.rb +2 -2
  25. data/lib/fog/google/requests/compute/list_machine_types.rb +2 -2
  26. data/lib/fog/google/requests/compute/list_servers.rb +2 -2
  27. data/lib/fog/google/requests/compute/list_zone_operations.rb +1 -1
  28. data/lib/fog/google/requests/compute/list_zones.rb +1 -1
  29. data/lib/fog/hp.rb +1 -1
  30. data/lib/fog/hp/README.md +57 -0
  31. data/lib/fog/hp/articles/auth_caching.md +23 -0
  32. data/lib/fog/hp/docs/connect.md +152 -0
  33. data/lib/fog/hp/docs/install.md +133 -0
  34. data/lib/fog/hp/examples/block_storage.md +296 -0
  35. data/lib/fog/hp/examples/block_storage_v2.md +446 -0
  36. data/lib/fog/hp/examples/cdn.md +54 -0
  37. data/lib/fog/hp/examples/compute.md +794 -0
  38. data/lib/fog/hp/examples/compute_v2.md +848 -0
  39. data/lib/fog/hp/examples/getting_started_examples.md +30 -0
  40. data/lib/fog/hp/examples/networking.md +472 -0
  41. data/lib/fog/hp/examples/object_storage.md +387 -0
  42. data/lib/fog/json.rb +6 -3
  43. data/lib/fog/openstack/identity.rb +2 -3
  44. data/lib/fog/openstack/image.rb +1 -4
  45. data/lib/fog/openstack/metering.rb +1 -4
  46. data/lib/fog/openstack/network.rb +1 -3
  47. data/lib/fog/openstack/requests/compute/add_flavor_access.rb +1 -1
  48. data/lib/fog/openstack/requests/compute/allocate_address.rb +1 -1
  49. data/lib/fog/openstack/requests/compute/attach_volume.rb +1 -1
  50. data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +1 -1
  51. data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
  52. data/lib/fog/openstack/requests/compute/create_key_pair.rb +1 -1
  53. data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
  54. data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
  55. data/lib/fog/openstack/requests/compute/create_volume.rb +1 -1
  56. data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +1 -1
  57. data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -1
  58. data/lib/fog/openstack/requests/compute/remove_flavor_access.rb +1 -1
  59. data/lib/fog/openstack/requests/compute/update_quota.rb +1 -1
  60. data/lib/fog/openstack/requests/identity/create_ec2_credential.rb +1 -1
  61. data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
  62. data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
  63. data/lib/fog/openstack/requests/identity/update_user.rb +1 -1
  64. data/lib/fog/openstack/requests/image/update_image_members.rb +1 -1
  65. data/lib/fog/openstack/requests/orchestration/create_stack.rb +2 -2
  66. data/lib/fog/openstack/requests/orchestration/update_stack.rb +1 -1
  67. data/lib/fog/openstack/requests/volume/create_volume.rb +1 -1
  68. data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +1 -1
  69. data/lib/fog/openstack/volume.rb +1 -4
  70. data/lib/fog/rackspace/compute_v2.rb +1 -0
  71. data/lib/fog/rackspace/examples/queues/claim_messages.rb +60 -0
  72. data/lib/fog/rackspace/examples/queues/create_queue.rb +45 -0
  73. data/lib/fog/rackspace/examples/queues/delete_message.rb +72 -0
  74. data/lib/fog/rackspace/examples/queues/delete_queue.rb +53 -0
  75. data/lib/fog/rackspace/examples/queues/list_messages.rb +64 -0
  76. data/lib/fog/rackspace/examples/queues/post_message.rb +59 -0
  77. data/lib/fog/rackspace/models/queues/claim.rb +2 -0
  78. data/lib/fog/rackspace/models/queues/message.rb +5 -5
  79. data/lib/fog/rackspace/models/queues/queue.rb +1 -1
  80. data/lib/fog/rackspace/service.rb +1 -1
  81. data/lib/fog/riakcs.rb +2 -2
  82. data/lib/fog/riakcs/provisioning.rb +1 -3
  83. data/lib/fog/riakcs/requests/provisioning/create_user.rb +2 -2
  84. data/lib/fog/riakcs/requests/provisioning/get_user.rb +1 -1
  85. data/lib/fog/riakcs/requests/provisioning/list_users.rb +1 -1
  86. data/lib/fog/riakcs/requests/usage/get_usage.rb +1 -1
  87. data/lib/fog/riakcs/usage.rb +0 -2
  88. data/lib/fog/vsphere/compute.rb +1 -0
  89. data/lib/fog/vsphere/models/compute/datastore.rb +1 -0
  90. data/lib/fog/vsphere/requests/compute/list_datastores.rb +9 -8
  91. data/lib/fog/vsphere/requests/compute/set_vm_customvalue.rb +19 -0
  92. data/lib/tasks/changelog_task.rb +0 -1
  93. data/tests/google/models/compute/disk_tests.rb +5 -0
  94. data/tests/google/models/compute/disks_tests.rb +5 -0
  95. data/tests/google/models/compute/server_tests.rb +3 -0
  96. data/tests/google/models/compute/servers_tests.rb +5 -0
  97. data/tests/google/requests/compute/disk_tests.rb +2 -1
  98. data/tests/google/requests/compute/firewall_tests.rb +1 -0
  99. data/tests/google/requests/compute/image_tests.rb +3 -0
  100. data/tests/google/requests/compute/network_tests.rb +1 -0
  101. data/tests/google/requests/compute/operation_tests.rb +1 -0
  102. data/tests/google/requests/compute/server_tests.rb +2 -3
  103. data/tests/google/requests/compute/zone_tests.rb +1 -6
  104. data/tests/helpers/mock_helper.rb +3 -4
  105. data/tests/rackspace/models/queues/message_tests.rb +16 -0
  106. data/tests/vsphere/requests/compute/set_vm_customvalue_tests.rb +21 -0
  107. metadata +29 -3
  108. data/lib/fog/hp/README_HP.rdoc +0 -61
@@ -15,7 +15,7 @@ module Fog
15
15
  end
16
16
 
17
17
  def get(identity)
18
- data = connection.get_zone(identity).body
18
+ data = service.get_zone(identity).body
19
19
  new(data)
20
20
  rescue Excon::Errors::NotFound
21
21
  nil
@@ -4,8 +4,25 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def delete_disk(disk_name)
8
- Fog::Mock.not_implemented
7
+ def delete_disk(disk_name, zone_name)
8
+ get_disk(disk_name, zone_name)
9
+ self.data[:disks].delete disk_name
10
+
11
+ build_response(:body => {
12
+ "kind" => "compute#operation",
13
+ "id" => "7145812689701515415",
14
+ "name" => "operation-1385125998242-4ebc3c7173e70-11e1ad0b",
15
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}",
16
+ "operationType" => "delete",
17
+ "targetLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/disks/#{disk_name}",
18
+ "targetId" => "6817095360746367667",
19
+ "status" => "PENDING",
20
+ "user" => "123456789012-qwertyuiopasdfghjkl1234567890qwe@developer.gserviceaccount.com",
21
+ "progress" => 0,
22
+ "insertTime" => Time.now.iso8601,
23
+ "startTime" => Time.now.iso8601,
24
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/operations/operation-1385125998242-4ebc3c7173e70-11e1ad0b"
25
+ })
9
26
  end
10
27
 
11
28
  end
@@ -32,16 +32,16 @@ module Fog
32
32
  "kind" => "compute#operation",
33
33
  "id" => "10035781241131638365",
34
34
  "name" => "operation-1380213292196-4e74bf2fbc3c1-ae707d47",
35
- "zone" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}",
35
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}",
36
36
  "operationType" => "delete",
37
- "targetLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/instances/#{server_name}",
37
+ "targetLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/instances/#{server_name}",
38
38
  "targetId" => "14544909043643897380",
39
39
  "status" => "PENDING",
40
40
  "user" => "123456789012-qwertyuiopasdfghjkl1234567890qwe@developer.gserviceaccount.com",
41
41
  "progress" => 0,
42
42
  "insertTime" => Time.now.iso8601,
43
43
  "startTime" => Time.now.iso8601,
44
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/operations/operation-1380213292196-4e74bf2fbc3c1-ae707d47"
44
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/operations/operation-1380213292196-4e74bf2fbc3c1-ae707d47"
45
45
  })
46
46
  end
47
47
 
@@ -4,8 +4,32 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def get_disk(disk_name)
8
- Fog::Mock.not_implemented
7
+ def get_disk(disk_name, zone_name)
8
+ disk = self.data[:disks][disk_name]
9
+ if zone_name.start_with? 'http'
10
+ zone_name = zone_name.split('/')[-1]
11
+ end
12
+ get_zone(zone_name)
13
+ zone = self.data[:zones][zone_name]
14
+ if disk.nil? or disk["zone"] != zone["selfLink"]
15
+ return build_response(:body => {
16
+ "error" => {
17
+ "errors" => [
18
+ {
19
+ "domain" => "global",
20
+ "reason" => "notFound",
21
+ "message" => "The resource 'projects/#{@project}/zones/#{zone_name}/disks/#{disk_name}' was not found"
22
+ }
23
+ ],
24
+ "code" => 404,
25
+ "message" => "The resource 'projects/#{@project}/zones/#{zone_name}/disks/#{disk_name}' was not found"
26
+ }
27
+ })
28
+ end
29
+
30
+ # TODO transition the disk through the states
31
+
32
+ build_response(:body => disk)
9
33
  end
10
34
 
11
35
  end
@@ -5,17 +5,17 @@ module Fog
5
5
  class Mock
6
6
 
7
7
  def get_image(image_name, project=@project)
8
- image = self.class.data[project][:images][image_name] || {
8
+ image = data(project)[:images][image_name] || {
9
9
  "error" => {
10
10
  "errors" => [
11
11
  {
12
12
  "domain" => "global",
13
13
  "reason" => "invalid",
14
- "message" => "Invalid value for field 'resource.images': 'https://www.googleapis.com/compute/v1beta15/projects/#{project}/global/images/#{image_name}'. Resource was not found."
14
+ "message" => "Invalid value for field 'resource.images': 'https://www.googleapis.com/compute/#{api_version}/projects/#{project}/global/images/#{image_name}'. Resource was not found."
15
15
  }
16
16
  ],
17
17
  "code" => 400,
18
- "message" => "Invalid value for field 'resource.images': 'https://www.googleapis.com/compute/v1beta15/projects/#{project}/global/images/#{image_name}'. Resource was not found."
18
+ "message" => "Invalid value for field 'resource.images': 'https://www.googleapis.com/compute/#{api_version}/projects/#{project}/global/images/#{image_name}'. Resource was not found."
19
19
  }
20
20
  }
21
21
  build_response(:body => image)
@@ -6,6 +6,7 @@ module Fog
6
6
 
7
7
  def get_server(server_name, zone_name)
8
8
  server = self.data[:servers][server_name]
9
+ get_zone(zone_name)
9
10
  zone = self.data[:zones][zone_name]
10
11
  if server.nil? or server["zone"] != zone["selfLink"]
11
12
  return build_response(:body => {
@@ -4,8 +4,43 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def insert_disk(disk_name)
8
- Fog::Mock.not_implemented
7
+ def insert_disk(disk_name, zone_name, image_name=nil, options={})
8
+ # check that image and zone exist
9
+ image_project = nil
10
+ unless image_name.nil?
11
+ ([ @project ] + Fog::Compute::Google::Images::GLOBAL_PROJECTS).each do |project|
12
+ image_project = project
13
+ break if data(project)[:images][options['image']]
14
+ end
15
+ get_image(image_name, image_project) # ok if image exists, will fail otherwise
16
+ end
17
+ get_zone(zone_name)
18
+
19
+ self.data[:disks][disk_name] = {
20
+ "kind" => "compute#disk",
21
+ "id" => Fog::Mock.random_numbers(19),
22
+ "creationTimestamp" => Time.now.iso8601,
23
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}",
24
+ "status" => "READY",
25
+ "name" => disk_name,
26
+ "sizeGb" => options['sizeGb'] || "10",
27
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/disks/#{disk_name}"
28
+ }
29
+
30
+ build_response(:body => {
31
+ "kind" => "compute#operation",
32
+ "id" => "12498846269172327286",
33
+ "name" => "operation-1385124218076-4ebc35cfbe9f1-476486c5",
34
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}",
35
+ "operationType" => "insert",
36
+ "targetLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/disks/#{disk_name}",
37
+ "status" => "PENDING",
38
+ "user" => "123456789012-qwertyuiopasdfghjkl1234567890qwe@developer.gserviceaccount.com",
39
+ "progress" => 0,
40
+ "insertTime" => Time.now.iso8601,
41
+ "startTime" => Time.now.iso8601,
42
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/operations/operation-1385124218076-4ebc35cfbe9f1-476486c5"
43
+ })
9
44
  end
10
45
 
11
46
  end
@@ -4,7 +4,8 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def insert_firewall(firewall_name)
7
+ def insert_firewall(firewall_name, source_range, allowed,
8
+ network=@default_network)
8
9
  Fog::Mock.not_implemented
9
10
  end
10
11
 
@@ -4,7 +4,7 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def insert_image(image_name)
7
+ def insert_image(image_name, options={})
8
8
  Fog::Mock.not_implemented
9
9
  end
10
10
 
@@ -2,7 +2,25 @@ module Fog
2
2
  module Compute
3
3
  class Google
4
4
 
5
+ module Shared
6
+ private
7
+
8
+ def handle_disks(options)
9
+ disks = []
10
+ options.delete('disks').each do |disk|
11
+ if disk.is_a? Disk
12
+ disks << disk.get_object
13
+ else
14
+ disks << disk
15
+ end
16
+ end
17
+ disks
18
+ end
19
+ end
20
+
5
21
  class Mock
22
+ include Shared
23
+
6
24
  def insert_server(server_name, zone_name, options={}, *deprecated_args)
7
25
 
8
26
  # check that image and zone exist
@@ -10,7 +28,7 @@ module Fog
10
28
  if options.has_key? 'image'
11
29
  ([ @project ] + Fog::Compute::Google::Images::GLOBAL_PROJECTS).each do |project|
12
30
  image_project = project
13
- break if self.class.data[project][:images][options['image']]
31
+ break if data(project)[:images][options['image']]
14
32
  end
15
33
  get_image(options['image'], image_project) # ok if image exists, will fail otherwise
16
34
  end
@@ -20,17 +38,17 @@ module Fog
20
38
  "kind" => "compute#instance",
21
39
  "id" => Fog::Mock.random_numbers(19),
22
40
  "creationTimestamp" => Time.now.iso8601,
23
- "zone" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}",
41
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}",
24
42
  "status" => "PROVISIONING",
25
43
  "name" => server_name,
26
44
  "tags" => { "fingerprint" => "42WmSpB8rSM=" },
27
- "machineType" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/machineTypes/#{options['machineType']}",
28
- "image" => "https://www.googleapis.com/compute/v1beta15/projects/centos-cloud/global/images/#{options['image']}",
29
- "kernel" => "https://www.googleapis.com/compute/v1beta15/projects/google/global/kernels/gce-v20130813",
45
+ "machineType" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/machineTypes/#{options['machineType']}",
46
+ "image" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/#{options['image']}",
47
+ "kernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
30
48
  "canIpForward" => false,
31
49
  "networkInterfaces" => [
32
50
  {
33
- "network" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/global/networks/default",
51
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/networks/default",
34
52
  "networkIP" => Fog::Mock.random_ip,
35
53
  "name" => "nic0",
36
54
  "accessConfigs" => [
@@ -43,7 +61,7 @@ module Fog
43
61
  ]
44
62
  }
45
63
  ],
46
- "disks" => [
64
+ "disks" => options['disks'] ? handle_disks(options) : [
47
65
  {
48
66
  "kind" => "compute#attachedDisk",
49
67
  "index" => 0,
@@ -61,28 +79,29 @@ module Fog
61
79
  }
62
80
  ]
63
81
  },
64
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/instances/#{server_name}"
82
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/instances/#{server_name}"
65
83
  }
66
84
 
67
85
  build_response(:body => {
68
86
  "kind" => "compute#operation",
69
87
  "id" => "4639689000254420481",
70
88
  "name" => "operation-1380213292196-4e74bf2fbc3c1-ae707d47",
71
- "zone" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}",
89
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}",
72
90
  "operationType" => "insert",
73
- "targetLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/instances/#{server_name}",
91
+ "targetLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/instances/#{server_name}",
74
92
  "status" => "PENDING",
75
93
  "user" => "123456789012-qwertyuiopasdfghjkl1234567890qwe@developer.gserviceaccount.com",
76
94
  "progress" => 0,
77
95
  "insertTime" => Time.now.iso8601,
78
96
  "startTime" => Time.now.iso8601,
79
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/operations/operation-1380213292196-4e74bf2fbc3c1-ae707d47"
97
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/operations/operation-1380213292196-4e74bf2fbc3c1-ae707d47"
80
98
  })
81
99
  end
82
100
 
83
101
  end
84
102
 
85
103
  class Real
104
+ include Shared
86
105
 
87
106
  def format_metadata(metadata)
88
107
  { "items" => metadata.map {|k,v| {"key" => k, "value" => v}} }
@@ -131,17 +150,7 @@ module Fog
131
150
  # TODO: add other networks
132
151
  body_object['networkInterfaces'] = networkInterfaces
133
152
 
134
- if options['disks']
135
- disks = []
136
- options.delete('disks').each do |disk|
137
- if disk.is_a? Disk
138
- disks << disk.get_object
139
- else
140
- disks << disk
141
- end
142
- end
143
- body_object['disks'] = disks
144
- end
153
+ body_object['disks'] = handle_disks(options) if options['disks']
145
154
 
146
155
  options['metadata'] = format_metadata options['metadata'] if options['metadata']
147
156
 
@@ -4,8 +4,14 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def list_disks
8
- Fog::Mock.not_implemented
7
+ def list_disks(zone_name)
8
+ disks = self.data[:disks].values.select{|d| d["zone"].split("/")[-1] == zone_name}
9
+ build_response(:body => {
10
+ "kind" => "compute#diskList",
11
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/disks",
12
+ "id" => "projects/#{@project}/zones/#{zone_name}/disks",
13
+ "items" => disks
14
+ })
9
15
  end
10
16
 
11
17
  end
@@ -5,10 +5,10 @@ module Fog
5
5
  class Mock
6
6
 
7
7
  def list_images(project=@project)
8
- images = self.class.data[project][:images].values
8
+ images = data(project)[:images].values
9
9
  build_response(:body => {
10
10
  "kind" => "compute#imageList",
11
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{project}/global/images",
11
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{project}/global/images",
12
12
  "id" => "projects/#{project}/global/images",
13
13
  "items" => images
14
14
  })
@@ -6,10 +6,10 @@ module Fog
6
6
 
7
7
  def list_machine_types(zone_name)
8
8
  get_zone(zone_name)
9
- machine_types = self.class.data[project][:machine_types][zone_name].values
9
+ machine_types = data[:machine_types][zone_name].values
10
10
  build_response(:body => {
11
11
  "kind" => "compute#machineTypeList",
12
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/machineTypes",
12
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/machineTypes",
13
13
  "id" => "projects/high-cistern-340/zones/us-central1-a/machineTypes",
14
14
  "items" => machine_types
15
15
  })
@@ -5,12 +5,12 @@ module Fog
5
5
  class Mock
6
6
 
7
7
  def list_servers(zone_name)
8
+ get_zone(zone_name)
8
9
  zone = self.data[:zones][zone_name]
9
- raise Fog::Errors::Error.new("Invalid value for field 'zone': '#{zone_name}'. Unknown zone.") if zone.nil?
10
10
  servers = self.data[:servers].values.select{|s| s["zone"] == zone["selfLink"]}
11
11
  build_response(:body => {
12
12
  "kind" => "compute#instanceList",
13
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones/#{zone_name}/instances",
13
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone_name}/instances",
14
14
  "id" => "projects/#{@project}/zones/#{zone_name}/instances",
15
15
  "items" => servers
16
16
  })
@@ -4,7 +4,7 @@ module Fog
4
4
 
5
5
  class Mock
6
6
 
7
- def list_zone_operations
7
+ def list_zone_operations(zone)
8
8
  Fog::Mock.not_implemented
9
9
  end
10
10
 
@@ -8,7 +8,7 @@ module Fog
8
8
  zones = self.data[:zones].values
9
9
  build_response(:body => {
10
10
  "kind" => "compute#zoneList",
11
- "selfLink" => "https://www.googleapis.com/compute/v1beta15/projects/#{@project}/zones",
11
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones",
12
12
  "id" => "projects/#{@project}/zones",
13
13
  "items" => zones
14
14
  })
data/lib/fog/hp.rb CHANGED
@@ -26,7 +26,7 @@ module Fog
26
26
  if message.nil? and !data.values.first.nil?
27
27
  message = data.values.first['message']
28
28
  end
29
- rescue MultiJson::DecodeError
29
+ rescue Fog::JSON::DecodeError
30
30
  message = error.response.body #### body is not in JSON format, so just return as is
31
31
  end
32
32
  end
@@ -0,0 +1,57 @@
1
+ # Getting Started with HP Cloud Extensions to Ruby Fog Bindings
2
+
3
+ [HP Cloud](http://www.hpcloud.com) has been creating and contributing bindings so
4
+ that developers can work with Ruby Fog and the HP Cloud services based on
5
+ [OpenStack](http://www.openstack.org/). By using the HP Cloud Extensions to Fog,
6
+ developers can write applications using Ruby that interacts with the
7
+ HP Cloud Services without having to deal with the underlying REST API or
8
+ JSON/XML document formats. We have officially turned these bindings over to the
9
+ Ruby Fog community where you can contribute and develop additional functionality
10
+ around these bindings.
11
+
12
+ This section of documentation provides information, examples and articles for working with the different HP Cloud services such as Compute, Object Storage and others.
13
+
14
+ Please note that HP Cloud recently released version 13.5 which updates and adds functionality provided by OpenStack Havana. Some of our HP Ruby Fog examples are developed to work with earlier versions so please take note which HP Cloud version you are working with.
15
+
16
+ **Note:** The Networking service examples only work with version 13.5.
17
+
18
+ ## Installation
19
+
20
+ To install and use HP Cloud Ruby bindings for Fog, please install the [latest release](http://fog.io/) of Fog.
21
+
22
+ Then follow the installation instructions for the operating system you are using and connect to the service:
23
+
24
+ * [Installation Instructions](https://github.com/fog/fog/blob/master/lib/fog/hp/docs/install.md)
25
+ * [Connecting to the Service](https://github.com/fog/fog/blob/master/lib/fog/hp/docs/connect.md)
26
+
27
+ ## Requirements
28
+
29
+ For working with the HP Cloud Extension to Fog, the following pre-requisites are needed:
30
+
31
+ * HP Cloud Services account. If you have not already signed up, please [sign up for your free trial](http://www.hpcloud.com/free-trial).
32
+ * Ruby version 1.8.x or 1.9.x
33
+ * `fog` gem
34
+
35
+
36
+ ## Examples
37
+
38
+ Apart from the overall [Fog documentation](http://fog.io), we have HP Cloud specific examples that will help you in using the Ruby Fog bindings with HP Cloud services.
39
+
40
+ [Examples for using Fog with HP Cloud Services](https://github.com/fog/fog/blob/master/lib/fog/hp/examples/getting_started_examples.md)
41
+
42
+ ## Articles
43
+
44
+ In addition to the examples we have provided, for Compute, Object Storage, and other HP Cloud services, we wanted to give you a few additional tips and "how-tos' to make using your Ruby Fog bindings even easier. Take a look at the articles listed below to find out more!
45
+
46
+ * [Using authentication caching](https://github.com/fog/fog/blob/master/lib/fog/hp/articles/auth_caching.md)
47
+
48
+ ## Additional Resources
49
+ * [Fog cloud library](http://fog.io)
50
+ * [Fog documentation](http://rubydoc.info/gems/fog)
51
+ * [Fog Github repo](https://github.com/fog/fog)
52
+ * [Fog Release Notes](https://github.com/fog/fog/blob/master/changelog.txt)
53
+
54
+ ## Support and Feedback
55
+
56
+ Your feedback is essential to the maturity of the bindings and is highly appreciated! If you have specific issues with the HP Cloud Extensions to Fog bindings, please file an [issue via Github](https://github.com/fog/fog/issues).
57
+