fog 1.6.0 → 1.7.0
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.
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/Rakefile +2 -1
- data/changelog.txt +184 -0
- data/docs/cdn/index.markdown +69 -3
- data/fog.gemspec +2 -2
- data/lib/fog.rb +2 -1
- data/lib/fog/atmos/models/storage/file.rb +16 -14
- data/lib/fog/aws/auto_scaling.rb +55 -13
- data/lib/fog/aws/cdn.rb +69 -9
- data/lib/fog/aws/cloud_watch.rb +15 -1
- data/lib/fog/aws/compute.rb +2 -0
- data/lib/fog/aws/models/auto_scaling/group.rb +10 -4
- data/lib/fog/aws/models/cdn/distribution.rb +93 -0
- data/lib/fog/aws/models/cdn/distribution_helper.rb +64 -0
- data/lib/fog/aws/models/cdn/distributions.rb +32 -0
- data/lib/fog/aws/models/cdn/distributions_helper.rb +47 -0
- data/lib/fog/aws/models/cdn/invalidation.rb +64 -0
- data/lib/fog/aws/models/cdn/invalidations.rb +54 -0
- data/lib/fog/aws/models/cdn/streaming_distribution.rb +77 -0
- data/lib/fog/aws/models/cdn/streaming_distributions.rb +32 -0
- data/lib/fog/aws/models/compute/server.rb +0 -23
- data/lib/fog/aws/models/compute/spot_request.rb +2 -24
- data/lib/fog/aws/models/rds/server.rb +18 -0
- data/lib/fog/aws/models/rds/subnet_group.rb +20 -0
- data/lib/fog/aws/models/rds/subnet_groups.rb +27 -0
- data/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/fog/aws/parsers/auto_scaling/describe_adjustment_types.rb +15 -2
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +39 -13
- data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_notification_types.rb +43 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_metric_collection_types.rb +3 -3
- data/lib/fog/aws/parsers/auto_scaling/describe_notification_configurations.rb +42 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_scaling_process_types.rb +15 -2
- data/lib/fog/aws/parsers/auto_scaling/describe_tags.rb +46 -0
- data/lib/fog/aws/parsers/auto_scaling/describe_termination_policy_types.rb +44 -0
- data/lib/fog/aws/parsers/cdn/get_invalidation.rb +32 -0
- data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +1 -1
- data/lib/fog/aws/parsers/cloud_watch/list_metrics.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_availability_zones.rb +13 -2
- data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +1 -1
- data/lib/fog/aws/parsers/elasticache/base.rb +0 -2
- data/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb +1 -1
- data/lib/fog/aws/parsers/elasticache/event_list.rb +2 -0
- data/lib/fog/aws/parsers/rds/base.rb +32 -0
- data/lib/fog/aws/parsers/rds/create_db_subnet_group.rb +38 -0
- data/lib/fog/aws/parsers/rds/describe_db_subnet_groups.rb +38 -0
- data/lib/fog/aws/parsers/rds/event_list.rb +40 -0
- data/lib/fog/aws/parsers/rds/subnet_group_parser.rb +38 -0
- data/lib/fog/aws/parsers/rds/tag_list_parser.rb +35 -0
- data/lib/fog/aws/rds.rb +24 -7
- data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +36 -16
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +19 -12
- data/lib/fog/aws/requests/auto_scaling/create_or_update_tags.rb +63 -0
- data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +10 -3
- data/lib/fog/aws/requests/auto_scaling/delete_notification_configuration.rb +21 -5
- data/lib/fog/aws/requests/auto_scaling/delete_policy.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/delete_tags.rb +63 -0
- data/lib/fog/aws/requests/auto_scaling/describe_adjustment_types.rb +4 -3
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb +17 -13
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_instances.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_notification_types.rb +55 -0
- data/lib/fog/aws/requests/auto_scaling/describe_metric_collection_types.rb +6 -5
- data/lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb +79 -0
- data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/describe_scaling_process_types.rb +4 -3
- data/lib/fog/aws/requests/auto_scaling/describe_tags.rb +74 -0
- data/lib/fog/aws/requests/auto_scaling/describe_termination_policy_types.rb +53 -0
- data/lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/put_notification_configuration.rb +30 -11
- data/lib/fog/aws/requests/auto_scaling/put_scaling_policy.rb +4 -4
- data/lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.rb +8 -5
- data/lib/fog/aws/requests/auto_scaling/set_desired_capacity.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/set_instance_health.rb +2 -2
- data/lib/fog/aws/requests/auto_scaling/suspend_processes.rb +1 -1
- data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +30 -18
- data/lib/fog/aws/requests/cdn/delete_distribution.rb +31 -0
- data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +30 -0
- data/lib/fog/aws/requests/cdn/get_distribution.rb +28 -0
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +29 -0
- data/lib/fog/aws/requests/cdn/get_invalidation.rb +60 -0
- data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +41 -0
- data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +26 -0
- data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +30 -0
- data/lib/fog/aws/requests/cdn/post_distribution.rb +44 -0
- data/lib/fog/aws/requests/cdn/post_invalidation.rb +33 -0
- data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +44 -0
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +28 -0
- data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +28 -0
- data/lib/fog/aws/requests/compute/create_image.rb +32 -5
- data/lib/fog/aws/requests/compute/create_subnet.rb +3 -3
- data/lib/fog/aws/requests/compute/create_volume.rb +2 -2
- data/lib/fog/aws/requests/compute/register_image.rb +1 -1
- data/lib/fog/aws/requests/elasticache/describe_events.rb +7 -4
- data/lib/fog/aws/requests/glacier/create_archive.rb +1 -1
- data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +1 -1
- data/lib/fog/aws/requests/rds/add_tags_to_resource.rb +46 -0
- data/lib/fog/aws/requests/rds/create_db_instance.rb +2 -0
- data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +58 -0
- data/lib/fog/aws/requests/rds/describe_db_subnet_groups.rb +63 -0
- data/lib/fog/aws/requests/rds/describe_events.rb +52 -0
- data/lib/fog/aws/requests/rds/list_tags_for_resource.rb +44 -0
- data/lib/fog/aws/requests/rds/remove_tags_from_resource.rb +44 -0
- data/lib/fog/aws/sqs.rb +1 -1
- data/lib/fog/aws/storage.rb +1 -1
- data/lib/fog/bin/openstack.rb +5 -0
- data/lib/fog/bluebox/models/compute/server.rb +0 -19
- data/lib/fog/bluebox/requests/compute/create_block.rb +8 -8
- data/lib/fog/brightbox/compute.rb +56 -7
- data/lib/fog/brightbox/models/compute/accounts.rb +29 -0
- data/lib/fog/brightbox/models/compute/api_client.rb +37 -0
- data/lib/fog/brightbox/models/compute/api_clients.rb +24 -0
- data/lib/fog/brightbox/models/compute/application.rb +27 -0
- data/lib/fog/brightbox/models/compute/applications.rb +28 -0
- data/lib/fog/brightbox/models/compute/server.rb +3 -1
- data/lib/fog/brightbox/models/compute/users.rb +1 -3
- data/lib/fog/brightbox/requests/compute/create_application.rb +13 -0
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +2 -2
- data/lib/fog/brightbox/requests/compute/destroy_application.rb +14 -0
- data/lib/fog/brightbox/requests/compute/get_account.rb +28 -4
- data/lib/fog/brightbox/requests/compute/get_application.rb +14 -0
- data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +19 -0
- data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +19 -0
- data/lib/fog/brightbox/requests/compute/get_user.rb +28 -5
- data/lib/fog/brightbox/requests/compute/list_accounts.rb +13 -0
- data/lib/fog/brightbox/requests/compute/list_applications.rb +13 -0
- data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +14 -0
- data/lib/fog/brightbox/requests/compute/update_account.rb +51 -3
- data/lib/fog/brightbox/requests/compute/update_application.rb +15 -0
- data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +4 -2
- data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +37 -0
- data/lib/fog/clodo/models/compute/server.rb +7 -44
- data/lib/fog/compute/models/server.rb +23 -2
- data/lib/fog/core/time.rb +2 -0
- data/lib/fog/core/wait_for.rb +0 -2
- data/lib/fog/ecloud/models/compute/servers.rb +3 -1
- data/lib/fog/ecloud/requests/compute/get_servers.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_tasks.rb +1 -1
- data/lib/fog/go_grid/models/compute/server.rb +0 -4
- data/lib/fog/google/storage.rb +1 -1
- data/lib/fog/hp/models/compute/server.rb +1 -23
- data/lib/fog/hp/storage.rb +0 -1
- data/lib/fog/joyent/models/compute/server.rb +4 -0
- data/lib/fog/joyent/models/compute/servers.rb +4 -3
- data/lib/fog/libvirt/models/compute/server.rb +1 -27
- data/lib/fog/linode/models/compute/server.rb +0 -1
- data/lib/fog/local/models/storage/directory.rb +1 -1
- data/lib/fog/network.rb +26 -0
- data/lib/fog/ninefold/compute.rb +8 -0
- data/lib/fog/ninefold/requests/compute/assign_to_load_balancer_rule.rb +13 -0
- data/lib/fog/ninefold/requests/compute/create_load_balancer_rule.rb +11 -0
- data/lib/fog/ninefold/requests/compute/delete_load_balancer_rule.rb +11 -0
- data/lib/fog/ninefold/requests/compute/list_load_balancer_rule_instances.rb +15 -0
- data/lib/fog/ninefold/requests/compute/list_load_balancer_rules.rb +14 -0
- data/lib/fog/ninefold/requests/compute/remove_from_load_balancer_rule.rb +12 -0
- data/lib/fog/ninefold/requests/compute/update_load_balancer_rule.rb +15 -0
- data/lib/fog/ninefold/storage.rb +14 -112
- data/lib/fog/openstack.rb +4 -1
- data/lib/fog/openstack/compute.rb +20 -1
- data/lib/fog/openstack/identity.rb +67 -18
- data/lib/fog/openstack/image.rb +12 -4
- data/lib/fog/openstack/models/compute/security_group.rb +1 -1
- data/lib/fog/openstack/models/compute/server.rb +5 -23
- data/lib/fog/openstack/models/identity/tenants.rb +5 -3
- data/lib/fog/openstack/models/identity/users.rb +4 -1
- data/lib/fog/openstack/models/image/image.rb +6 -1
- data/lib/fog/openstack/models/network/network.rb +46 -0
- data/lib/fog/openstack/models/network/networks.rb +34 -0
- data/lib/fog/openstack/models/network/port.rb +52 -0
- data/lib/fog/openstack/models/network/ports.rb +34 -0
- data/lib/fog/openstack/models/network/subnet.rb +55 -0
- data/lib/fog/openstack/models/network/subnets.rb +34 -0
- data/lib/fog/openstack/network.rb +234 -0
- data/lib/fog/openstack/requests/compute/attach_volume.rb +10 -0
- data/lib/fog/openstack/requests/compute/create_security_group.rb +15 -11
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +17 -15
- data/lib/fog/openstack/requests/compute/create_server.rb +7 -1
- data/lib/fog/openstack/requests/compute/create_volume.rb +10 -10
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +16 -1
- data/lib/fog/openstack/requests/compute/detach_volume.rb +5 -0
- data/lib/fog/openstack/requests/compute/get_snapshot_details.rb +4 -4
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +9 -9
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +3 -3
- data/lib/fog/openstack/requests/compute/list_volumes.rb +14 -14
- data/lib/fog/openstack/requests/identity/create_tenant.rb +3 -3
- data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
- data/lib/fog/openstack/requests/identity/delete_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/get_tenant.rb +1 -1
- data/lib/fog/openstack/requests/identity/list_roles.rb +7 -0
- data/lib/fog/openstack/requests/image/create_image.rb +36 -38
- data/lib/fog/openstack/requests/image/delete_image.rb +0 -2
- data/lib/fog/openstack/requests/image/list_public_images.rb +7 -25
- data/lib/fog/openstack/requests/image/list_public_images_detailed.rb +2 -41
- data/lib/fog/openstack/requests/image/update_image.rb +26 -21
- data/lib/fog/openstack/requests/image/update_image_members.rb +37 -0
- data/lib/fog/openstack/requests/network/create_network.rb +44 -0
- data/lib/fog/openstack/requests/network/create_port.rb +52 -0
- data/lib/fog/openstack/requests/network/create_subnet.rb +56 -0
- data/lib/fog/openstack/requests/network/delete_network.rb +30 -0
- data/lib/fog/openstack/requests/network/delete_port.rb +30 -0
- data/lib/fog/openstack/requests/network/delete_subnet.rb +30 -0
- data/lib/fog/openstack/requests/network/get_network.rb +42 -0
- data/lib/fog/openstack/requests/network/get_port.rb +48 -0
- data/lib/fog/openstack/requests/network/get_subnet.rb +49 -0
- data/lib/fog/openstack/requests/network/list_networks.rb +27 -0
- data/lib/fog/openstack/requests/network/list_ports.rb +27 -0
- data/lib/fog/openstack/requests/network/list_subnets.rb +27 -0
- data/lib/fog/openstack/requests/network/set_tenant.rb +21 -0
- data/lib/fog/openstack/requests/network/update_network.rb +41 -0
- data/lib/fog/openstack/requests/network/update_port.rb +44 -0
- data/lib/fog/openstack/requests/network/update_subnet.rb +44 -0
- data/lib/fog/openstack/requests/volume/create_volume.rb +10 -10
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +16 -1
- data/lib/fog/openstack/requests/volume/get_snapshot_details.rb +6 -6
- data/lib/fog/openstack/requests/volume/get_volume_details.rb +10 -10
- data/lib/fog/openstack/requests/volume/list_volumes.rb +14 -14
- data/lib/fog/openstack/volume.rb +10 -0
- data/lib/fog/rackspace/models/compute/server.rb +1 -24
- data/lib/fog/rackspace/models/compute_v2/server.rb +4 -2
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/server.rb +1 -5
- data/lib/fog/virtual_box/models/compute/server.rb +2 -44
- data/lib/fog/vmfusion/models/compute/server.rb +3 -36
- data/lib/fog/vsphere/models/compute/server.rb +1 -1
- data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +2 -31
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +35 -7
- data/tests/aws/models/cdn/distribution_tests.rb +15 -0
- data/tests/aws/models/cdn/distributions_tests.rb +15 -0
- data/tests/aws/models/cdn/invalidation_tests.rb +32 -0
- data/tests/aws/models/cdn/invalidations_tests.rb +15 -0
- data/tests/aws/models/cdn/streaming_distribution_tests.rb +15 -0
- data/tests/aws/models/cdn/streaming_distributions_tests.rb +15 -0
- data/tests/aws/models/rds/tagging_tests.rb +20 -0
- data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +1 -11
- data/tests/aws/requests/auto_scaling/describe_types_tests.rb +102 -0
- data/tests/aws/requests/auto_scaling/helper.rb +47 -3
- data/tests/aws/requests/auto_scaling/notification_configuration_tests.rb +123 -0
- data/tests/aws/requests/auto_scaling/tag_tests.rb +62 -0
- data/tests/aws/requests/cdn/cdn_tests.rb +252 -0
- data/tests/aws/requests/compute/image_tests.rb +32 -1
- data/tests/aws/requests/compute/volume_tests.rb +3 -3
- data/tests/aws/requests/rds/describe_events.rb +16 -0
- data/tests/aws/requests/rds/helper.rb +26 -0
- data/tests/aws/requests/rds/subnet_groups_test.rb +48 -0
- data/tests/aws/requests/rds/tagging_tests.rb +78 -0
- data/tests/brightbox/requests/compute/account_tests.rb +24 -4
- data/tests/brightbox/requests/compute/application_test.rb +63 -0
- data/tests/brightbox/requests/compute/helper.rb +49 -1
- data/tests/helper.rb +4 -1
- data/tests/local/models/directory_tests.rb +16 -0
- data/tests/ninefold/requests/compute/helper.rb +53 -0
- data/tests/ninefold/requests/compute/load_balancer_tests.rb +66 -0
- data/tests/openstack/models/image/image_tests.rb +1 -0
- data/tests/openstack/models/network/network_tests.rb +24 -0
- data/tests/openstack/models/network/networks_tests.rb +21 -0
- data/tests/openstack/models/network/port_tests.rb +28 -0
- data/tests/openstack/models/network/ports_tests.rb +25 -0
- data/tests/openstack/models/network/subnet_tests.rb +30 -0
- data/tests/openstack/models/network/subnets_tests.rb +27 -0
- data/tests/openstack/requests/compute/image_tests.rb +3 -4
- data/tests/openstack/requests/compute/quota_tests.rb +2 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +10 -10
- data/tests/openstack/requests/compute/server_tests.rb +3 -1
- data/tests/openstack/requests/compute/volume_tests.rb +11 -12
- data/tests/openstack/requests/identity/tenant_tests.rb +2 -1
- data/tests/openstack/requests/image/image_tests.rb +66 -45
- data/tests/openstack/requests/network/network_tests.rb +56 -0
- data/tests/openstack/requests/network/port_tests.rb +63 -0
- data/tests/openstack/requests/network/subnet_tests.rb +66 -0
- data/tests/rackspace/models/identity/user_tests.rb +1 -1
- data/tests/rackspace/models/identity/users_tests.rb +1 -1
- metadata +137 -13
- data/lib/fog/ninefold/models/storage/directories.rb +0 -48
- data/lib/fog/ninefold/models/storage/directory.rb +0 -53
- data/lib/fog/ninefold/models/storage/file.rb +0 -108
- data/lib/fog/ninefold/models/storage/files.rb +0 -73
- data/lib/fog/ninefold/requests/storage/delete_namespace.rb +0 -19
- data/lib/fog/ninefold/requests/storage/get_namespace.rb +0 -20
- data/lib/fog/ninefold/requests/storage/head_namespace.rb +0 -20
- data/lib/fog/ninefold/requests/storage/post_namespace.rb +0 -20
- data/lib/fog/ninefold/requests/storage/put_namespace.rb +0 -20
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/aws/models/cdn/invalidation'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module CDN
|
6
|
+
class AWS
|
7
|
+
|
8
|
+
class Invalidations < Fog::Collection
|
9
|
+
|
10
|
+
attribute :is_truncated, :aliases => ['IsTruncated']
|
11
|
+
attribute :max_items, :aliases => ['MaxItems']
|
12
|
+
attribute :next_marker, :aliases => ['NextMarker']
|
13
|
+
attribute :marker, :aliases => ['Marker']
|
14
|
+
|
15
|
+
attribute :distribution
|
16
|
+
|
17
|
+
model Fog::CDN::AWS::Invalidation
|
18
|
+
|
19
|
+
def all(options = {})
|
20
|
+
requires :distribution
|
21
|
+
options[:max_items] ||= max_items
|
22
|
+
options.delete_if {|key, value| value.nil?}
|
23
|
+
|
24
|
+
data = connection.get_invalidation_list(distribution.identity, options).body
|
25
|
+
|
26
|
+
merge_attributes(data.reject {|key, value| !['IsTruncated', 'MaxItems', 'NextMarker', 'Marker'].include?(key)})
|
27
|
+
|
28
|
+
load(data['InvalidationSummary'])
|
29
|
+
end
|
30
|
+
|
31
|
+
def get(invalidation_id)
|
32
|
+
requires :distribution
|
33
|
+
|
34
|
+
data = connection.get_invalidation(distribution.identity, invalidation_id).body
|
35
|
+
|
36
|
+
if data
|
37
|
+
invalidation = new(data)
|
38
|
+
else
|
39
|
+
nil
|
40
|
+
end
|
41
|
+
rescue Excon::Errors::NotFound
|
42
|
+
nil
|
43
|
+
end
|
44
|
+
|
45
|
+
def new(attributes = {})
|
46
|
+
requires :distribution
|
47
|
+
super({ :distribution => distribution }.merge!(attributes))
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/aws/models/cdn/invalidations'
|
3
|
+
require 'fog/aws/models/cdn/distribution_helper'
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module CDN
|
7
|
+
class AWS
|
8
|
+
|
9
|
+
class StreamingDistribution < Fog::Model
|
10
|
+
include Fog::CDN::AWS::DistributionHelper
|
11
|
+
|
12
|
+
identity :id, :aliases => 'Id'
|
13
|
+
|
14
|
+
attribute :caller_reference, :aliases => 'CallerReference'
|
15
|
+
attribute :last_modified_time, :aliases => 'LastModifiedTime'
|
16
|
+
attribute :status, :aliases => 'Status'
|
17
|
+
attribute :s3_origin, :aliases => 'S3Origin'
|
18
|
+
attribute :cname, :aliases => 'CNAME'
|
19
|
+
attribute :comment, :aliases => 'Comment'
|
20
|
+
attribute :enabled, :aliases => 'Enabled'
|
21
|
+
attribute :logging, :aliases => 'Logging'
|
22
|
+
attribute :domain, :aliases => 'DomainName'
|
23
|
+
attribute :etag, :aliases => ['Etag', 'ETag']
|
24
|
+
|
25
|
+
# items part of DistributionConfig
|
26
|
+
CONFIG = [ :caller_reference, :cname, :comment, :enabled, :logging ]
|
27
|
+
|
28
|
+
def initialize(new_attributes = {})
|
29
|
+
super(distribution_config_to_attributes(new_attributes))
|
30
|
+
end
|
31
|
+
|
32
|
+
def save
|
33
|
+
requires_one :s3_origin
|
34
|
+
options = attributes_to_options
|
35
|
+
response = identity ? put_distribution_config(identity, etag, options) : post_distribution(options)
|
36
|
+
etag = response.headers['ETag']
|
37
|
+
merge_attributes(response.body)
|
38
|
+
true
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def delete_distribution(identity, etag)
|
44
|
+
connection.delete_streaming_distribution(identity, etag)
|
45
|
+
end
|
46
|
+
|
47
|
+
def put_distribution_config(identity, etag, options)
|
48
|
+
connection.put_streaming_distribution_config(identity, etag, options)
|
49
|
+
end
|
50
|
+
|
51
|
+
def post_distribution(options = {})
|
52
|
+
connection.post_streaming_distribution(options)
|
53
|
+
end
|
54
|
+
|
55
|
+
def attributes_to_options
|
56
|
+
options = {
|
57
|
+
'CallerReference' => caller_reference,
|
58
|
+
'S3Origin' => s3_origin,
|
59
|
+
'CNAME' => cname,
|
60
|
+
'Comment' => comment,
|
61
|
+
'Enabled' => enabled,
|
62
|
+
'Logging' => logging,
|
63
|
+
}
|
64
|
+
options.reject! { |k,v| v.nil? }
|
65
|
+
options.reject! { |k,v| v.respond_to?(:empty?) && v.empty? }
|
66
|
+
options
|
67
|
+
end
|
68
|
+
|
69
|
+
def distribution_config_to_attributes(new_attributes = {})
|
70
|
+
new_attributes.merge(new_attributes.delete('StreamingDistributionConfig') || {})
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/aws/models/cdn/streaming_distribution'
|
3
|
+
require 'fog/aws/models/cdn/distributions_helper'
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module CDN
|
7
|
+
class AWS
|
8
|
+
|
9
|
+
class StreamingDistributions < Fog::Collection
|
10
|
+
include Fog::CDN::AWS::DistributionsHelper
|
11
|
+
|
12
|
+
model Fog::CDN::AWS::StreamingDistribution
|
13
|
+
|
14
|
+
attribute :marker, :aliases => 'Marker'
|
15
|
+
attribute :max_items, :aliases => 'MaxItems'
|
16
|
+
attribute :is_truncated, :aliases => 'IsTruncated'
|
17
|
+
|
18
|
+
def get_distribution(dist_id)
|
19
|
+
connection.get_streaming_distribution(dist_id)
|
20
|
+
end
|
21
|
+
|
22
|
+
def list_distributions(options = {})
|
23
|
+
connection.get_streaming_distribution_list(options)
|
24
|
+
end
|
25
|
+
|
26
|
+
alias :each_distribution_this_page :each
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -47,7 +47,6 @@ module Fog
|
|
47
47
|
attribute :vpc_id, :aliases => 'vpcId'
|
48
48
|
|
49
49
|
attr_accessor :password
|
50
|
-
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username
|
51
50
|
attr_writer :iam_instance_profile_name, :iam_instance_profile_arn
|
52
51
|
|
53
52
|
|
@@ -118,24 +117,6 @@ module Fog
|
|
118
117
|
self.key_name = new_keypair && new_keypair.name
|
119
118
|
end
|
120
119
|
|
121
|
-
def private_key_path
|
122
|
-
@private_key_path ||= Fog.credentials[:private_key_path]
|
123
|
-
@private_key_path &&= File.expand_path(@private_key_path)
|
124
|
-
end
|
125
|
-
|
126
|
-
def private_key
|
127
|
-
@private_key ||= private_key_path && File.read(private_key_path)
|
128
|
-
end
|
129
|
-
|
130
|
-
def public_key_path
|
131
|
-
@public_key_path ||= Fog.credentials[:public_key_path]
|
132
|
-
@public_key_path &&= File.expand_path(@public_key_path)
|
133
|
-
end
|
134
|
-
|
135
|
-
def public_key
|
136
|
-
@public_key ||= public_key_path && File.read(public_key_path)
|
137
|
-
end
|
138
|
-
|
139
120
|
def ready?
|
140
121
|
state == 'running'
|
141
122
|
end
|
@@ -232,10 +213,6 @@ module Fog
|
|
232
213
|
true
|
233
214
|
end
|
234
215
|
|
235
|
-
def username
|
236
|
-
@username ||= 'root'
|
237
|
-
end
|
238
|
-
|
239
216
|
def volumes
|
240
217
|
requires :id
|
241
218
|
connection.volumes(:server => self)
|
@@ -1,10 +1,10 @@
|
|
1
|
-
require 'fog/
|
1
|
+
require 'fog/compute/models/server'
|
2
2
|
|
3
3
|
module Fog
|
4
4
|
module Compute
|
5
5
|
class AWS
|
6
6
|
|
7
|
-
class SpotRequest < Fog::
|
7
|
+
class SpotRequest < Fog::Compute::Server
|
8
8
|
|
9
9
|
identity :id, :aliases => 'spotInstanceRequestId'
|
10
10
|
|
@@ -33,10 +33,6 @@ module Fog
|
|
33
33
|
attribute :fault, :squash => 'message'
|
34
34
|
attribute :user_data
|
35
35
|
|
36
|
-
attr_writer :private_key, :private_key_path, :public_key, :public_key_path
|
37
|
-
|
38
|
-
attr_writer :username
|
39
|
-
|
40
36
|
def initialize(attributes={})
|
41
37
|
self.groups ||= ["default"]
|
42
38
|
self.flavor_id ||= 't1.micro'
|
@@ -74,24 +70,6 @@ module Fog
|
|
74
70
|
def key_pair=(new_keypair)
|
75
71
|
self.key_name = new_keypair && new_keypair.name
|
76
72
|
end
|
77
|
-
|
78
|
-
def private_key_path
|
79
|
-
@private_key_path ||= Fog.credentials[:private_key_path]
|
80
|
-
@private_key_path &&= File.expand_path(@private_key_path)
|
81
|
-
end
|
82
|
-
|
83
|
-
def private_key
|
84
|
-
@private_key ||= private_key_path && File.read(private_key_path)
|
85
|
-
end
|
86
|
-
|
87
|
-
def public_key_path
|
88
|
-
@public_key_path ||= Fog.credentials[:public_key_path]
|
89
|
-
@public_key_path &&= File.expand_path(@public_key_path)
|
90
|
-
end
|
91
|
-
|
92
|
-
def public_key
|
93
|
-
@public_key ||= public_key_path && File.read(public_key_path)
|
94
|
-
end
|
95
73
|
|
96
74
|
def ready?
|
97
75
|
state == 'active'
|
@@ -60,6 +60,24 @@ module Fog
|
|
60
60
|
connection.snapshots(:server => self)
|
61
61
|
end
|
62
62
|
|
63
|
+
def tags
|
64
|
+
requires :id
|
65
|
+
connection.list_tags_for_resource(id).
|
66
|
+
body['ListTagsForResourceResult']['TagList']
|
67
|
+
end
|
68
|
+
|
69
|
+
def add_tags(new_tags)
|
70
|
+
requires :id
|
71
|
+
connection.add_tags_to_resource(id, new_tags)
|
72
|
+
tags
|
73
|
+
end
|
74
|
+
|
75
|
+
def remove_tags(tag_keys)
|
76
|
+
requires :id
|
77
|
+
connection.remove_tags_from_resource(id, tag_keys)
|
78
|
+
tags
|
79
|
+
end
|
80
|
+
|
63
81
|
def modify(immediately, options)
|
64
82
|
options[:security_group_names] ||= options['DBSecurityGroups']
|
65
83
|
params = self.class.new(options).attributes_to_params
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module AWS
|
5
|
+
class RDS
|
6
|
+
|
7
|
+
class SubnetGroup < Fog::Model
|
8
|
+
|
9
|
+
identity :id, :aliases => ['DBSubnetGroupName', :name]
|
10
|
+
attribute :description, :aliases => 'DBSubnetGroupDescription'
|
11
|
+
attribute :status, :aliases => 'SubnetGroupStatus'
|
12
|
+
attribute :vpc_id, :aliases => 'VpcId'
|
13
|
+
attribute :subnet_ids, :aliases => 'Subnets'
|
14
|
+
|
15
|
+
# TODO: ready?, save, destroy
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/aws/models/rds/subnet_group'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module AWS
|
6
|
+
class RDS
|
7
|
+
|
8
|
+
class SubnetGroups < Fog::Collection
|
9
|
+
|
10
|
+
model Fog::AWS::RDS::SubnetGroup
|
11
|
+
|
12
|
+
def all
|
13
|
+
data = connection.describe_db_subnet_groups.body['DescribeDBSubnetGroupsResult']['DBSubnetGroups']
|
14
|
+
load(data) # data is an array of attribute hashes
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(identity)
|
18
|
+
data = connection.describe_db_subnet_groups(identity).body['DescribeDBSubnetGroupsResult']['DBSubnetGroups'].first
|
19
|
+
new(data) # data is an attribute hash
|
20
|
+
rescue Fog::AWS::RDS::NotFound
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -15,15 +15,28 @@ module Fog
|
|
15
15
|
@adjustment_type = {}
|
16
16
|
end
|
17
17
|
|
18
|
+
def start_element(name, attrs = [])
|
19
|
+
super
|
20
|
+
case name
|
21
|
+
when 'AdjustmentTypes'
|
22
|
+
@in_adjustment_types = true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
18
26
|
def end_element(name)
|
19
27
|
case name
|
20
28
|
when 'member'
|
21
|
-
|
22
|
-
|
29
|
+
if @in_adjustment_types
|
30
|
+
@results['AdjustmentTypes'] << @adjustment_type
|
31
|
+
reset_adjustment_type
|
32
|
+
end
|
23
33
|
|
24
34
|
when 'AdjustmentType'
|
25
35
|
@adjustment_type[name] = value
|
26
36
|
|
37
|
+
when 'AdjustmentTypes'
|
38
|
+
@in_adjustment_types = false
|
39
|
+
|
27
40
|
when 'RequestId'
|
28
41
|
@response['ResponseMetadata'][name] = value
|
29
42
|
|
@@ -10,13 +10,21 @@ module Fog
|
|
10
10
|
reset_enabled_metric
|
11
11
|
reset_instance
|
12
12
|
reset_suspended_process
|
13
|
+
reset_tag
|
13
14
|
@results = { 'AutoScalingGroups' => [] }
|
14
15
|
@response = { 'DescribeAutoScalingGroupsResult' => {}, 'ResponseMetadata' => {} }
|
15
16
|
end
|
16
17
|
|
17
18
|
def reset_auto_scaling_group
|
18
|
-
@auto_scaling_group = {
|
19
|
-
|
19
|
+
@auto_scaling_group = {
|
20
|
+
'AvailabilityZones' => [],
|
21
|
+
'EnabledMetrics' => [],
|
22
|
+
'Instances' => [],
|
23
|
+
'LoadBalancerNames' => [],
|
24
|
+
'SuspendedProcesses' => [],
|
25
|
+
'Tags' => [],
|
26
|
+
'TerminationPolicies' => []
|
27
|
+
}
|
20
28
|
end
|
21
29
|
|
22
30
|
def reset_enabled_metric
|
@@ -31,9 +39,14 @@ module Fog
|
|
31
39
|
@suspended_process = {}
|
32
40
|
end
|
33
41
|
|
42
|
+
def reset_tag
|
43
|
+
@tag = {}
|
44
|
+
end
|
45
|
+
|
34
46
|
def start_element(name, attrs = [])
|
35
47
|
super
|
36
48
|
case name
|
49
|
+
when 'member'
|
37
50
|
when 'AvailabilityZones'
|
38
51
|
@in_availability_zones = true
|
39
52
|
when 'EnabledMetrics'
|
@@ -44,6 +57,8 @@ module Fog
|
|
44
57
|
@in_load_balancer_names = true
|
45
58
|
when 'SuspendedProcesses'
|
46
59
|
@in_suspended_processes = true
|
60
|
+
when 'Tags'
|
61
|
+
@in_tags = true
|
47
62
|
when 'TerminationPolicies'
|
48
63
|
@in_termination_policies = true
|
49
64
|
end
|
@@ -65,30 +80,24 @@ module Fog
|
|
65
80
|
elsif @in_suspended_processes
|
66
81
|
@auto_scaling_group['SuspendedProcesses'] << @suspended_process
|
67
82
|
reset_suspended_process
|
83
|
+
elsif @in_tags
|
84
|
+
@auto_scaling_group['Tags'] << @tag
|
85
|
+
reset_tag
|
68
86
|
elsif @in_termination_policies
|
69
87
|
@auto_scaling_group['TerminationPolicies'] << value
|
70
|
-
|
88
|
+
else
|
71
89
|
@results['AutoScalingGroups'] << @auto_scaling_group
|
72
90
|
reset_auto_scaling_group
|
73
91
|
end
|
74
92
|
|
75
93
|
when 'AvailabilityZones'
|
76
94
|
@in_availability_zones = false
|
77
|
-
|
95
|
+
|
78
96
|
when 'Granularity', 'Metric'
|
79
97
|
@enabled_metric[name] = value
|
80
98
|
when 'EnabledMetrics'
|
81
99
|
@in_enabled_metrics = false
|
82
100
|
|
83
|
-
when 'LaunchConfigurationName'
|
84
|
-
if @in_instances
|
85
|
-
@instance[name] = value
|
86
|
-
else
|
87
|
-
@auto_scaling_group[name] = value
|
88
|
-
end
|
89
|
-
when 'TerminationPolicies'
|
90
|
-
@in_termination_policies = false
|
91
|
-
|
92
101
|
when 'AvailabilityZone', 'HealthStatus', 'InstanceId', 'LifecycleState'
|
93
102
|
@instance[name] = value
|
94
103
|
when 'Instances'
|
@@ -102,6 +111,23 @@ module Fog
|
|
102
111
|
when 'SuspendedProcesses'
|
103
112
|
@in_suspended_processes = false
|
104
113
|
|
114
|
+
when 'Key', 'ResourceId', 'ResourceType', 'Value'
|
115
|
+
@tag[name] = value
|
116
|
+
when 'PropagateAtLaunch'
|
117
|
+
@tag[name] = (value == 'true')
|
118
|
+
when 'Tags'
|
119
|
+
@in_tags = false
|
120
|
+
|
121
|
+
when 'TerminationPolicies'
|
122
|
+
@in_termination_policies = false
|
123
|
+
|
124
|
+
when 'LaunchConfigurationName'
|
125
|
+
if @in_instances
|
126
|
+
@instance[name] = value
|
127
|
+
else
|
128
|
+
@auto_scaling_group[name] = value
|
129
|
+
end
|
130
|
+
|
105
131
|
when 'AutoScalingGroupARN', 'AutoScalingGroupName'
|
106
132
|
@auto_scaling_group[name] = value
|
107
133
|
when 'CreatedTime'
|