fog-google 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +7 -3
  4. data/examples/pubsub/subscriptions.rb +54 -0
  5. data/examples/pubsub/topics.rb +33 -0
  6. data/fog-google.gemspec +2 -2
  7. data/lib/fog/compute/google.rb +4 -884
  8. data/lib/fog/compute/google/mock.rb +871 -0
  9. data/lib/fog/compute/google/real.rb +22 -0
  10. data/lib/fog/dns/google.rb +3 -42
  11. data/lib/fog/dns/google/mock.rb +33 -0
  12. data/lib/fog/dns/google/real.rb +19 -0
  13. data/lib/fog/google.rb +14 -208
  14. data/lib/fog/google/mock.rb +14 -0
  15. data/lib/fog/google/models/pubsub/received_message.rb +40 -0
  16. data/lib/fog/google/models/pubsub/subscription.rb +86 -0
  17. data/lib/fog/google/models/pubsub/subscriptions.rb +32 -0
  18. data/lib/fog/google/models/pubsub/topic.rb +72 -0
  19. data/lib/fog/google/models/pubsub/topics.rb +31 -0
  20. data/lib/fog/google/monitoring.rb +3 -45
  21. data/lib/fog/google/monitoring/mock.rb +35 -0
  22. data/lib/fog/google/monitoring/real.rb +20 -0
  23. data/lib/fog/google/pubsub.rb +59 -0
  24. data/lib/fog/google/pubsub/mock.rb +34 -0
  25. data/lib/fog/google/pubsub/real.rb +20 -0
  26. data/lib/fog/google/requests/pubsub/acknowledge_subscription.rb +46 -0
  27. data/lib/fog/google/requests/pubsub/create_subscription.rb +57 -0
  28. data/lib/fog/google/requests/pubsub/create_topic.rb +36 -0
  29. data/lib/fog/google/requests/pubsub/delete_subscription.rb +28 -0
  30. data/lib/fog/google/requests/pubsub/delete_topic.rb +29 -0
  31. data/lib/fog/google/requests/pubsub/get_subscription.rb +44 -0
  32. data/lib/fog/google/requests/pubsub/get_topic.rb +41 -0
  33. data/lib/fog/google/requests/pubsub/list_subscriptions.rb +39 -0
  34. data/lib/fog/google/requests/pubsub/list_topics.rb +33 -0
  35. data/lib/fog/google/requests/pubsub/publish_topic.rb +61 -0
  36. data/lib/fog/google/requests/pubsub/pull_subscription.rb +77 -0
  37. data/lib/fog/google/shared.rb +191 -0
  38. data/lib/fog/google/sql.rb +3 -50
  39. data/lib/fog/google/sql/mock.rb +40 -0
  40. data/lib/fog/google/sql/real.rb +20 -0
  41. data/lib/fog/google/version.rb +1 -1
  42. data/lib/fog/storage/google_json.rb +4 -99
  43. data/lib/fog/storage/google_json/mock.rb +18 -0
  44. data/lib/fog/storage/google_json/real.rb +64 -0
  45. data/lib/fog/storage/google_json/utils.rb +32 -0
  46. data/lib/fog/storage/google_xml.rb +4 -260
  47. data/lib/fog/storage/google_xml/mock.rb +102 -0
  48. data/lib/fog/storage/google_xml/models/file.rb +14 -4
  49. data/lib/fog/storage/google_xml/real.rb +106 -0
  50. data/lib/fog/storage/google_xml/utils.rb +66 -0
  51. data/tests/models/pubsub/received_message_tests.rb +18 -0
  52. data/tests/models/pubsub/subscription_tests.rb +26 -0
  53. data/tests/models/pubsub/subscriptions_tests.rb +33 -0
  54. data/tests/models/pubsub/topic_tests.rb +18 -0
  55. data/tests/models/pubsub/topics_tests.rb +27 -0
  56. metadata +50 -14
