fog 0.0.56 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION.yml +1 -1
- data/fog.gemspec +4 -4
- data/lib/fog/aws.rb +4 -3
- data/lib/fog/aws/ec2.rb +136 -150
- data/lib/fog/aws/models/ec2/address.rb +3 -1
- data/lib/fog/aws/models/ec2/addresses.rb +20 -6
- data/lib/fog/aws/models/ec2/flavor.rb +3 -1
- data/lib/fog/aws/models/ec2/flavors.rb +14 -3
- data/lib/fog/aws/models/ec2/image.rb +3 -1
- data/lib/fog/aws/models/ec2/images.rb +14 -3
- data/lib/fog/aws/models/ec2/key_pair.rb +3 -1
- data/lib/fog/aws/models/ec2/key_pairs.rb +14 -3
- data/lib/fog/aws/models/ec2/security_group.rb +3 -1
- data/lib/fog/aws/models/ec2/security_groups.rb +14 -3
- data/lib/fog/aws/models/ec2/server.rb +3 -1
- data/lib/fog/aws/models/ec2/servers.rb +14 -3
- data/lib/fog/aws/models/ec2/snapshot.rb +3 -1
- data/lib/fog/aws/models/ec2/snapshots.rb +18 -5
- data/lib/fog/aws/models/ec2/volume.rb +3 -1
- data/lib/fog/aws/models/ec2/volumes.rb +18 -5
- data/lib/fog/aws/models/s3/directories.rb +14 -3
- data/lib/fog/aws/models/s3/directory.rb +4 -1
- data/lib/fog/aws/models/s3/file.rb +3 -1
- data/lib/fog/aws/models/s3/files.rb +4 -1
- data/lib/fog/aws/parsers/simpledb/domain_metadata.rb +2 -0
- data/lib/fog/aws/parsers/simpledb/get_attributes.rb +2 -0
- data/lib/fog/aws/parsers/simpledb/list_domains.rb +2 -0
- data/lib/fog/aws/parsers/simpledb/select.rb +2 -0
- data/lib/fog/aws/requests/ec2/allocate_address.rb +11 -16
- data/lib/fog/aws/requests/ec2/associate_address.rb +14 -19
- data/lib/fog/aws/requests/ec2/attach_volume.rb +16 -21
- data/lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb +29 -27
- data/lib/fog/aws/requests/ec2/create_key_pair.rb +13 -18
- data/lib/fog/aws/requests/ec2/create_security_group.rb +14 -19
- data/lib/fog/aws/requests/ec2/create_snapshot.rb +13 -18
- data/lib/fog/aws/requests/ec2/create_volume.rb +14 -19
- data/lib/fog/aws/requests/ec2/delete_key_pair.rb +12 -17
- data/lib/fog/aws/requests/ec2/delete_security_group.rb +13 -18
- data/lib/fog/aws/requests/ec2/delete_snapshot.rb +12 -17
- data/lib/fog/aws/requests/ec2/delete_volume.rb +13 -18
- data/lib/fog/aws/requests/ec2/describe_addresses.rb +11 -16
- data/lib/fog/aws/requests/ec2/describe_availability_zones.rb +9 -14
- data/lib/fog/aws/requests/ec2/describe_images.rb +9 -14
- data/lib/fog/aws/requests/ec2/describe_instances.rb +17 -22
- data/lib/fog/aws/requests/ec2/describe_key_pairs.rb +11 -16
- data/lib/fog/aws/requests/ec2/describe_regions.rb +9 -14
- data/lib/fog/aws/requests/ec2/describe_reserved_instances.rb +9 -14
- data/lib/fog/aws/requests/ec2/describe_security_groups.rb +11 -16
- data/lib/fog/aws/requests/ec2/describe_snapshots.rb +12 -17
- data/lib/fog/aws/requests/ec2/describe_volumes.rb +14 -19
- data/lib/fog/aws/requests/ec2/detach_volume.rb +11 -16
- data/lib/fog/aws/requests/ec2/disassociate_address.rb +12 -17
- data/lib/fog/aws/requests/ec2/get_console_output.rb +12 -17
- data/lib/fog/aws/requests/ec2/reboot_instances.rb +11 -16
- data/lib/fog/aws/requests/ec2/release_address.rb +12 -17
- data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +10 -15
- data/lib/fog/aws/requests/ec2/run_instances.rb +36 -38
- data/lib/fog/aws/requests/ec2/terminate_instances.rb +16 -20
- data/lib/fog/aws/requests/s3/copy_object.rb +9 -15
- data/lib/fog/aws/requests/s3/delete_bucket.rb +9 -16
- data/lib/fog/aws/requests/s3/delete_object.rb +6 -14
- data/lib/fog/aws/requests/s3/get_bucket.rb +9 -14
- data/lib/fog/aws/requests/s3/get_bucket_location.rb +8 -14
- data/lib/fog/aws/requests/s3/get_object.rb +7 -15
- data/lib/fog/aws/requests/s3/get_request_payment.rb +7 -13
- data/lib/fog/aws/requests/s3/get_service.rb +7 -13
- data/lib/fog/aws/requests/s3/head_object.rb +6 -14
- data/lib/fog/aws/requests/s3/put_bucket.rb +13 -21
- data/lib/fog/aws/requests/s3/put_object.rb +8 -16
- data/lib/fog/aws/requests/s3/put_request_payment.rb +7 -16
- data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +14 -21
- data/lib/fog/aws/requests/simpledb/create_domain.rb +11 -18
- data/lib/fog/aws/requests/simpledb/delete_attributes.rb +15 -22
- data/lib/fog/aws/requests/simpledb/delete_domain.rb +11 -18
- data/lib/fog/aws/requests/simpledb/domain_metadata.rb +14 -19
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +19 -23
- data/lib/fog/aws/requests/simpledb/list_domains.rb +11 -16
- data/lib/fog/aws/requests/simpledb/put_attributes.rb +15 -15
- data/lib/fog/aws/requests/simpledb/select.rb +12 -17
- data/lib/fog/aws/s3.rb +117 -121
- data/lib/fog/aws/simpledb.rb +127 -127
- data/lib/fog/rackspace/models/servers/images.rb +1 -1
- data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +11 -1
- metadata +4 -4
@@ -1,9 +1,10 @@
|
|
1
|
-
|
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'
|
26
|
-
|
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
|
-
|
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 =
|
39
|
+
snapshot_set = @data[:snapshots].reject {|key,value| !snapshot_id.include?(key)}.values
|
44
40
|
else
|
45
|
-
snapshot_set =
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
32
|
-
|
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
|
-
|
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 =
|
45
|
+
volume_set = @data[:volumes].reject {|key,value| !volume_id.include?(key)}.values
|
50
46
|
else
|
51
|
-
volume_set =
|
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 -
|
62
|
-
|
63
|
-
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
28
|
-
'VolumeId'
|
29
|
-
|
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
|
-
|
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 =
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
20
|
-
'PublicIp'
|
21
|
-
|
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
|
-
|
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 =
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
22
|
-
'InstanceId'
|
23
|
-
|
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
|
-
|
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 =
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
21
|
-
|
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
|
-
|
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 (
|
33
|
+
if (@data[:instances].keys & instance_id).length == instance_id.length
|
38
34
|
for instance_id in instance_id
|
39
|
-
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
17
|
-
'PublicIp'
|
18
|
-
|
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
|
-
|
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 =
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
29
|
-
|
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
|
-
|
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 =
|
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
|
-
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
module EC2
|
4
|
+
class Real
|
2
5
|
|
3
|
-
|
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'
|
85
|
-
'ImageId'
|
86
|
-
'MinCount'
|
87
|
-
'MaxCount'
|
88
|
-
|
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
|
-
|
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'
|
114
|
-
'
|
115
|
-
'
|
116
|
-
'
|
117
|
-
'
|
118
|
-
'
|
119
|
-
'
|
120
|
-
'
|
121
|
-
'
|
122
|
-
'
|
123
|
-
'
|
124
|
-
'
|
125
|
-
'
|
126
|
-
'
|
127
|
-
'
|
128
|
-
'
|
129
|
-
'
|
130
|
-
'
|
131
|
-
'
|
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
|
-
|
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
|