fog 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +106 -17
- data/bin/fog +1 -1
- data/changelog.txt +17 -0
- data/docs/_layouts/default.html +2 -1
- data/docs/about/contributing.markdown +1 -1
- data/docs/compute/index.markdown +104 -0
- data/docs/index.markdown +1 -0
- data/docs/storage/index.markdown +17 -0
- data/fog.gemspec +3 -2
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/elb.rb +1 -0
- data/lib/fog/aws/iam.rb +1 -0
- data/lib/fog/aws/rds.rb +1 -0
- data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +5 -5
- data/lib/fog/aws/requests/simpledb/create_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/delete_attributes.rb +3 -3
- data/lib/fog/aws/requests/simpledb/delete_domain.rb +1 -1
- data/lib/fog/aws/requests/simpledb/domain_metadata.rb +1 -1
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +5 -5
- data/lib/fog/aws/requests/simpledb/list_domains.rb +2 -2
- data/lib/fog/aws/requests/simpledb/put_attributes.rb +6 -6
- data/lib/fog/aws/ses.rb +1 -0
- data/lib/fog/aws/simpledb.rb +8 -2
- data/lib/fog/bin.rb +2 -2
- data/lib/fog/cdn/aws.rb +8 -2
- data/lib/fog/cdn/rackspace.rb +8 -2
- data/lib/fog/compute/aws.rb +12 -3
- data/lib/fog/compute/bluebox.rb +8 -2
- data/lib/fog/compute/ecloud.rb +9 -4
- data/lib/fog/compute/go_grid.rb +8 -2
- data/lib/fog/compute/linode.rb +38 -6
- data/lib/fog/compute/models/aws/volumes.rb +4 -4
- data/lib/fog/compute/models/bluebox/server.rb +3 -3
- data/lib/fog/compute/models/brightbox/server.rb +9 -9
- data/lib/fog/compute/models/linode/data_center.rb +12 -0
- data/lib/fog/compute/models/linode/data_centers.rb +26 -0
- data/lib/fog/compute/models/linode/disk.rb +62 -0
- data/lib/fog/compute/models/linode/disks.rb +40 -0
- data/lib/fog/compute/models/linode/flavor.rb +23 -0
- data/lib/fog/compute/models/linode/flavors.rb +32 -0
- data/lib/fog/compute/models/linode/image.rb +14 -0
- data/lib/fog/compute/models/linode/images.rb +33 -0
- data/lib/fog/compute/models/linode/ip.rb +30 -0
- data/lib/fog/compute/models/linode/ips.rb +40 -0
- data/lib/fog/compute/models/linode/kernel.rb +12 -0
- data/lib/fog/compute/models/linode/kernels.rb +32 -0
- data/lib/fog/compute/models/linode/server.rb +88 -0
- data/lib/fog/compute/models/linode/servers.rb +32 -0
- data/lib/fog/compute/models/linode/stack_script.rb +13 -0
- data/lib/fog/compute/models/linode/stack_scripts.rb +32 -0
- data/lib/fog/compute/models/rackspace/server.rb +2 -2
- data/lib/fog/compute/models/slicehost/server.rb +2 -2
- data/lib/fog/compute/models/voxel/server.rb +3 -3
- data/lib/fog/compute/new_servers.rb +8 -2
- data/lib/fog/compute/rackspace.rb +8 -2
- data/lib/fog/compute/requests/aws/allocate_address.rb +4 -2
- data/lib/fog/compute/requests/aws/associate_address.rb +4 -2
- data/lib/fog/compute/requests/aws/attach_volume.rb +4 -2
- data/lib/fog/compute/requests/aws/authorize_security_group_ingress.rb +5 -3
- data/lib/fog/compute/requests/aws/create_image.rb +2 -1
- data/lib/fog/compute/requests/aws/create_key_pair.rb +4 -2
- data/lib/fog/compute/requests/aws/create_security_group.rb +5 -3
- data/lib/fog/compute/requests/aws/create_snapshot.rb +6 -4
- data/lib/fog/compute/requests/aws/create_tags.rb +7 -5
- data/lib/fog/compute/requests/aws/create_volume.rb +4 -2
- data/lib/fog/compute/requests/aws/delete_key_pair.rb +3 -1
- data/lib/fog/compute/requests/aws/delete_security_group.rb +4 -2
- data/lib/fog/compute/requests/aws/delete_snapshot.rb +3 -1
- data/lib/fog/compute/requests/aws/delete_tags.rb +5 -3
- data/lib/fog/compute/requests/aws/delete_volume.rb +4 -2
- data/lib/fog/compute/requests/aws/deregister_image.rb +2 -0
- data/lib/fog/compute/requests/aws/describe_addresses.rb +3 -1
- data/lib/fog/compute/requests/aws/describe_availability_zones.rb +2 -0
- data/lib/fog/compute/requests/aws/describe_images.rb +3 -1
- data/lib/fog/compute/requests/aws/describe_instances.rb +12 -10
- data/lib/fog/compute/requests/aws/describe_key_pairs.rb +3 -1
- data/lib/fog/compute/requests/aws/describe_regions.rb +2 -0
- data/lib/fog/compute/requests/aws/describe_reserved_instances.rb +2 -0
- data/lib/fog/compute/requests/aws/describe_reserved_instances_offerings.rb +2 -0
- data/lib/fog/compute/requests/aws/describe_security_groups.rb +3 -1
- data/lib/fog/compute/requests/aws/describe_snapshots.rb +5 -3
- data/lib/fog/compute/requests/aws/describe_tags.rb +2 -0
- data/lib/fog/compute/requests/aws/describe_volumes.rb +9 -7
- data/lib/fog/compute/requests/aws/detach_volume.rb +3 -1
- data/lib/fog/compute/requests/aws/disassociate_address.rb +4 -2
- data/lib/fog/compute/requests/aws/get_console_output.rb +3 -1
- data/lib/fog/compute/requests/aws/get_password_data.rb +15 -1
- data/lib/fog/compute/requests/aws/import_key_pair.rb +4 -2
- data/lib/fog/compute/requests/aws/modify_image_attributes.rb +4 -0
- data/lib/fog/compute/requests/aws/modify_snapshot_attribute.rb +4 -0
- data/lib/fog/compute/requests/aws/monitor_instances.rb +3 -1
- data/lib/fog/compute/requests/aws/reboot_instances.rb +4 -2
- data/lib/fog/compute/requests/aws/register_image.rb +4 -0
- data/lib/fog/compute/requests/aws/release_address.rb +3 -1
- data/lib/fog/compute/requests/aws/revoke_security_group_ingress.rb +3 -1
- data/lib/fog/compute/requests/aws/run_instances.rb +12 -6
- data/lib/fog/compute/requests/aws/start_instances.rb +2 -0
- data/lib/fog/compute/requests/aws/stop_instances.rb +2 -0
- data/lib/fog/compute/requests/aws/terminate_instances.rb +5 -3
- data/lib/fog/compute/requests/aws/unmonitor_instances.rb +3 -1
- data/lib/fog/compute/requests/go_grid/grid_image_get.rb +1 -1
- data/lib/fog/compute/requests/go_grid/grid_image_list.rb +1 -1
- data/lib/fog/compute/requests/linode/avail_datacenters.rb +1 -2
- data/lib/fog/compute/requests/linode/avail_distributions.rb +1 -2
- data/lib/fog/compute/requests/linode/avail_kernels.rb +6 -5
- data/lib/fog/compute/requests/linode/avail_linodeplans.rb +9 -3
- data/lib/fog/compute/requests/linode/avail_stackscripts.rb +3 -15
- data/lib/fog/compute/requests/linode/linode_boot.rb +15 -0
- data/lib/fog/compute/requests/linode/linode_config_create.rb +21 -0
- data/lib/fog/compute/requests/linode/linode_config_list.rb +18 -0
- data/lib/fog/compute/requests/linode/linode_create.rb +3 -4
- data/lib/fog/compute/requests/linode/linode_delete.rb +0 -1
- data/lib/fog/compute/requests/linode/linode_disk_create.rb +21 -0
- data/lib/fog/compute/requests/linode/linode_disk_createfromdistribution.rb +22 -0
- data/lib/fog/compute/requests/linode/linode_disk_createfromstackscript.rb +24 -0
- data/lib/fog/compute/requests/linode/linode_disk_delete.rb +19 -0
- data/lib/fog/compute/requests/linode/linode_disk_list.rb +19 -0
- data/lib/fog/compute/requests/linode/linode_ip_addprivate.rb +15 -0
- data/lib/fog/compute/requests/linode/linode_ip_list.rb +19 -0
- data/lib/fog/compute/requests/linode/linode_list.rb +0 -1
- data/lib/fog/compute/requests/linode/linode_reboot.rb +1 -2
- data/lib/fog/compute/requests/linode/linode_shutdown.rb +15 -0
- data/lib/fog/compute/requests/linode/linode_update.rb +15 -0
- data/lib/fog/compute/requests/linode/stackscript_list.rb +31 -0
- data/lib/fog/compute/requests/rackspace/confirm_resized_server.rb +3 -3
- data/lib/fog/compute/requests/rackspace/create_image.rb +2 -2
- data/lib/fog/compute/requests/rackspace/create_server.rb +2 -2
- data/lib/fog/compute/requests/rackspace/delete_image.rb +2 -2
- data/lib/fog/compute/requests/rackspace/delete_server.rb +2 -2
- data/lib/fog/compute/requests/rackspace/list_images_detail.rb +2 -2
- data/lib/fog/compute/requests/rackspace/list_servers_detail.rb +2 -2
- data/lib/fog/compute/requests/rackspace/resize_server.rb +4 -4
- data/lib/fog/compute/requests/rackspace/revert_resized_server.rb +4 -4
- data/lib/fog/compute/slicehost.rb +8 -2
- data/lib/fog/compute/storm_on_demand.rb +12 -1
- data/lib/fog/compute/voxel.rb +8 -2
- data/lib/fog/core/mock.rb +14 -1
- data/lib/fog/dns/aws.rb +8 -2
- data/lib/fog/dns/bluebox.rb +8 -2
- data/lib/fog/dns/dnsimple.rb +15 -3
- data/lib/fog/dns/linode.rb +8 -2
- data/lib/fog/dns/slicehost.rb +8 -2
- data/lib/fog/dns/zerigo.rb +8 -2
- data/lib/fog/providers/aws.rb +5 -10
- data/lib/fog/providers/linode.rb +0 -3
- data/lib/fog/storage.rb +6 -4
- data/lib/fog/storage/aws.rb +8 -2
- data/lib/fog/storage/google.rb +8 -2
- data/lib/fog/storage/local.rb +8 -2
- data/lib/fog/storage/models/aws/file.rb +0 -1
- data/lib/fog/storage/models/google/file.rb +1 -5
- data/lib/fog/storage/models/local/file.rb +1 -1
- data/lib/fog/storage/models/rackspace/file.rb +1 -5
- data/lib/fog/storage/rackspace.rb +8 -2
- data/lib/fog/storage/requests/aws/copy_object.rb +2 -2
- data/lib/fog/storage/requests/aws/delete_bucket.rb +3 -3
- data/lib/fog/storage/requests/aws/delete_object.rb +1 -1
- data/lib/fog/storage/requests/aws/get_bucket.rb +1 -1
- data/lib/fog/storage/requests/aws/get_bucket_acl.rb +1 -1
- data/lib/fog/storage/requests/aws/get_bucket_location.rb +1 -1
- data/lib/fog/storage/requests/aws/get_object.rb +1 -1
- data/lib/fog/storage/requests/aws/get_object_acl.rb +1 -1
- data/lib/fog/storage/requests/aws/get_request_payment.rb +1 -1
- data/lib/fog/storage/requests/aws/get_service.rb +1 -1
- data/lib/fog/storage/requests/aws/put_bucket.rb +3 -3
- data/lib/fog/storage/requests/aws/put_object.rb +3 -3
- data/lib/fog/storage/requests/aws/put_request_payment.rb +1 -1
- data/lib/fog/storage/requests/google/copy_object.rb +2 -2
- data/lib/fog/storage/requests/google/delete_bucket.rb +3 -3
- data/lib/fog/storage/requests/google/delete_object.rb +1 -1
- data/lib/fog/storage/requests/google/get_bucket.rb +1 -1
- data/lib/fog/storage/requests/google/get_bucket_acl.rb +1 -1
- data/lib/fog/storage/requests/google/get_object.rb +1 -1
- data/lib/fog/storage/requests/google/get_object_acl.rb +1 -1
- data/lib/fog/storage/requests/google/get_service.rb +2 -2
- data/lib/fog/storage/requests/google/put_bucket.rb +3 -3
- data/lib/fog/storage/requests/google/put_object.rb +3 -3
- data/lib/fog/terremark/requests/shared/get_network.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_organization.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_organizations.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_public_ips.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_vdc.rb +1 -1
- data/lib/fog/terremark/shared.rb +4 -0
- data/lib/fog/terremark/vcloud.rb +11 -1
- data/spec/ecloud/bin_spec.rb +8 -2
- data/spec/ecloud/spec_helper.rb +3 -3
- data/tests/compute/helper.rb +1 -3
- data/tests/compute/models/aws/server_tests.rb +3 -2
- data/tests/compute/requests/aws/instance_tests.rb +12 -9
- data/tests/compute/requests/aws/key_pair_tests.rb +1 -1
- data/tests/compute/requests/aws/volume_tests.rb +2 -2
- data/tests/compute/requests/brightbox/helper.rb +3 -0
- data/tests/compute/requests/linode/kernel_tests.rb +27 -0
- data/tests/compute/requests/linode/linode_tests.rb +62 -4
- data/tests/compute/requests/linode/stackscripts_tests.rb +35 -0
- data/tests/compute/requests/rackspace/resize_tests.rb +2 -2
- data/tests/compute/requests/voxel/server_tests.rb +1 -0
- data/tests/core/credential_tests.rb +7 -2
- data/tests/core/parser_tests.rb +1 -1
- data/tests/helper.rb +1 -1
- data/tests/helpers/compute/server_helper.rb +6 -0
- data/tests/helpers/formats_helper.rb +2 -0
- data/tests/helpers/mock_helper.rb +8 -1
- data/tests/helpers/model_helper.rb +1 -3
- data/tests/helpers/responds_to_helper.rb +2 -2
- data/tests/storage/helper.rb +1 -1
- data/tests/storage/models/directories_tests.rb +8 -4
- data/tests/storage/models/directory_test.rb +15 -11
- data/tests/storage/models/file_tests.rb +6 -6
- data/tests/storage/models/files_tests.rb +5 -5
- metadata +105 -55
@@ -0,0 +1,18 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_config_list(linode_id, config_id=nil, options={})
|
6
|
+
if config_id
|
7
|
+
options.merge!(:configid => config_id)
|
8
|
+
end
|
9
|
+
request(
|
10
|
+
:expects => 200,
|
11
|
+
:method => 'GET',
|
12
|
+
:query => { :api_action => 'linode.config.list', :linodeId => linode_id }.merge!(options)
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -5,16 +5,16 @@ module Fog
|
|
5
5
|
|
6
6
|
# Creates a linode and assigns you full privileges
|
7
7
|
#
|
8
|
-
# ==== Parameters
|
8
|
+
# ==== Parameters
|
9
9
|
# * datacenter_id<~Integer>: id of datacenter to place new linode in
|
10
|
+
# * plan_id<~Integer>: id of plan to boot new linode with
|
10
11
|
# * payment_term<~Integer>: Subscription term in months, in [1, 12, 24]
|
11
|
-
# * plan_id<~Integer>: id of plan to boot new linode with
|
12
12
|
#
|
13
13
|
# ==== Returns
|
14
14
|
# * response<~Excon::Response>:
|
15
15
|
# * body<~Array>:
|
16
16
|
# TODO: docs
|
17
|
-
def linode_create(datacenter_id,
|
17
|
+
def linode_create(datacenter_id, plan_id, payment_term)
|
18
18
|
request(
|
19
19
|
:expects => 200,
|
20
20
|
:method => 'GET',
|
@@ -26,7 +26,6 @@ module Fog
|
|
26
26
|
}
|
27
27
|
)
|
28
28
|
end
|
29
|
-
|
30
29
|
end
|
31
30
|
end
|
32
31
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_disk_create(linode_id, name, type, size)
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => {
|
10
|
+
:api_action => 'linode.disk.create',
|
11
|
+
:linodeId => linode_id,
|
12
|
+
:label => name,
|
13
|
+
:type => type,
|
14
|
+
:size => size
|
15
|
+
}
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_disk_createfromdistribution(linode_id, distro_id, name, size, password)
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => {
|
10
|
+
:api_action => 'linode.disk.createfromdistribution',
|
11
|
+
:linodeId => linode_id,
|
12
|
+
:distributionId => distro_id,
|
13
|
+
:label => name,
|
14
|
+
:size => size,
|
15
|
+
:rootPass => password
|
16
|
+
}
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_disk_createfromstackscript(linode_id, script_id, distro_id, name, size, password, options={})
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => {
|
10
|
+
:api_action => 'linode.disk.createfromstackscript',
|
11
|
+
:linodeId => linode_id,
|
12
|
+
:stackScriptID => script_id,
|
13
|
+
:distributionId => distro_id,
|
14
|
+
:label => name,
|
15
|
+
:size => size,
|
16
|
+
:rootPass => password,
|
17
|
+
:stackScriptUDFResponses => options.to_json
|
18
|
+
}
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_disk_delete(linode_id, disk_id)
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => {
|
10
|
+
:api_action => 'linode.disk.delete',
|
11
|
+
:linodeId => linode_id,
|
12
|
+
:diskId => disk_id
|
13
|
+
}
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_disk_list(linode_id, disk_id=nil)
|
6
|
+
options = {}
|
7
|
+
if disk_id
|
8
|
+
options.merge!(:diskId => disk_id)
|
9
|
+
end
|
10
|
+
request(
|
11
|
+
:expects => 200,
|
12
|
+
:method => 'GET',
|
13
|
+
:query => { :api_action => 'linode.disk.list', :linodeId => linode_id }.merge!(options)
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_ip_addprivate(linode_id)
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => { :api_action => 'linode.ip.addprivate', :linodeId => linode_id }
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_ip_list(linode_id, ip_id=nil)
|
6
|
+
options = {}
|
7
|
+
if ip_id
|
8
|
+
options.merge!(:ipaddressId => ip_id)
|
9
|
+
end
|
10
|
+
request(
|
11
|
+
:expects => 200,
|
12
|
+
:method => 'GET',
|
13
|
+
:query => { :api_action => 'linode.ip.list', :linodeId => linode_id }.merge!(options)
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -13,7 +13,7 @@ module Fog
|
|
13
13
|
# ==== Returns
|
14
14
|
# * response<~Excon::Response>:
|
15
15
|
# * body<~Array>:
|
16
|
-
# TODO: docs
|
16
|
+
# TODO: docs
|
17
17
|
def linode_reboot(linode_id, options={})
|
18
18
|
request(
|
19
19
|
:expects => 200,
|
@@ -21,7 +21,6 @@ module Fog
|
|
21
21
|
:query => { :api_action => 'linode.reboot', :linodeId => linode_id }.merge!(options)
|
22
22
|
)
|
23
23
|
end
|
24
|
-
|
25
24
|
end
|
26
25
|
end
|
27
26
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_shutdown(linode_id)
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => { :api_action => 'linode.shutdown', :linodeId => linode_id }
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
def linode_update(linode_id, options={})
|
6
|
+
request(
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:query => { :api_action => 'linode.update', :linodeId => linode_id }.merge!(options)
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Fog
|
2
|
+
module Linode
|
3
|
+
class Compute
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Get available stack scripts
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * scriptId<~Integer>: id to limit results to
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response>:
|
13
|
+
# * body<~Array>:
|
14
|
+
# TODO: docs
|
15
|
+
def stackscript_list(script_id=nil)
|
16
|
+
options = {}
|
17
|
+
if script_id
|
18
|
+
options.merge!(:stackScriptID => script_id)
|
19
|
+
end
|
20
|
+
result = request(
|
21
|
+
:expects => 200,
|
22
|
+
:method => 'GET',
|
23
|
+
:query => { :api_action => 'stackscript.list' }.merge!(options)
|
24
|
+
)
|
25
|
+
result.body['DATA'].each { |r| r['DISTRIBUTIONIDLIST'] = r['DISTRIBUTIONIDLIST'].to_s }
|
26
|
+
result
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -21,9 +21,9 @@ module Fog
|
|
21
21
|
response = Excon::Response.new
|
22
22
|
response.status = 204
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
self.data[:servers][server_id].delete('old_flavorId')
|
25
|
+
self.data[:last_modified][:servers][server_id] = Time.now
|
26
|
+
self.data[:servers][server_id]['status'] = 'ACTIVE'
|
27
27
|
|
28
28
|
response
|
29
29
|
end
|
@@ -50,8 +50,8 @@ module Fog
|
|
50
50
|
'updated' => now.to_s,
|
51
51
|
}
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
self.data[:last_modified][:images][data['id']] = now
|
54
|
+
self.data[:images][data['id']] = data
|
55
55
|
response.body = { 'image' => data.reject {|key, value| !['id', 'name', 'serverId', 'status', 'updated'].include?(key)} }
|
56
56
|
response
|
57
57
|
end
|
@@ -82,8 +82,8 @@ module Fog
|
|
82
82
|
'progress' => 0,
|
83
83
|
'status' => 'BUILD'
|
84
84
|
}
|
85
|
-
|
86
|
-
|
85
|
+
self.data[:last_modified][:servers][data['id']] = Time.now
|
86
|
+
self.data[:servers][data['id']] = data
|
87
87
|
response.body = { 'server' => data.merge({'adminPass' => 'password'}) }
|
88
88
|
response
|
89
89
|
end
|
@@ -27,8 +27,8 @@ module Fog
|
|
27
27
|
response.status = 409
|
28
28
|
raise(Excon::Errors.status_error({:expects => 202}, response))
|
29
29
|
else
|
30
|
-
|
31
|
-
|
30
|
+
self.data[:last_modified][:images].delete(image_id)
|
31
|
+
self.data[:images].delete(image_id)
|
32
32
|
response.status = 202
|
33
33
|
end
|
34
34
|
response
|
@@ -27,8 +27,8 @@ module Fog
|
|
27
27
|
response.status = 409
|
28
28
|
raise(Excon::Errors.status_error({:expects => 202}, response))
|
29
29
|
else
|
30
|
-
|
31
|
-
|
30
|
+
self.data[:last_modified][:servers].delete(server_id)
|
31
|
+
self.data[:servers].delete(server_id)
|
32
32
|
response.status = 202
|
33
33
|
end
|
34
34
|
response
|
@@ -28,11 +28,11 @@ module Fog
|
|
28
28
|
def list_images_detail
|
29
29
|
response = Excon::Response.new
|
30
30
|
|
31
|
-
images =
|
31
|
+
images = self.data[:images].values
|
32
32
|
for image in images
|
33
33
|
case image['status']
|
34
34
|
when 'SAVING'
|
35
|
-
if Time.now -
|
35
|
+
if Time.now - self.data[:last_modified][:images][image['id']] >= Fog::Mock.delay
|
36
36
|
image['status'] = 'ACTIVE'
|
37
37
|
end
|
38
38
|
end
|
@@ -35,11 +35,11 @@ module Fog
|
|
35
35
|
def list_servers_detail
|
36
36
|
response = Excon::Response.new
|
37
37
|
|
38
|
-
servers =
|
38
|
+
servers = self.data[:servers].values
|
39
39
|
for server in servers
|
40
40
|
case server['status']
|
41
41
|
when 'BUILD'
|
42
|
-
if Time.now -
|
42
|
+
if Time.now - self.data[:last_modified][:servers][server['id']] > Fog::Mock.delay * 2
|
43
43
|
server['status'] = 'ACTIVE'
|
44
44
|
end
|
45
45
|
end
|
@@ -24,11 +24,11 @@ module Fog
|
|
24
24
|
response.status = 202
|
25
25
|
|
26
26
|
# keep track of this for reverts
|
27
|
-
|
27
|
+
self.data[:servers][server_id]['old_flavorId'] = self.data[:servers][server_id]['flavorId']
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
self.data[:servers][server_id]['flavorId'] = flavor_id
|
30
|
+
self.data[:last_modified][:servers][server_id] = Time.now
|
31
|
+
self.data[:servers][server_id]['status'] = 'VERIFY_RESIZE'
|
32
32
|
|
33
33
|
response
|
34
34
|
end
|
@@ -21,10 +21,10 @@ module Fog
|
|
21
21
|
response = Excon::Response.new
|
22
22
|
response.status = 202
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
self.data[:servers][server_id]['flavorId'] = self.data[:servers][server_id]['old_flavorId']
|
25
|
+
self.data[:servers][server_id].delete('old_flavorId')
|
26
|
+
self.data[:last_modified][:servers][server_id] = Time.now
|
27
|
+
self.data[:servers][server_id]['status'] = 'ACTIVE'
|
28
28
|
|
29
29
|
response
|
30
30
|
end
|
@@ -34,6 +34,10 @@ module Fog
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def self.reset
|
38
|
+
@data = nil
|
39
|
+
end
|
40
|
+
|
37
41
|
def initialize(options={})
|
38
42
|
unless options.delete(:provider)
|
39
43
|
location = caller.first
|
@@ -43,12 +47,14 @@ module Fog
|
|
43
47
|
end
|
44
48
|
|
45
49
|
@slicehost_password = options[:slicehost_password]
|
46
|
-
|
50
|
+
end
|
51
|
+
|
52
|
+
def data
|
53
|
+
self.class.data[@slicehost_password]
|
47
54
|
end
|
48
55
|
|
49
56
|
def reset_data
|
50
57
|
self.class.data.delete(@slicehost_password)
|
51
|
-
@data = self.class.data[@slicehost_password]
|
52
58
|
end
|
53
59
|
|
54
60
|
end
|