@@ -0,0 +1,871 @@
1
+ module Fog
2
+ module Compute
3
+ class Google
4
+ class Mock
5
+ include Fog::Google::Shared
6
+ attr_reader :extra_global_projects
7
+
8
+ def initialize(options)
9
+ shared_initialize(options[:google_project], GOOGLE_COMPUTE_API_VERSION, GOOGLE_COMPUTE_BASE_URL)
10
+ @extra_global_projects = options.fetch(:google_extra_global_projects, [])
11
+ end
12
+
13
+ def self.data(api_version)
14
+ @data ||= Hash.new do |hash, key|
15
+ hash[key] =
16
+ case key
17
+ when "debian-cloud"
18
+ {
19
+ :images => {
20
+ "debian-6-squeeze-v20130816" => {
21
+ "kind" => "compute#image",
22
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-6-squeeze-v20130816",
23
+ "id" => "14841592146580482051",
24
+ "creationTimestamp" => "2013-09-04T13:21:53.292-07:00",
25
+ "name" => "debian-6-squeeze-v20130816",
26
+ "description" => "Debian GNU/Linux 6.0.7 (squeeze) built on 2013-08-16",
27
+ "sourceType" => "RAW",
28
+ "rawDisk" => {
29
+ "containerType" => "TAR",
30
+ "source" => ""
31
+ },
32
+ "status" => "READY"
33
+ },
34
+ "debian-7-wheezy-v20130816" => {
35
+ "kind" => "compute#image",
36
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20130816",
37
+ "id" => "4213305957435180899",
38
+ "creationTimestamp" => "2013-09-04T13:24:30.479-07:00",
39
+ "name" => "debian-7-wheezy-v20130816",
40
+ "description" => "Debian GNU/Linux 7.1 (wheezy) built on 2013-08-16",
41
+ "sourceType" => "RAW",
42
+ "rawDisk" => {
43
+ "containerType" => "TAR",
44
+ "source" => ""
45
+ },
46
+ "status" => "READY"
47
+ },
48
+ "debian-7-wheezy-v20131014" => {
49
+ "kind" => "compute#image",
50
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20131014",
51
+ "id" => "4213305957435180899",
52
+ "creationTimestamp" => "2013-09-04T13:24:30.479-07:00",
53
+ "name" => "debian-7-wheezy-v20131014",
54
+ "description" => "Debian GNU/Linux 7.1 (wheezy) built on 2013-10-14",
55
+ "sourceType" => "RAW",
56
+ "rawDisk" => {
57
+ "containerType" => "TAR",
58
+ "source" => ""
59
+ },
60
+ "status" => "READY"
61
+ },
62
+ "debian-7-wheezy-v20140408" => {
63
+ "kind" => "compute#image",
64
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20140408",
65
+ "id" => "17312518942796567788",
66
+ "creationTimestamp" => "2013-11-25T15:17:00.436-08:00",
67
+ "name" => "debian-7-wheezy-v20131120",
68
+ "description" => "Debian GNU/Linux 7.2 (wheezy) built on 2013-11-20",
69
+ "sourceType" => "RAW",
70
+ "rawDisk" => {
71
+ "containerType" => "TAR",
72
+ "source" => ""
73
+ },
74
+ "status" => "READY",
75
+ "archiveSizeBytes" => "341857472"
76
+ }
77
+ }
78
+ }
79
+ when "centos-cloud"
80
+ {
81
+ :images => {
82
+ "centos-6-v20130813" => {
83
+ "kind" => "compute#image",
84
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/centos-6-v20130813",
85
+ "id" => "4670523370938782739",
86
+ "creationTimestamp" => "2013-08-19T11:56:47.004-07:00",
87
+ "name" => "centos-6-v20130813",
88
+ "description" => "SCSI-enabled CentOS 6; Created Tue, 13 Aug 2013 00:00:00 +0000",
89
+ "sourceType" => "RAW",
90
+ "rawDisk" => {
91
+ "containerType" => "TAR",
92
+ "source" => ""
93
+ },
94
+ "status" => "READY"
95
+ }
96
+ }
97
+ }
98
+ else
99
+ {
100
+ :target_http_proxies => {
101
+ "test-target-http-proxy" => {
102
+ "kind" => "compute#targetHttpProxy",
103
+ "id" => "1361932147851415729",
104
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
105
+ "name" => "test-target-http-proxy",
106
+ "description" => "",
107
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/targetHttpProxies/test-target-http-proxy",
108
+ "urlMap" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/urlMaps/test-url-map"
109
+ }
110
+ },
111
+ :url_maps => {
112
+ "test-url-map" => {
113
+ "kind" => "compute#urlMap",
114
+ "id" => "1361932147851415729",
115
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
116
+ "name" => "test-url-map",
117
+ "description" => "",
118
+ "hostRules" => [],
119
+ "pathMatchers" => [],
120
+ "tests" => [],
121
+ "defaultService" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/backendServices/fog-backend-service-test",
122
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/urlMaps/test-url-map"
123
+ }
124
+ },
125
+ :target_pools => {
126
+ "test-target-pool" => {
127
+ "kind" => "compute#targetPool",
128
+ "id" => "1361932147851415729",
129
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1/targetPools/test-target-pool",
130
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
131
+ "name" => "test-target-pool",
132
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1",
133
+ "healthChecks" => ["https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/httpHealthChecks/test-check"],
134
+ "instances" => ["https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a/instances/test-instance"]
135
+ }
136
+ },
137
+
138
+ :http_health_checks => {
139
+ "test-http-health-check" => {
140
+ "checkIntervalSec" => 5,
141
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
142
+ "healthyThreshold" => 2,
143
+ "id" => "1361932147851415729",
144
+ "kind" => "compute#httphealthCheck",
145
+ "name" => "test-http-health-check",
146
+ "port" => 80,
147
+ "requestPath" => "/",
148
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/httpHealthChecks/test-http-health-check",
149
+ "timeoutSec" => 5,
150
+ "unhealthyThreshold" => 2
151
+ }
152
+ },
153
+ :global_forwarding_rules => {
154
+ "test-global-forwarding-rule" => {
155
+ "kind" => "compute#forwardingRule",
156
+ "id" => "1361932147851415729",
157
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
158
+ "name" => "test-global-forwarding-rule",
159
+ "IPAddress" => "107.178.255.155",
160
+ "IPProtocol" => "TCP",
161
+ "portRange" => "80-80",
162
+ "target" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/targetHttpProxies/proxy",
163
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/forwardngRules/test-global-forwarding-rule"
164
+ }
165
+ },
166
+ :forwarding_rules => {
167
+ "test-forwarding-rule" => {
168
+ "kind" => "compute#forwardingRule",
169
+ "id" => "1361932147851415729",
170
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
171
+ "name" => "test-forwarding-rule",
172
+ "IPAddress" => "107.178.255.155",
173
+ "IPProtocol" => "TCP",
174
+ "portRange" => "80-80",
175
+ "target" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1/targetPools/target_pool",
176
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1/forwardngRules/test-forwarding-rule",
177
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/regions/us-central1"
178
+ }
179
+ },
180
+ :target_instances => {
181
+ "test-target-instance" => {
182
+ "kind" => "compute#targetInstance",
183
+ "name" => "test-target-instance",
184
+ "natPolicy" => "NO_NAT",
185
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a",
186
+ "instance" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a/instances/test-instance",
187
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/us-central1-a/targetInstances/test-target-instance",
188
+ "id" => "1361932147851415729",
189
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00"
190
+
191
+ }
192
+ },
193
+ :backend_services => {
194
+ "test-backend-service" => {
195
+ "kind" => "compute#backend_service",
196
+ "id" => "1361932147851415729",
197
+ "creationTimestamp" => "2014-08-23T10:06:13.951-07:00",
198
+ "name" => "test-backend-service",
199
+ "description" => "",
200
+ "backends" => [
201
+ {
202
+ "description" => "",
203
+ "group" => "https://www.googleapis.com/resourceviews/v1beta1/projects#{@project}/zones/us-central1-a/zoneViews/name",
204
+ "balancingMode" => "RATE",
205
+ "capacityScaler" => 1.1,
206
+ "maxRate" => 0.5
207
+ }],
208
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/global/backendServices/test-backend-service"
209
+ }
210
+ },
211
+ :servers => {
212
+ "fog-1" => {
213
+ "kind" => "compute#instance",
214
+ "id" => "1361932147851415727",
215
+ "creationTimestamp" => "2013-09-26T04:55:43.881-07:00",
216
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
217
+ "status" => "RUNNING",
218
+ "name" => "fog-1380196541",
219
+ "tags" => { "fingerprint" => "42WmSpB8rSM=" },
220
+ "machineType" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/machineTypes/n1-standard-1",
221
+ "canIpForward" => false,
222
+ "networkInterfaces" => [
223
+ {
224
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/default",
225
+ "networkIP" => "10.240.121.54",
226
+ "name" => "nic0",
227
+ "accessConfigs" => [
228
+ {
229
+ "kind" => "compute#accessConfig",
230
+ "type" => "ONE_TO_ONE_NAT",
231
+ "name" => "External NAT",
232
+ "natIP" => "108.59.81.28"
233
+ }
234
+ ]
235
+ }
236
+ ],
237
+ "disks" => [
238
+ {
239
+ "kind" => "compute#attachedDisk",
240
+ "index" => 0,
241
+ "type" => "PERSISTENT",
242
+ "mode" => "READ_WRITE",
243
+ "source" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/disks/fog-1",
244
+ "deviceName" => "persistent-disk-0",
245
+ "boot" => true
246
+ }
247
+ ],
248
+ "metadata" => {
249
+ "kind" => "compute#metadata",
250
+ "fingerprint" => "5_hasd_gC3E=",
251
+ "items" => [
252
+ {
253
+ "key" => "sshKeys",
254
+ "value" => "sysadmin:ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA1zc7mx+0H8Roywet/L0aVX6MUdkDfzd/17kZhprAbpUXYOILv9AG4lIzQk6xGxDIltghytjfVGme/4A42Sb0Z9LN0pxB4KnWTNoOSHPJtp6jbXpq6PdN9r3Z5NKQg0A/Tfw7gt2N0GDsj6vpK8VbHHdW78JAVUxql18ootJxjaksdocsiHNK8iA6/v9qiLRhX3fOgtK7KpxxdZxLRzFg9vkp8jcGISgpZt27kOgXWhR5YLhi8pRJookzphO5O4yhflgoHoAE65XkfrsRCe0HU5QTbY2jH88rBVkq0KVlZh/lEsuwfmG4d77kEqaCGGro+j1Wrvo2K3DSQ+rEcvPp2CYRUySjhaeLF18UzQLtxNeoN14QOYqlm9ITdkCnmq5w4Wn007MjSOFp8LEq2RekrnddGXjg1/vgmXtaVSGzJAlXwtVfZor3dTRmF0JCpr7DsiupBaDFtLUlGFFlSKmPDVMPOOB5wajexmcvSp2Vu4U3yP8Lai/9/ZxMdsGPhpdCsWVL83B5tF4oYj1HVIycbYIxIIfFqOxZcCru3CMfe9jmzKgKLv2UtkfOS8jpS/Os2gAiB3wPweH3agvtwYAYBVMDwt5cnrhgHYWoOz7ABD8KgmCrD7Y9HikiCqIUNkgUFd9YmjcYi5FkU5rFXIawN7efs341lsdf923lsdf923fs= johndoe@acme"
255
+ }
256
+ ]
257
+ },
258
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/instances/fog-1380196541"
259
+ }
260
+ },
261
+ :zones => {
262
+ "europe-west1-a" => {
263
+ "kind" => "compute#zone",
264
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-a",
265
+ "id" => "10419676573632995924",
266
+ "creationTimestamp" => "2013-09-26T02:56:13.115-07:00",
267
+ "name" => "europe-west1-a",
268
+ "description" => "europe-west1-a",
269
+ "status" => "UP",
270
+ "maintenanceWindows" => [
271
+ {
272
+ "name" => "2014-01-18-planned-outage",
273
+ "description" => "maintenance zone",
274
+ "beginTime" => "2014-01-18T12:00:00.000-08:00",
275
+ "endTime" => "2014-02-02T12:00:00.000-08:00"
276
+ }
277
+ ],
278
+ "quotas" => [
279
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 0.0 },
280
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
281
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
282
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
283
+ ],
284
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1"
285
+ },
286
+ "us-central1-a" => {
287
+ "kind" => "compute#zone",
288
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
289
+ "id" => "6562457277909136262",
290
+ "creationTimestamp" => "2013-09-26T02:56:13.116-07:00",
291
+ "name" => "us-central1-a",
292
+ "description" => "us-central1-a",
293
+ "status" => "UP",
294
+ "maintenanceWindows" => nil,
295
+ "quotas" => [
296
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 1.0 },
297
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 1.0 },
298
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
299
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
300
+ ],
301
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1"
302
+ },
303
+ "us-central1-b" => {
304
+ "kind" => "compute#zone",
305
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-b",
306
+ "id" => "8701502109626061015",
307
+ "creationTimestamp" => "2013-09-26T02:56:13.124-07:00",
308
+ "name" => "us-central1-b",
309
+ "description" => "us-central1-b",
310
+ "status" => "UP",
311
+ "maintenanceWindows" => [{ "name" => "2013-10-26-planned-outage",
312
+ "description" => "maintenance zone",
313
+ "beginTime" => "2013-10-26T12:00:00.000-07:00",
314
+ "endTime" => "2013-11-10T12:00:00.000-08:00" }],
315
+ "quotas" => [
316
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 0.0 },
317
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
318
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
319
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
320
+ ],
321
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1"
322
+ },
323
+ "us-central2-a" => {
324
+ "kind" => "compute#zone",
325
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central2-a",
326
+ "id" => "13611654493253680292",
327
+ "creationTimestamp" => "2013-09-26T02:56:13.125-07:00",
328
+ "name" => "us-central2-a",
329
+ "description" => "us-central2-a",
330
+ "status" => "UP",
331
+ "maintenanceWindows" => [
332
+ {
333
+ "name" => "2013-10-12-planned-outage",
334
+ "description" => "maintenance zone",
335
+ "beginTime" => "2013-10-12T12:00:00.000-07:00",
336
+ "endTime" => "2013-10-27T12:00:00.000-07:00"
337
+ }
338
+ ],
339
+ "quotas" => [
340
+ { "metric" => "INSTANCES", "limit" => 16.0, "usage" => 0.0 },
341
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
342
+ { "metric" => "DISKS", "limit" => 16.0, "usage" => 0.0 },
343
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 }
344
+ ],
345
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central2"
346
+ }
347
+ },
348
+ :regions => {
349
+ "us-central1" => {
350
+ "creationTimestamp" => "2014-01-21T10:30:54.895-08:00",
351
+ "description" => "us-central1",
352
+ "id" => "18201118976141502843",
353
+ "kind" => "compute#region",
354
+ "name" => "us-central1",
355
+ "quotas" => [
356
+ { "metric" => "CPUS", "limit" => 1050.0, "usage" => 28.0 },
357
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 10_000.0, "usage" => 292.0 },
358
+ { "metric" => "STATIC_ADDRESSES", "limit" => 10.0, "usage" => 0.0 },
359
+ { "metric" => "IN_USE_ADDRESSES", "limit" => 1050.0, "usage" => 30.0 },
360
+ { "metric" => "SSD_TOTAL_GB", "limit" => 1024.0, "usage" => 0.0 }
361
+ ],
362
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1",
363
+ "status" => "UP",
364
+ "zones" => [
365
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
366
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-b",
367
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-f"
368
+ ]
369
+ },
370
+ "europe-west1" => {
371
+ "creationTimestamp" => "2014-01-21T10:30:54.891-08:00",
372
+ "description" => "europe-west1",
373
+ "id" => "18201118976141502843",
374
+ "kind" => "compute#region",
375
+ "name" => "europe-west1",
376
+ "quotas" => [
377
+ { "metric" => "CPUS", "limit" => 24.0, "usage" => 0.0 },
378
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 2048.0, "usage" => 0.0 },
379
+ { "metric" => "STATIC_ADDRESSES", "limit" => 7.0, "usage" => 0.0 },
380
+ { "metric" => "IN_USE_ADDRESSES", "limit" => 23.0, "usage" => 0.0 },
381
+ { "metric" => "SSD_TOTAL_GB", "limit" => 1024.0, "usage" => 0.0 }
382
+ ],
383
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/erope-west1",
384
+ "status" => "UP",
385
+ "zones" => [
386
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-a",
387
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/europe-west1-b"
388
+ ]
389
+ },
390
+ "asia-east1" => {
391
+ "creationTimestamp" => "2014-01-21T10:30:54.895-08:00",
392
+ "description" => "asia-east1",
393
+ "id" => "18201118976141502843",
394
+ "kind" => "compute#region",
395
+ "name" => "asia-east1",
396
+ "quotas" => [
397
+ { "metric" => "CPUS", "limit" => 1050.0, "usage" => 28.0 },
398
+ { "metric" => "DISKS_TOTAL_GB", "limit" => 10_000.0, "usage" => 292.0 },
399
+ { "metric" => "STATIC_ADDRESSES", "limit" => 10.0, "usage" => 0.0 },
400
+ { "metric" => "IN_USE_ADDRESSES", "limit" => 1050.0, "usage" => 30.0 },
401
+ { "metric" => "SSD_TOTAL_GB", "limit" => 1024.0, "usage" => 0.0 }
402
+ ],
403
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/asia-east1",
404
+ "status" => "UP",
405
+ "zones" => [
406
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/asia-east1-a",
407
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/asia-east1-b",
408
+ "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/asia-east1-c"
409
+ ]
410
+ }
411
+ },
412
+
413
+ :machine_types => Hash.new do |machine_types_hash, zone|
414
+ machine_types_hash[zone] = {
415
+ "f1-micro" => {
416
+ "kind" => "compute#machineType",
417
+ "id" => "4618642685664990776",
418
+ "creationTimestamp" => "2013-04-25T13:32:49.088-07:00",
419
+ "name" => "f1-micro",
420
+ "description" => "1 vCPU (shared physical core) and 0.6 GB RAM",
421
+ "guestCpus" => 1,
422
+ "memoryMb" => 614,
423
+ "imageSpaceGb" => 0,
424
+ "maximumPersistentDisks" => 4,
425
+ "maximumPersistentDisksSizeGb" => "3072",
426
+ "zone" => zone,
427
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/f1-micro"
428
+ },
429
+ "g1-small" => {
430
+ "kind" => "compute#machineType",
431
+ "id" => "7224129552184485774",
432
+ "creationTimestamp" => "2013-04-25T13:32:45.550-07:00",
433
+ "name" => "g1-small",
434
+ "description" => "1 vCPU (shared physical core) and 1.7 GB RAM",
435
+ "guestCpus" => 1,
436
+ "memoryMb" => 1740,
437
+ "imageSpaceGb" => 0,
438
+ "maximumPersistentDisks" => 4,
439
+ "maximumPersistentDisksSizeGb" => "3072",
440
+ "zone" => zone,
441
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/g1-small"
442
+ },
443
+ "n1-highcpu-2" => {
444
+ "kind" => "compute#machineType",
445
+ "id" => "13043554592196512955",
446
+ "creationTimestamp" => "2012-11-16T11:46:10.572-08:00",
447
+ "name" => "n1-highcpu-2",
448
+ "description" => "2 vCPUs, 1.8 GB RAM",
449
+ "guestCpus" => 2,
450
+ "memoryMb" => 1843,
451
+ "imageSpaceGb" => 10,
452
+ "maximumPersistentDisks" => 16,
453
+ "maximumPersistentDisksSizeGb" => "10240",
454
+ "zone" => zone,
455
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-2"
456
+ },
457
+ "n1-highcpu-2-d" => {
458
+ "kind" => "compute#machineType",
459
+ "id" => "13043555176034896271",
460
+ "creationTimestamp" => "2012-11-16T11:47:07.825-08:00",
461
+ "name" => "n1-highcpu-2-d",
462
+ "description" => "2 vCPUs, 1.8 GB RAM, 1 scratch disk (870 GB)",
463
+ "guestCpus" => 2,
464
+ "memoryMb" => 1843,
465
+ "imageSpaceGb" => 10,
466
+ "scratchDisks" => [
467
+ {
468
+ "diskGb" => 870
469
+ }
470
+ ],
471
+ "maximumPersistentDisks" => 16,
472
+ "maximumPersistentDisksSizeGb" => "10240",
473
+ "zone" => zone,
474
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-2-d"
475
+ },
476
+ "n1-highcpu-4" => {
477
+ "kind" => "compute#machineType",
478
+ "id" => "13043555705736970382",
479
+ "creationTimestamp" => "2012-11-16T11:48:06.087-08:00",
480
+ "name" => "n1-highcpu-4",
481
+ "description" => "4 vCPUs, 3.6 GB RAM",
482
+ "guestCpus" => 4,
483
+ "memoryMb" => 3686,
484
+ "imageSpaceGb" => 10,
485
+ "maximumPersistentDisks" => 16,
486
+ "maximumPersistentDisksSizeGb" => "10240",
487
+ "zone" => zone,
488
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-4"
489
+ },
490
+ "n1-highcpu-4-d" => {
491
+ "kind" => "compute#machineType",
492
+ "id" => "13043556330284250611",
493
+ "creationTimestamp" => "2012-11-16T11:49:07.563-08:00",
494
+ "name" => "n1-highcpu-4-d",
495
+ "description" => "4 vCPUS, 3.6 GB RAM, 1 scratch disk (1770 GB)",
496
+ "guestCpus" => 4,
497
+ "memoryMb" => 3686,
498
+ "imageSpaceGb" => 10,
499
+ "scratchDisks" => [
500
+ {
501
+ "diskGb" => 1770
502
+ }
503
+ ],
504
+ "maximumPersistentDisks" => 16,
505
+ "maximumPersistentDisksSizeGb" => "10240",
506
+ "zone" => zone,
507
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-4-d"
508
+ },
509
+ "n1-highcpu-8" => {
510
+ "kind" => "compute#machineType",
511
+ "id" => "13043556949665240937",
512
+ "creationTimestamp" => "2012-11-16T11:50:15.128-08:00",
513
+ "name" => "n1-highcpu-8",
514
+ "description" => "8 vCPUs, 7.2 GB RAM",
515
+ "guestCpus" => 8,
516
+ "memoryMb" => 7373,
517
+ "imageSpaceGb" => 10,
518
+ "maximumPersistentDisks" => 16,
519
+ "maximumPersistentDisksSizeGb" => "10240",
520
+ "zone" => zone,
521
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-8"
522
+ },
523
+ "n1-highcpu-8-d" => {
524
+ "kind" => "compute#machineType",
525
+ "id" => "13043557458004959701",
526
+ "creationTimestamp" => "2012-11-16T11:51:04.549-08:00",
527
+ "name" => "n1-highcpu-8-d",
528
+ "description" => "8 vCPUS, 7.2 GB RAM, 2 scratch disks (1770 GB, 1770 GB)",
529
+ "guestCpus" => 8,
530
+ "memoryMb" => 7373,
531
+ "imageSpaceGb" => 10,
532
+ "scratchDisks" => [
533
+ {
534
+ "diskGb" => 1770
535
+ },
536
+ {
537
+ "diskGb" => 1770
538
+ }
539
+ ],
540
+ "maximumPersistentDisks" => 16,
541
+ "maximumPersistentDisksSizeGb" => "10240",
542
+ "zone" => zone,
543
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highcpu-8-d"
544
+ },
545
+ "n1-highmem-2" => {
546
+ "kind" => "compute#machineType",
547
+ "id" => "13043551079318055993",
548
+ "creationTimestamp" => "2012-11-16T11:40:06.129-08:00",
549
+ "name" => "n1-highmem-2",
550
+ "description" => "2 vCPUs, 13 GB RAM",
551
+ "guestCpus" => 2,
552
+ "memoryMb" => 13_312,
553
+ "imageSpaceGb" => 10,
554
+ "maximumPersistentDisks" => 16,
555
+ "maximumPersistentDisksSizeGb" => "10240",
556
+ "zone" => zone,
557
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-2"
558
+ },
559
+ "n1-highmem-2-d" => {
560
+ "kind" => "compute#machineType",
561
+ "id" => "13043551625558644085",
562
+ "creationTimestamp" => "2012-11-16T11:40:59.630-08:00",
563
+ "name" => "n1-highmem-2-d",
564
+ "description" => "2 vCPUs, 13 GB RAM, 1 scratch disk (870 GB)",
565
+ "guestCpus" => 2,
566
+ "memoryMb" => 13_312,
567
+ "imageSpaceGb" => 10,
568
+ "scratchDisks" => [
569
+ {
570
+ "diskGb" => 870
571
+ }
572
+ ],
573
+ "maximumPersistentDisks" => 16,
574
+ "maximumPersistentDisksSizeGb" => "10240",
575
+ "zone" => zone,
576
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-2-d"
577
+ },
578
+ "n1-highmem-4" => {
579
+ "kind" => "compute#machineType",
580
+ "id" => "13043552263604939569",
581
+ "creationTimestamp" => "2012-11-16T11:42:08.983-08:00",
582
+ "name" => "n1-highmem-4",
583
+ "description" => "4 vCPUs, 26 GB RAM",
584
+ "guestCpus" => 4,
585
+ "memoryMb" => 26_624,
586
+ "imageSpaceGb" => 10,
587
+ "maximumPersistentDisks" => 16,
588
+ "maximumPersistentDisksSizeGb" => "10240",
589
+ "zone" => zone,
590
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-4"
591
+ },
592
+ "n1-highmem-4-d" => {
593
+ "kind" => "compute#machineType",
594
+ "id" => "13043552953632709737",
595
+ "creationTimestamp" => "2012-11-16T11:43:17.400-08:00",
596
+ "name" => "n1-highmem-4-d",
597
+ "description" => "4 vCPUs, 26 GB RAM, 1 scratch disk (1770 GB)",
598
+ "guestCpus" => 4,
599
+ "memoryMb" => 26_624,
600
+ "imageSpaceGb" => 10,
601
+ "scratchDisks" => [
602
+ {
603
+ "diskGb" => 1770
604
+ }
605
+ ],
606
+ "maximumPersistentDisks" => 16,
607
+ "maximumPersistentDisksSizeGb" => "10240",
608
+ "zone" => zone,
609
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-4-d"
610
+ },
611
+ "n1-highmem-8" => {
612
+ "kind" => "compute#machineType",
613
+ "id" => "13043553584275586275",
614
+ "creationTimestamp" => "2012-11-16T11:44:25.985-08:00",
615
+ "name" => "n1-highmem-8",
616
+ "description" => "8 vCPUs, 52 GB RAM",
617
+ "guestCpus" => 8,
618
+ "memoryMb" => 53_248,
619
+ "imageSpaceGb" => 10,
620
+ "maximumPersistentDisks" => 16,
621
+ "maximumPersistentDisksSizeGb" => "10240",
622
+ "zone" => zone,
623
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-8"
624
+ },
625
+ "n1-highmem-8-d" => {
626
+ "kind" => "compute#machineType",
627
+ "id" => "13043554021673472746",
628
+ "creationTimestamp" => "2012-11-16T11:45:08.195-08:00",
629
+ "name" => "n1-highmem-8-d",
630
+ "description" => "8 vCPUs, 52 GB RAM, 2 scratch disks (1770 GB, 1770 GB)",
631
+ "guestCpus" => 8,
632
+ "memoryMb" => 53_248,
633
+ "imageSpaceGb" => 10,
634
+ "scratchDisks" => [
635
+ {
636
+ "diskGb" => 1770
637
+ },
638
+ {
639
+ "diskGb" => 1770
640
+ }
641
+ ],
642
+ "maximumPersistentDisks" => 16,
643
+ "maximumPersistentDisksSizeGb" => "10240",
644
+ "zone" => zone,
645
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-highmem-8-d"
646
+ },
647
+ "n1-standard-1" => {
648
+ "kind" => "compute#machineType",
649
+ "id" => "12907738072351752276",
650
+ "creationTimestamp" => "2012-06-07T13:48:14.670-07:00",
651
+ "name" => "n1-standard-1",
652
+ "description" => "1 vCPU, 3.75 GB RAM",
653
+ "guestCpus" => 1,
654
+ "memoryMb" => 3840,
655
+ "imageSpaceGb" => 10,
656
+ "maximumPersistentDisks" => 16,
657
+ "maximumPersistentDisksSizeGb" => "10240",
658
+ "zone" => zone,
659
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-1"
660
+ },
661
+ "n1-standard-1-d" => {
662
+ "kind" => "compute#machineType",
663
+ "id" => "12908559201265214706",
664
+ "creationTimestamp" => "2012-06-07T13:48:34.258-07:00",
665
+ "name" => "n1-standard-1-d",
666
+ "description" => "1 vCPU, 3.75 GB RAM, 1 scratch disk (420 GB)",
667
+ "guestCpus" => 1,
668
+ "memoryMb" => 3840,
669
+ "imageSpaceGb" => 10,
670
+ "scratchDisks" => [
671
+ {
672
+ "diskGb" => 420
673
+ }
674
+ ],
675
+ "maximumPersistentDisks" => 16,
676
+ "maximumPersistentDisksSizeGb" => "10240",
677
+ "zone" => zone,
678
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-1-d"
679
+ },
680
+ "n1-standard-2" => {
681
+ "kind" => "compute#machineType",
682
+ "id" => "12908559320241551184",
683
+ "creationTimestamp" => "2012-06-07T13:48:56.867-07:00",
684
+ "name" => "n1-standard-2",
685
+ "description" => "2 vCPUs, 7.5 GB RAM",
686
+ "guestCpus" => 2,
687
+ "memoryMb" => 7680,
688
+ "imageSpaceGb" => 10,
689
+ "maximumPersistentDisks" => 16,
690
+ "maximumPersistentDisksSizeGb" => "10240",
691
+ "zone" => zone,
692
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-2"
693
+ },
694
+ "n1-standard-2-d" => {
695
+ "kind" => "compute#machineType",
696
+ "id" => "12908559582417967837",
697
+ "creationTimestamp" => "2012-06-07T13:49:19.448-07:00",
698
+ "name" => "n1-standard-2-d",
699
+ "description" => "2 vCPUs, 7.5 GB RAM, 1 scratch disk (870 GB)",
700
+ "guestCpus" => 2,
701
+ "memoryMb" => 7680,
702
+ "imageSpaceGb" => 10,
703
+ "scratchDisks" => [
704
+ {
705
+ "diskGb" => 870
706
+ }
707
+ ],
708
+ "maximumPersistentDisks" => 16,
709
+ "maximumPersistentDisksSizeGb" => "10240",
710
+ "zone" => zone,
711
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-2-d"
712
+ },
713
+ "n1-standard-4" => {
714
+ "kind" => "compute#machineType",
715
+ "id" => "12908559692070444049",
716
+ "creationTimestamp" => "2012-06-07T13:49:40.050-07:00",
717
+ "name" => "n1-standard-4",
718
+ "description" => "4 vCPUs, 15 GB RAM",
719
+ "guestCpus" => 4,
720
+ "memoryMb" => 15_360,
721
+ "imageSpaceGb" => 10,
722
+ "maximumPersistentDisks" => 16,
723
+ "maximumPersistentDisksSizeGb" => "10240",
724
+ "zone" => zone,
725
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-4"
726
+ },
727
+ "n1-standard-4-d" => {
728
+ "kind" => "compute#machineType",
729
+ "id" => "12908559991903153608",
730
+ "creationTimestamp" => "2012-06-07T13:50:05.677-07:00",
731
+ "name" => "n1-standard-4-d",
732
+ "description" => "4 vCPUs, 15 GB RAM, 1 scratch disk (1770 GB)",
733
+ "guestCpus" => 4,
734
+ "memoryMb" => 15_360,
735
+ "imageSpaceGb" => 10,
736
+ "scratchDisks" => [
737
+ {
738
+ "diskGb" => 1770
739
+ }
740
+ ],
741
+ "maximumPersistentDisks" => 16,
742
+ "maximumPersistentDisksSizeGb" => "10240",
743
+ "zone" => zone,
744
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-4-d"
745
+ },
746
+ "n1-standard-8" => {
747
+ "kind" => "compute#machineType",
748
+ "id" => "12908560197989714867",
749
+ "creationTimestamp" => "2012-06-07T13:50:42.334-07:00",
750
+ "name" => "n1-standard-8",
751
+ "description" => "8 vCPUs, 30 GB RAM",
752
+ "guestCpus" => 8,
753
+ "memoryMb" => 30_720,
754
+ "imageSpaceGb" => 10,
755
+ "maximumPersistentDisks" => 16,
756
+ "maximumPersistentDisksSizeGb" => "10240",
757
+ "zone" => zone,
758
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-8"
759
+ },
760
+ "n1-standard-8-d" => {
761
+ "kind" => "compute#machineType",
762
+ "id" => "12908560709887590691",
763
+ "creationTimestamp" => "2012-06-07T13:51:19.936-07:00",
764
+ "name" => "n1-standard-8-d",
765
+ "description" => "8 vCPUs, 30 GB RAM, 2 scratch disks (1770 GB, 1770 GB)",
766
+ "guestCpus" => 8,
767
+ "memoryMb" => 30_720,
768
+ "imageSpaceGb" => 10,
769
+ "scratchDisks" => [
770
+ {
771
+ "diskGb" => 1770
772
+ },
773
+ {
774
+ "diskGb" => 1770
775
+ }
776
+ ],
777
+ "maximumPersistentDisks" => 16,
778
+ "maximumPersistentDisksSizeGb" => "10240",
779
+ "zone" => zone,
780
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/#{zone}/machineTypes/n1-standard-8-d"
781
+ }
782
+ }
783
+ end,
784
+ :images => {},
785
+ :disks => {
786
+ "fog-1" => {
787
+ "kind" => "compute#disk",
788
+ "id" => "3338131294770784461",
789
+ "creationTimestamp" => "2013-12-18T19:47:10.583-08:00",
790
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
791
+ "status" => "READY",
792
+ "name" => "fog-1",
793
+ "sizeGb" => "10",
794
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/disks/fog-1",
795
+ "sourceImage" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
796
+ "sourceImageId" => "17312518942796567788",
797
+ "type" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/diskTypes/pd-standard"
798
+ },
799
+ "fog-2" => {
800
+ "kind" => "compute#disk",
801
+ "id" => "3338131294770784462",
802
+ "creationTimestamp" => "2013-12-18T19:47:10.583-08:00",
803
+ "zone" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a",
804
+ "status" => "READY",
805
+ "name" => "fog-2",
806
+ "sizeGb" => "10",
807
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/disks/fog-1",
808
+ "type" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/diskTypes/pd-ssd"
809
+ }
810
+ },
811
+ :subnetworks => {
812
+ "fog-1" => {
813
+ "kind" => "compute#subnetwork",
814
+ "id" => "6680781458098159920",
815
+ "creationTimestamp" => "2016-03-19T19:13:51.613-07:00",
816
+ "gatewayAddress" => "10.1.0.1",
817
+ "name" => "fog-1",
818
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/fog-example",
819
+ "ipCidrRange" => "10.1.0.0/20",
820
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1",
821
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1/subnetworks/fog-1"
822
+ },
823
+ "fog-2" => {
824
+ "kind" => "compute#subnetwork",
825
+ "id" => "6680781458098159921",
826
+ "creationTimestamp" => "2016-03-19T19:13:51.613-07:00",
827
+ "gatewayAddress" => "10.1.16.1",
828
+ "name" => "fog-2",
829
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/fog-example",
830
+ "ipCidrRange" => "10.1.16.0/20",
831
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1",
832
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/europe-west1/subnetworks/fog-2"
833
+ },
834
+ "fog-3" => {
835
+ "kind" => "compute#subnetwork",
836
+ "id" => "6680781458098159923",
837
+ "creationTimestamp" => "2016-03-19T19:13:51.613-07:00",
838
+ "gatewayAddress" => "192.168.20.1",
839
+ "name" => "fog-3",
840
+ "network" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/global/networks/fog-elsewhere-example",
841
+ "ipCidrRange" => "192.168.20.0/20",
842
+ "region" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1",
843
+ "selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/regions/us-central1/subnetworks/fog-3"
844
+ },
845
+ },
846
+ :operations => {}
847
+ }
848
+ end
849
+ end
850
+ end
851
+
852
+ def self.reset
853
+ @data = nil
854
+ end
855
+
856
+ def data(project = @project)
857
+ self.class.data(api_version)[project]
858
+ end
859
+
860
+ def reset_data
861
+ # not particularly useful because it deletes zones
862
+ self.class.data(api_version).delete(@project)
863
+ end
864
+
865
+ def random_operation
866
+ "operation-#{Fog::Mock.random_numbers(13)}-#{Fog::Mock.random_hex(13)}-#{Fog::Mock.random_hex(8)}"
867
+ end
868
+ end
869
+ end
870
+ end
871
+ end