fog 0.0.56 → 0.0.57

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.
Files changed (85) hide show
  1. data/Rakefile +1 -1
  2. data/VERSION.yml +1 -1
  3. data/fog.gemspec +4 -4
  4. data/lib/fog/aws.rb +4 -3
  5. data/lib/fog/aws/ec2.rb +136 -150
  6. data/lib/fog/aws/models/ec2/address.rb +3 -1
  7. data/lib/fog/aws/models/ec2/addresses.rb +20 -6
  8. data/lib/fog/aws/models/ec2/flavor.rb +3 -1
  9. data/lib/fog/aws/models/ec2/flavors.rb +14 -3
  10. data/lib/fog/aws/models/ec2/image.rb +3 -1
  11. data/lib/fog/aws/models/ec2/images.rb +14 -3
  12. data/lib/fog/aws/models/ec2/key_pair.rb +3 -1
  13. data/lib/fog/aws/models/ec2/key_pairs.rb +14 -3
  14. data/lib/fog/aws/models/ec2/security_group.rb +3 -1
  15. data/lib/fog/aws/models/ec2/security_groups.rb +14 -3
  16. data/lib/fog/aws/models/ec2/server.rb +3 -1
  17. data/lib/fog/aws/models/ec2/servers.rb +14 -3
  18. data/lib/fog/aws/models/ec2/snapshot.rb +3 -1
  19. data/lib/fog/aws/models/ec2/snapshots.rb +18 -5
  20. data/lib/fog/aws/models/ec2/volume.rb +3 -1
  21. data/lib/fog/aws/models/ec2/volumes.rb +18 -5
  22. data/lib/fog/aws/models/s3/directories.rb +14 -3
  23. data/lib/fog/aws/models/s3/directory.rb +4 -1
  24. data/lib/fog/aws/models/s3/file.rb +3 -1
  25. data/lib/fog/aws/models/s3/files.rb +4 -1
  26. data/lib/fog/aws/parsers/simpledb/domain_metadata.rb +2 -0
  27. data/lib/fog/aws/parsers/simpledb/get_attributes.rb +2 -0
  28. data/lib/fog/aws/parsers/simpledb/list_domains.rb +2 -0
  29. data/lib/fog/aws/parsers/simpledb/select.rb +2 -0
  30. data/lib/fog/aws/requests/ec2/allocate_address.rb +11 -16
  31. data/lib/fog/aws/requests/ec2/associate_address.rb +14 -19
  32. data/lib/fog/aws/requests/ec2/attach_volume.rb +16 -21
  33. data/lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb +29 -27
  34. data/lib/fog/aws/requests/ec2/create_key_pair.rb +13 -18
  35. data/lib/fog/aws/requests/ec2/create_security_group.rb +14 -19
  36. data/lib/fog/aws/requests/ec2/create_snapshot.rb +13 -18
  37. data/lib/fog/aws/requests/ec2/create_volume.rb +14 -19
  38. data/lib/fog/aws/requests/ec2/delete_key_pair.rb +12 -17
  39. data/lib/fog/aws/requests/ec2/delete_security_group.rb +13 -18
  40. data/lib/fog/aws/requests/ec2/delete_snapshot.rb +12 -17
  41. data/lib/fog/aws/requests/ec2/delete_volume.rb +13 -18
  42. data/lib/fog/aws/requests/ec2/describe_addresses.rb +11 -16
  43. data/lib/fog/aws/requests/ec2/describe_availability_zones.rb +9 -14
  44. data/lib/fog/aws/requests/ec2/describe_images.rb +9 -14
  45. data/lib/fog/aws/requests/ec2/describe_instances.rb +17 -22
  46. data/lib/fog/aws/requests/ec2/describe_key_pairs.rb +11 -16
  47. data/lib/fog/aws/requests/ec2/describe_regions.rb +9 -14
  48. data/lib/fog/aws/requests/ec2/describe_reserved_instances.rb +9 -14
  49. data/lib/fog/aws/requests/ec2/describe_security_groups.rb +11 -16
  50. data/lib/fog/aws/requests/ec2/describe_snapshots.rb +12 -17
  51. data/lib/fog/aws/requests/ec2/describe_volumes.rb +14 -19
  52. data/lib/fog/aws/requests/ec2/detach_volume.rb +11 -16
  53. data/lib/fog/aws/requests/ec2/disassociate_address.rb +12 -17
  54. data/lib/fog/aws/requests/ec2/get_console_output.rb +12 -17
  55. data/lib/fog/aws/requests/ec2/reboot_instances.rb +11 -16
  56. data/lib/fog/aws/requests/ec2/release_address.rb +12 -17
  57. data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +10 -15
  58. data/lib/fog/aws/requests/ec2/run_instances.rb +36 -38
  59. data/lib/fog/aws/requests/ec2/terminate_instances.rb +16 -20
  60. data/lib/fog/aws/requests/s3/copy_object.rb +9 -15
  61. data/lib/fog/aws/requests/s3/delete_bucket.rb +9 -16
  62. data/lib/fog/aws/requests/s3/delete_object.rb +6 -14
  63. data/lib/fog/aws/requests/s3/get_bucket.rb +9 -14
  64. data/lib/fog/aws/requests/s3/get_bucket_location.rb +8 -14
  65. data/lib/fog/aws/requests/s3/get_object.rb +7 -15
  66. data/lib/fog/aws/requests/s3/get_request_payment.rb +7 -13
  67. data/lib/fog/aws/requests/s3/get_service.rb +7 -13
  68. data/lib/fog/aws/requests/s3/head_object.rb +6 -14
  69. data/lib/fog/aws/requests/s3/put_bucket.rb +13 -21
  70. data/lib/fog/aws/requests/s3/put_object.rb +8 -16
  71. data/lib/fog/aws/requests/s3/put_request_payment.rb +7 -16
  72. data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +14 -21
  73. data/lib/fog/aws/requests/simpledb/create_domain.rb +11 -18
  74. data/lib/fog/aws/requests/simpledb/delete_attributes.rb +15 -22
  75. data/lib/fog/aws/requests/simpledb/delete_domain.rb +11 -18
  76. data/lib/fog/aws/requests/simpledb/domain_metadata.rb +14 -19
  77. data/lib/fog/aws/requests/simpledb/get_attributes.rb +19 -23
  78. data/lib/fog/aws/requests/simpledb/list_domains.rb +11 -16
  79. data/lib/fog/aws/requests/simpledb/put_attributes.rb +15 -15
  80. data/lib/fog/aws/requests/simpledb/select.rb +12 -17
  81. data/lib/fog/aws/s3.rb +117 -121
  82. data/lib/fog/aws/simpledb.rb +127 -127
  83. data/lib/fog/rackspace/models/servers/images.rb +1 -1
  84. data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +11 -1
  85. metadata +4 -4
@@ -1,9 +1,10 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/ec2/describe_snapshots'
2
7
 
3
- module Fog
4
- module AWS
5
- class EC2
6
-
7
8
  # Describe all or specified snapshots
8
9
  #
9
10
  # ==== Parameters
@@ -22,27 +23,22 @@ unless Fog.mocking?
22
23
  def describe_snapshots(snapshot_id = [])
23
24
  params = AWS.indexed_param('SnapshotId', snapshot_id)
24
25
  request({
25
- 'Action' => 'DescribeSnapshots'
26
- }.merge!(params), Fog::Parsers::AWS::EC2::DescribeSnapshots.new)
26
+ 'Action' => 'DescribeSnapshots',
27
+ :parser => Fog::Parsers::AWS::EC2::DescribeSnapshots.new
28
+ }.merge!(params))
27
29
  end
28
30
 
29
31
  end
30
- end
31
- end
32
32
 
33
- else
34
-
35
- module Fog
36
- module AWS
37
- class EC2
33
+ class Mock
38
34
 
39
35
  def describe_snapshots(snapshot_id = [])
40
36
  response = Excon::Response.new
41
37
  snapshot_id = [*snapshot_id]
42
38
  if snapshot_id != []
43
- snapshot_set = Fog::AWS::EC2.data[:snapshots].reject {|key,value| !snapshot_id.include?(key)}.values
39
+ snapshot_set = @data[:snapshots].reject {|key,value| !snapshot_id.include?(key)}.values
44
40
  else
45
- snapshot_set = Fog::AWS::EC2.data[:snapshots].values
41
+ snapshot_set = @data[:snapshots].values
46
42
  end
47
43
 
48
44
  snapshot_set.each do |snapshot|
@@ -74,5 +70,4 @@ else
74
70
  end
75
71
  end
76
72
  end
77
-
78
73
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/describe_volumes'
6
7
 
7
8
  # Describe all or specified volumes.
8
9
  #
@@ -28,27 +29,22 @@ unless Fog.mocking?
28
29
  def describe_volumes(volume_id = [])
29
30
  params = AWS.indexed_param('VolumeId', volume_id)
30
31
  request({
31
- 'Action' => 'DescribeVolumes'
32
- }.merge!(params), Fog::Parsers::AWS::EC2::DescribeVolumes.new)
32
+ 'Action' => 'DescribeVolumes',
33
+ :parser => Fog::Parsers::AWS::EC2::DescribeVolumes.new
34
+ }.merge!(params))
33
35
  end
34
36
 
35
37
  end
36
- end
37
- end
38
38
 
39
- else
40
-
41
- module Fog
42
- module AWS
43
- class EC2
39
+ class Mock
44
40
 
45
41
  def describe_volumes(volume_id = [])
46
42
  response = Excon::Response.new
47
43
  volume_id = [*volume_id]
48
44
  if volume_id != []
49
- volume_set = Fog::AWS::EC2.data[:volumes].reject {|key,value| !volume_id.include?(key)}.values
45
+ volume_set = @data[:volumes].reject {|key,value| !volume_id.include?(key)}.values
50
46
  else
51
- volume_set = Fog::AWS::EC2.data[:volumes].values
47
+ volume_set = @data[:volumes].values
52
48
  end
53
49
 
54
50
  volume_set.each do |volume|
@@ -58,9 +54,9 @@ else
58
54
  volume['status'] = 'available'
59
55
  end
60
56
  when 'deleting'
61
- if Time.now - Fog::AWS::EC2.data[:deleted_at][volume['volumeId']] > 2
62
- Fog::AWS::EC2.data[:deleted_at].delete(volume['volumeId'])
63
- Fog::AWS::EC2.data[:volumes].delete(volume['volumeId'])
57
+ if Time.now - @data[:deleted_at][volume['volumeId']] > 2
58
+ @data[:deleted_at].delete(volume['volumeId'])
59
+ @data[:volumes].delete(volume['volumeId'])
64
60
  end
65
61
  end
66
62
  end
@@ -81,5 +77,4 @@ else
81
77
  end
82
78
  end
83
79
  end
84
-
85
80
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/detach_volume'
6
7
 
7
8
  # Detach an Amazon EBS volume from a running instance
8
9
  #
@@ -24,25 +25,20 @@ unless Fog.mocking?
24
25
  # * 'volumeId'<~String> - Reference to volume
25
26
  def detach_volume(volume_id, options = {})
26
27
  request({
27
- 'Action' => 'DetachVolume',
28
- 'VolumeId' => volume_id
29
- }.merge!(options), Fog::Parsers::AWS::EC2::DetachVolume.new)
28
+ 'Action' => 'DetachVolume',
29
+ 'VolumeId' => volume_id,
30
+ :parser => Fog::Parsers::AWS::EC2::DetachVolume.new
31
+ }.merge!(options))
30
32
  end
31
33
 
32
34
  end
33
- end
34
- end
35
35
 
36
- else
37
-
38
- module Fog
39
- module AWS
40
- class EC2
36
+ class Mock
41
37
 
42
38
  def detach_volume(volume_id, options = {})
43
39
  response = Excon::Response.new
44
40
  response.status = 200
45
- if volume = Fog::AWS::EC2.data[:volumes][volume_id]
41
+ if volume = @data[:volumes][volume_id]
46
42
  data = volume['attachmentSet'].pop
47
43
  response.status = 200
48
44
  response.body = {
@@ -58,5 +54,4 @@ else
58
54
  end
59
55
  end
60
56
  end
61
-
62
57
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/basic'
6
7
 
7
8
  # Disassociate an elastic IP address from its instance (if any)
8
9
  #
@@ -15,26 +16,21 @@ unless Fog.mocking?
15
16
  # * 'requestId'<~String> - Id of request
16
17
  # * 'return'<~Boolean> - success?
17
18
  def disassociate_address(public_ip)
18
- request({
19
- 'Action' => 'DisassociateAddress',
20
- 'PublicIp' => public_ip
21
- }, Fog::Parsers::AWS::EC2::Basic.new)
19
+ request(
20
+ 'Action' => 'DisassociateAddress',
21
+ 'PublicIp' => public_ip,
22
+ :parser => Fog::Parsers::AWS::EC2::Basic.new
23
+ )
22
24
  end
23
25
 
24
26
  end
25
- end
26
- end
27
27
 
28
- else
29
-
30
- module Fog
31
- module AWS
32
- class EC2
28
+ class Mock
33
29
 
34
30
  def disassociate_address(public_ip)
35
31
  response = Excon::Response.new
36
32
  response.status = 200
37
- if address = Fog::AWS::EC2.data[:addresses][public_ip]
33
+ if address = @data[:addresses][public_ip]
38
34
  address['instanceId'] = ''
39
35
  response.status = 200
40
36
  response.body = {
@@ -51,5 +47,4 @@ else
51
47
  end
52
48
  end
53
49
  end
54
-
55
50
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/get_console_output'
6
7
 
7
8
  # Retrieve console output for specified instance
8
9
  #
@@ -17,25 +18,20 @@ unless Fog.mocking?
17
18
  # * 'requestId'<~String> - Id of request
18
19
  # * 'timestamp'<~Time> - Timestamp of last update to output
19
20
  def get_console_output(instance_id)
20
- request({
21
- 'Action' => 'GetConsoleOutput',
22
- 'InstanceId' => instance_id
23
- }, Fog::Parsers::AWS::EC2::GetConsoleOutput.new)
21
+ request(
22
+ 'Action' => 'GetConsoleOutput',
23
+ 'InstanceId' => instance_id,
24
+ :parser => Fog::Parsers::AWS::EC2::GetConsoleOutput.new
25
+ )
24
26
  end
25
27
 
26
28
  end
27
- end
28
- end
29
29
 
30
- else
31
-
32
- module Fog
33
- module AWS
34
- class EC2
30
+ class Mock
35
31
 
36
32
  def get_console_output(instance_id)
37
33
  response = Excon::Response.new
38
- if instance = Fog::AWS::EC2.data[:instances][instance_id]
34
+ if instance = @data[:instances][instance_id]
39
35
  response.status = 200
40
36
  response.body = {
41
37
  'instanceId' => instance_id,
@@ -53,5 +49,4 @@ else
53
49
  end
54
50
  end
55
51
  end
56
-
57
52
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/basic'
6
7
 
7
8
  # Reboot specified instances
8
9
  #
@@ -17,26 +18,21 @@ unless Fog.mocking?
17
18
  def reboot_instances(instance_id = [])
18
19
  params = AWS.indexed_param('InstanceId', instance_id)
19
20
  request({
20
- 'Action' => 'RebootInstances'
21
- }.merge!(params), Fog::Parsers::AWS::EC2::Basic.new)
21
+ 'Action' => 'RebootInstances',
22
+ :parser => Fog::Parsers::AWS::EC2::Basic.new
23
+ }.merge!(params))
22
24
  end
23
25
 
24
26
  end
25
- end
26
- end
27
27
 
28
- else
29
-
30
- module Fog
31
- module AWS
32
- class EC2
28
+ class Mock
33
29
 
34
30
  def reboot_instances(instance_id = [])
35
31
  response = Excon::Response.new
36
32
  instance_id = [*instance_id]
37
- if (Fog::AWS::EC2.data[:instances].keys & instance_id).length == instance_id.length
33
+ if (@data[:instances].keys & instance_id).length == instance_id.length
38
34
  for instance_id in instance_id
39
- Fog::AWS::EC2.data[:instances][instance_id]['status'] = 'rebooting'
35
+ @data[:instances][instance_id]['status'] = 'rebooting'
40
36
  end
41
37
  response.status = 200
42
38
  response.body = {
@@ -53,5 +49,4 @@ else
53
49
  end
54
50
  end
55
51
  end
56
-
57
52
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/basic'
6
7
 
7
8
  # Release an elastic IP address.
8
9
  #
@@ -12,25 +13,20 @@ unless Fog.mocking?
12
13
  # * 'requestId'<~String> - Id of request
13
14
  # * 'return'<~Boolean> - success?
14
15
  def release_address(public_ip)
15
- request({
16
- 'Action' => 'ReleaseAddress',
17
- 'PublicIp' => public_ip
18
- }, Fog::Parsers::AWS::EC2::Basic.new)
16
+ request(
17
+ 'Action' => 'ReleaseAddress',
18
+ 'PublicIp' => public_ip,
19
+ :parser => Fog::Parsers::AWS::EC2::Basic.new
20
+ )
19
21
  end
20
22
 
21
23
  end
22
- end
23
- end
24
24
 
25
- else
26
-
27
- module Fog
28
- module AWS
29
- class EC2
25
+ class Mock
30
26
 
31
27
  def release_address(public_ip)
32
28
  response = Excon::Response.new
33
- if (address = Fog::AWS::EC2.data[:addresses].delete(public_ip))
29
+ if (address = @data[:addresses].delete(public_ip))
34
30
  response.status = 200
35
31
  response.body = {
36
32
  'requestId' => Fog::AWS::Mock.request_id,
@@ -46,5 +42,4 @@ else
46
42
  end
47
43
  end
48
44
  end
49
-
50
45
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/basic'
6
7
 
7
8
  # Remove permissions from a security group
8
9
  #
@@ -25,19 +26,14 @@ unless Fog.mocking?
25
26
  # * 'return'<~Boolean> - success?
26
27
  def revoke_security_group_ingress(options = {})
27
28
  request({
28
- 'Action' => 'RevokeSecurityGroupIngress'
29
- }.merge!(options), Fog::Parsers::AWS::EC2::Basic.new)
29
+ 'Action' => 'RevokeSecurityGroupIngress',
30
+ :parser => Fog::Parsers::AWS::EC2::Basic.new
31
+ }.merge!(options))
30
32
  end
31
33
 
32
34
  end
33
- end
34
- end
35
35
 
36
- else
37
-
38
- module Fog
39
- module AWS
40
- class EC2
36
+ class Mock
41
37
 
42
38
  # TODO: handle the GroupName/Source/Source case
43
39
  def revoke_security_group_ingress(options = {})
@@ -45,7 +41,7 @@ else
45
41
  raise MockNotImplemented.new("Contributions welcome!")
46
42
  else
47
43
  response = Excon::Response.new
48
- group = Fog::AWS::EC2.data[:security_groups][options['GroupName']]
44
+ group = @data[:security_groups][options['GroupName']]
49
45
 
50
46
  ingress = group['ipPermissions'].select {|permission|
51
47
  permission['fromPort'] == options['FromPort'] &&
@@ -68,5 +64,4 @@ else
68
64
  end
69
65
  end
70
66
  end
71
-
72
67
  end
@@ -1,8 +1,9 @@
1
- unless Fog.mocking?
1
+ module Fog
2
+ module AWS
3
+ module EC2
4
+ class Real
2
5
 
3
- module Fog
4
- module AWS
5
- class EC2
6
+ require 'fog/aws/parsers/ec2/run_instances'
6
7
 
7
8
  # Launch specified instances
8
9
  #
@@ -81,23 +82,20 @@ unless Fog.mocking?
81
82
  options['UserData'] = Base64.encode64(options['UserData'])
82
83
  end
83
84
  request({
84
- 'Action' => 'RunInstances',
85
- 'ImageId' => image_id,
86
- 'MinCount' => min_count,
87
- 'MaxCount' => max_count
88
- }.merge!(options), Fog::Parsers::AWS::EC2::RunInstances.new)
85
+ 'Action' => 'RunInstances',
86
+ 'ImageId' => image_id,
87
+ 'MinCount' => min_count,
88
+ 'MaxCount' => max_count,
89
+ :parser => Fog::Parsers::AWS::EC2::RunInstances.new
90
+ }.merge!(options))
89
91
  end
90
92
 
91
93
  end
92
- end
93
- end
94
94
 
95
- else
96
-
97
- module Fog
98
- module AWS
99
- class EC2
95
+ class Mock
100
96
 
97
+ # TODO: allow for block device mapping in mocks
98
+ # TODO: allow for rootDeviceType specification
101
99
  def run_instances(image_id, min_count, max_count, options = {})
102
100
  response = Excon::Response.new
103
101
  response.status = 200
@@ -110,28 +108,29 @@ else
110
108
  min_count.times do |i|
111
109
  instance_id = Fog::AWS::Mock.instance_id
112
110
  data = {
113
- 'amiLaunchIndex' => i,
114
- 'dnsName' => '',
115
- 'groupSet' => group_set,
116
- 'imageId' => image_id,
117
- 'instanceId' => instance_id,
118
- 'instanceState' => { 'code' => 0, 'name' => 'pending' },
119
- 'instanceType' => options['InstanceType'] || 'm1.small',
120
- 'kernelId' => options['KernelId'] || Fog::AWS::Mock.kernel_id,
121
- 'keyName' => options['KeyName'] || '',
122
- 'launchTime' => Time.now,
123
- 'monitoring' => { 'state' => options['Monitoring.Enabled'] || false },
124
- 'ownerId' => owner_id,
125
- 'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone },
126
- 'privateDnsName' => '',
127
- 'productCodes' => [],
128
- 'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id,
129
- 'reason' => '',
130
- 'reservationId' => reservation_id,
131
- 'instanceState' => 'pending'
111
+ 'amiLaunchIndex' => i,
112
+ 'blockDeviceMapping' => [],
113
+ 'dnsName' => '',
114
+ 'groupSet' => group_set,
115
+ 'imageId' => image_id,
116
+ 'instanceId' => instance_id,
117
+ 'instanceState' => { 'code' => 0, 'name' => 'pending' },
118
+ 'instanceType' => options['InstanceType'] || 'm1.small',
119
+ 'kernelId' => options['KernelId'] || Fog::AWS::Mock.kernel_id,
120
+ 'keyName' => options['KeyName'] || '',
121
+ 'launchTime' => Time.now,
122
+ 'monitoring' => { 'state' => options['Monitoring.Enabled'] || false },
123
+ 'ownerId' => owner_id,
124
+ 'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone },
125
+ 'privateDnsName' => '',
126
+ 'productCodes' => [],
127
+ 'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id,
128
+ 'reason' => '',
129
+ 'reservationId' => reservation_id,
130
+ 'rootDeviceType' => 'instance-store'
132
131
  }
133
- Fog::AWS::EC2.data[:instances][instance_id] = data
134
- instances_set << data.reject{|key,value| !['amiLaunchIndex', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'productCodes', 'ramdiskId', 'reason'].include?(key)}
132
+ @data[:instances][instance_id] = data
133
+ instances_set << data.reject{|key,value| !['amiLaunchIndex', 'blockDeviceMapping', 'dnsName', 'imageId', 'instanceId', 'instanceState', 'instanceType', 'kernelId', 'keyName', 'launchTime', 'monitoring', 'placement', 'privateDnsName', 'productCodes', 'ramdiskId', 'reason', 'rootDeviceType'].include?(key)}
135
134
  end
136
135
  response.body = {
137
136
  'groupSet' => group_set,
@@ -146,5 +145,4 @@ else
146
145
  end
147
146
  end
148
147
  end
149
-
150
148
  end