fog-maestrodev 1.15.0.20130829165835 → 1.15.0.20130927082724
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/fog.gemspec +5 -2
- data/lib/fog.rb +1 -0
- data/lib/fog/atmos/models/storage/file.rb +2 -1
- data/lib/fog/aws.rb +4 -1
- data/lib/fog/aws/data_pipeline.rb +3 -0
- data/lib/fog/aws/elasticache.rb +2 -0
- data/lib/fog/aws/models/auto_scaling/group.rb +12 -12
- data/lib/fog/aws/models/compute/subnet.rb +3 -1
- data/lib/fog/aws/models/elasticache/cluster.rb +3 -1
- data/lib/fog/aws/parsers/redshift/cluster.rb +29 -0
- data/lib/fog/aws/parsers/redshift/cluster_parser.rb +144 -0
- data/lib/fog/aws/parsers/redshift/cluster_security_group_parser.rb +50 -0
- data/lib/fog/aws/parsers/redshift/cluster_snapshot.rb +32 -0
- data/lib/fog/aws/parsers/redshift/cluster_snapshot_parser.rb +66 -0
- data/lib/fog/aws/parsers/redshift/cluster_subnet_group_parser.rb +51 -0
- data/lib/fog/aws/parsers/redshift/create_cluster_parameter_group.rb +30 -0
- data/lib/fog/aws/parsers/redshift/create_cluster_security_group.rb +31 -0
- data/lib/fog/aws/parsers/redshift/describe_cluster_parameter_groups.rb +41 -0
- data/lib/fog/aws/parsers/redshift/describe_cluster_parameters.rb +48 -0
- data/lib/fog/aws/parsers/redshift/describe_cluster_security_groups.rb +38 -0
- data/lib/fog/aws/parsers/redshift/describe_cluster_snapshots.rb +38 -0
- data/lib/fog/aws/parsers/redshift/describe_cluster_subnet_groups.rb +58 -0
- data/lib/fog/aws/parsers/redshift/describe_cluster_versions.rb +53 -0
- data/lib/fog/aws/parsers/redshift/describe_clusters.rb +30 -0
- data/lib/fog/aws/parsers/redshift/describe_default_cluster_parameters.rb +49 -0
- data/lib/fog/aws/parsers/redshift/describe_events.rb +44 -0
- data/lib/fog/aws/parsers/redshift/describe_orderable_cluster_options.rb +54 -0
- data/lib/fog/aws/parsers/redshift/describe_reserved_node_offerings.rb +64 -0
- data/lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb +71 -0
- data/lib/fog/aws/parsers/redshift/describe_resize.rb +60 -0
- data/lib/fog/aws/parsers/redshift/purchase_reserved_node_offering.rb +58 -0
- data/lib/fog/aws/parsers/redshift/revoke_cluster_security_group_ingress.rb +31 -0
- data/lib/fog/aws/parsers/redshift/update_cluster_parameter_group_parser.rb +29 -0
- data/lib/fog/aws/parsers/sts/get_session_token.rb +1 -3
- data/lib/fog/aws/redshift.rb +126 -0
- data/lib/fog/aws/requests/compute/run_instances.rb +2 -0
- data/lib/fog/aws/requests/data_pipeline/delete_pipeline.rb +2 -3
- data/lib/fog/aws/requests/data_pipeline/describe_objects.rb +41 -0
- data/lib/fog/aws/requests/data_pipeline/get_pipeline_definition.rb +37 -0
- data/lib/fog/aws/requests/data_pipeline/query_objects.rb +41 -0
- data/lib/fog/aws/requests/elasticache/authorize_cache_security_group_ingress.rb +27 -2
- data/lib/fog/aws/requests/elasticache/create_cache_security_group.rb +23 -2
- data/lib/fog/aws/requests/elasticache/delete_cache_security_group.rb +10 -1
- data/lib/fog/aws/requests/elasticache/describe_cache_security_groups.rb +36 -2
- data/lib/fog/aws/requests/redshift/authorize_cluster_security_group_ingress.rb +56 -0
- data/lib/fog/aws/requests/redshift/authorize_snapshot_access.rb +43 -0
- data/lib/fog/aws/requests/redshift/copy_cluster_snapshot.rb +48 -0
- data/lib/fog/aws/requests/redshift/create_cluster.rb +151 -0
- data/lib/fog/aws/requests/redshift/create_cluster_parameter_group.rb +54 -0
- data/lib/fog/aws/requests/redshift/create_cluster_security_group.rb +42 -0
- data/lib/fog/aws/requests/redshift/create_cluster_snapshot.rb +44 -0
- data/lib/fog/aws/requests/redshift/create_cluster_subnet_group.rb +50 -0
- data/lib/fog/aws/requests/redshift/delete_cluster.rb +51 -0
- data/lib/fog/aws/requests/redshift/delete_cluster_parameter_group.rb +34 -0
- data/lib/fog/aws/requests/redshift/delete_cluster_security_group.rb +33 -0
- data/lib/fog/aws/requests/redshift/delete_cluster_snapshot.rb +44 -0
- data/lib/fog/aws/requests/redshift/delete_cluster_subnet_group.rb +38 -0
- data/lib/fog/aws/requests/redshift/describe_cluster_parameter_groups.rb +48 -0
- data/lib/fog/aws/requests/redshift/describe_cluster_parameters.rb +55 -0
- data/lib/fog/aws/requests/redshift/describe_cluster_security_groups.rb +50 -0
- data/lib/fog/aws/requests/redshift/describe_cluster_snapshots.rb +73 -0
- data/lib/fog/aws/requests/redshift/describe_cluster_subnet_groups.rb +47 -0
- data/lib/fog/aws/requests/redshift/describe_cluster_versions.rb +54 -0
- data/lib/fog/aws/requests/redshift/describe_clusters.rb +49 -0
- data/lib/fog/aws/requests/redshift/describe_default_cluster_parameters.rb +49 -0
- data/lib/fog/aws/requests/redshift/describe_events.rb +80 -0
- data/lib/fog/aws/requests/redshift/describe_orderable_cluster_options.rb +55 -0
- data/lib/fog/aws/requests/redshift/describe_reserved_node_offerings.rb +48 -0
- data/lib/fog/aws/requests/redshift/describe_reserved_nodes.rb +48 -0
- data/lib/fog/aws/requests/redshift/describe_resize.rb +39 -0
- data/lib/fog/aws/requests/redshift/modify_cluster.rb +111 -0
- data/lib/fog/aws/requests/redshift/modify_cluster_parameter_group.rb +44 -0
- data/lib/fog/aws/requests/redshift/modify_cluster_subnet_group.rb +50 -0
- data/lib/fog/aws/requests/redshift/purchase_reserved_node_offering.rb +41 -0
- data/lib/fog/aws/requests/redshift/reboot_cluster.rb +37 -0
- data/lib/fog/aws/requests/redshift/reset_cluster_parameter_group.rb +57 -0
- data/lib/fog/aws/requests/redshift/restore_from_cluster_snapshot.rb +77 -0
- data/lib/fog/aws/requests/redshift/revoke_cluster_security_group_ingress.rb +56 -0
- data/lib/fog/aws/requests/redshift/revoke_snapshot_access.rb +44 -0
- data/lib/fog/aws/requests/sts/get_federation_token.rb +42 -0
- data/lib/fog/bin.rb +1 -0
- data/lib/fog/bin/aws.rb +4 -0
- data/lib/fog/bin/openstack.rb +5 -0
- data/lib/fog/bin/rackspace.rb +4 -0
- data/lib/fog/bin/vcloud_director.rb +30 -0
- data/lib/fog/brightbox/requests/compute/update_server.rb +1 -0
- data/lib/fog/cloudsigma/compute.rb +5 -0
- data/lib/fog/cloudsigma/models/fwpolicies.rb +21 -0
- data/lib/fog/cloudsigma/models/fwpolicy.rb +21 -0
- data/lib/fog/cloudsigma/models/rule.rb +21 -0
- data/lib/fog/cloudsigma/requests/list_fwpolicies.rb +18 -0
- data/lib/fog/compute.rb +7 -4
- data/lib/fog/core.rb +1 -0
- data/lib/fog/core/errors.rb +3 -0
- data/lib/fog/dynect/dns.rb +3 -1
- data/lib/fog/dynect/models/dns/records.rb +32 -20
- data/lib/fog/dynect/requests/dns/get_all_records.rb +56 -0
- data/lib/fog/dynect/requests/dns/get_node_list.rb +1 -1
- data/lib/fog/dynect/requests/dns/put_record.rb +76 -0
- data/lib/fog/google/models/compute/flavors.rb +2 -2
- data/lib/fog/google/requests/compute/get_machine_type.rb +7 -2
- data/lib/fog/joyent/compute.rb +1 -1
- data/lib/fog/linode/models/compute/server.rb +1 -1
- data/lib/fog/local/models/storage/directories.rb +1 -1
- data/lib/fog/openstack.rb +1 -0
- data/lib/fog/openstack/models/compute/images.rb +10 -2
- data/lib/fog/openstack/models/compute/server.rb +2 -0
- data/lib/fog/openstack/models/orchestration/stack.rb +52 -0
- data/lib/fog/openstack/models/orchestration/stacks.rb +21 -0
- data/lib/fog/openstack/orchestration.rb +227 -0
- data/lib/fog/openstack/requests/compute/create_server.rb +36 -25
- data/lib/fog/openstack/requests/compute/list_images_detail.rb +4 -3
- data/lib/fog/openstack/requests/orchestration/create_stack.rb +55 -0
- data/lib/fog/openstack/requests/orchestration/delete_stack.rb +36 -0
- data/lib/fog/openstack/requests/orchestration/list_stacks.rb +48 -0
- data/lib/fog/openstack/requests/orchestration/update_stack.rb +41 -0
- data/lib/fog/openstack/requests/storage/get_object.rb +7 -7
- data/lib/fog/openstack/storage.rb +2 -2
- data/lib/fog/orchestration.rb +25 -0
- data/lib/fog/rackspace.rb +1 -0
- data/lib/fog/rackspace/auto_scale.rb +132 -0
- data/lib/fog/rackspace/block_storage.rb +2 -2
- data/lib/fog/rackspace/cdn.rb +23 -23
- data/lib/fog/rackspace/compute.rb +2 -2
- data/lib/fog/rackspace/compute_v2.rb +2 -2
- data/lib/fog/rackspace/databases.rb +2 -2
- data/lib/fog/rackspace/dns.rb +14 -16
- data/lib/fog/rackspace/examples/compute_v2/create_network.rb +81 -0
- data/lib/fog/rackspace/examples/compute_v2/delete_network.rb +78 -0
- data/lib/fog/rackspace/load_balancers.rb +2 -2
- data/lib/fog/rackspace/mock_data.rb +69 -4
- data/lib/fog/rackspace/models/auto_scale/group.rb +207 -0
- data/lib/fog/rackspace/models/auto_scale/group_config.rb +60 -0
- data/lib/fog/rackspace/models/auto_scale/groups.rb +46 -0
- data/lib/fog/rackspace/models/auto_scale/launch_config.rb +44 -0
- data/lib/fog/rackspace/models/auto_scale/policies.rb +65 -0
- data/lib/fog/rackspace/models/auto_scale/policy.rb +206 -0
- data/lib/fog/rackspace/models/auto_scale/webhook.rb +105 -0
- data/lib/fog/rackspace/models/auto_scale/webhooks.rb +64 -0
- data/lib/fog/rackspace/models/block_storage/volume.rb +2 -1
- data/lib/fog/rackspace/models/monitoring/notification.rb +42 -0
- data/lib/fog/rackspace/models/monitoring/notifications.rb +30 -0
- data/lib/fog/rackspace/monitoring.rb +21 -14
- data/lib/fog/rackspace/requests/auto_scale/create_group.rb +61 -0
- data/lib/fog/rackspace/requests/auto_scale/create_policy.rb +45 -0
- data/lib/fog/rackspace/requests/auto_scale/create_webhook.rb +57 -0
- data/lib/fog/rackspace/requests/auto_scale/delete_group.rb +23 -0
- data/lib/fog/rackspace/requests/auto_scale/delete_policy.rb +31 -0
- data/lib/fog/rackspace/requests/auto_scale/delete_webhook.rb +34 -0
- data/lib/fog/rackspace/requests/auto_scale/execute_anonymous_webhook.rb +22 -0
- data/lib/fog/rackspace/requests/auto_scale/execute_policy.rb +22 -0
- data/lib/fog/rackspace/requests/auto_scale/get_group.rb +29 -0
- data/lib/fog/rackspace/requests/auto_scale/get_group_config.rb +30 -0
- data/lib/fog/rackspace/requests/auto_scale/get_group_state.rb +62 -0
- data/lib/fog/rackspace/requests/auto_scale/get_launch_config.rb +30 -0
- data/lib/fog/rackspace/requests/auto_scale/get_policy.rb +35 -0
- data/lib/fog/rackspace/requests/auto_scale/get_webhook.rb +39 -0
- data/lib/fog/rackspace/requests/auto_scale/list_groups.rb +35 -0
- data/lib/fog/rackspace/requests/auto_scale/list_policies.rb +23 -0
- data/lib/fog/rackspace/requests/auto_scale/list_webhooks.rb +33 -0
- data/lib/fog/rackspace/requests/auto_scale/pause_group_state.rb +23 -0
- data/lib/fog/rackspace/requests/auto_scale/resume_group_state.rb +23 -0
- data/lib/fog/rackspace/requests/auto_scale/update_group_config.rb +39 -0
- data/lib/fog/rackspace/requests/auto_scale/update_launch_config.rb +36 -0
- data/lib/fog/rackspace/requests/auto_scale/update_policy.rb +33 -0
- data/lib/fog/rackspace/requests/auto_scale/update_webhook.rb +44 -0
- data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +2 -2
- data/lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb +5 -6
- data/lib/fog/rackspace/requests/load_balancers/delete_load_balancer.rb +10 -0
- data/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb +30 -0
- data/lib/fog/rackspace/requests/monitoring/create_agent_token.rb +31 -0
- data/lib/fog/rackspace/requests/monitoring/create_alarm.rb +32 -0
- data/lib/fog/rackspace/requests/monitoring/create_check.rb +31 -0
- data/lib/fog/rackspace/requests/monitoring/create_entity.rb +32 -0
- data/lib/fog/rackspace/requests/monitoring/create_notification.rb +18 -0
- data/lib/fog/rackspace/requests/monitoring/delete_agent_token.rb +32 -0
- data/lib/fog/rackspace/requests/monitoring/delete_alarm.rb +27 -0
- data/lib/fog/rackspace/requests/monitoring/delete_check.rb +26 -0
- data/lib/fog/rackspace/requests/monitoring/delete_entity.rb +27 -0
- data/lib/fog/rackspace/requests/monitoring/delete_notification.rb +16 -0
- data/lib/fog/rackspace/requests/monitoring/get_agent_token.rb +33 -0
- data/lib/fog/rackspace/requests/monitoring/get_alarm.rb +38 -0
- data/lib/fog/rackspace/requests/monitoring/get_check.rb +41 -0
- data/lib/fog/rackspace/requests/monitoring/get_entity.rb +30 -21
- data/lib/fog/rackspace/requests/monitoring/get_notification.rb +50 -0
- data/lib/fog/rackspace/requests/monitoring/list_agent_tokens.rb +39 -0
- data/lib/fog/rackspace/requests/monitoring/list_alarms.rb +50 -0
- data/lib/fog/rackspace/requests/monitoring/list_check_types.rb +72 -0
- data/lib/fog/rackspace/requests/monitoring/list_checks.rb +54 -0
- data/lib/fog/rackspace/requests/monitoring/list_data_points.rb +37 -0
- data/lib/fog/rackspace/requests/monitoring/list_entities.rb +53 -0
- data/lib/fog/rackspace/requests/monitoring/list_metrics.rb +65 -0
- data/lib/fog/rackspace/requests/monitoring/list_notification_plans.rb +55 -0
- data/lib/fog/rackspace/requests/monitoring/list_notifications.rb +67 -0
- data/lib/fog/rackspace/requests/monitoring/list_overview.rb +97 -1
- data/lib/fog/rackspace/requests/monitoring/update_alarm.rb +33 -2
- data/lib/fog/rackspace/requests/monitoring/update_check.rb +32 -2
- data/lib/fog/rackspace/requests/monitoring/update_entity.rb +33 -2
- data/lib/fog/rackspace/requests/monitoring/update_notification.rb +17 -0
- data/lib/fog/rackspace/requests/storage/get_object.rb +7 -9
- data/lib/fog/rackspace/service.rb +16 -8
- data/lib/fog/rackspace/storage.rb +2 -2
- data/lib/fog/vcloud_director.rb +11 -0
- data/lib/fog/vcloud_director/README.md +967 -0
- data/lib/fog/vcloud_director/compute.rb +398 -0
- data/lib/fog/vcloud_director/generators/compute/customization.rb +100 -0
- data/lib/fog/vcloud_director/generators/compute/disks.rb +175 -0
- data/lib/fog/vcloud_director/generators/compute/metadata.rb +105 -0
- data/lib/fog/vcloud_director/generators/compute/vm_network.rb +122 -0
- data/lib/fog/vcloud_director/models/compute/catalog.rb +25 -0
- data/lib/fog/vcloud_director/models/compute/catalog_item.rb +25 -0
- data/lib/fog/vcloud_director/models/compute/catalog_items.rb +32 -0
- data/lib/fog/vcloud_director/models/compute/catalogs.rb +32 -0
- data/lib/fog/vcloud_director/models/compute/disk.rb +51 -0
- data/lib/fog/vcloud_director/models/compute/disks.rb +40 -0
- data/lib/fog/vcloud_director/models/compute/network.rb +26 -0
- data/lib/fog/vcloud_director/models/compute/networks.rb +31 -0
- data/lib/fog/vcloud_director/models/compute/organization.rb +41 -0
- data/lib/fog/vcloud_director/models/compute/organizations.rb +30 -0
- data/lib/fog/vcloud_director/models/compute/tag.rb +36 -0
- data/lib/fog/vcloud_director/models/compute/tags.rb +51 -0
- data/lib/fog/vcloud_director/models/compute/task.rb +58 -0
- data/lib/fog/vcloud_director/models/compute/tasks.rb +31 -0
- data/lib/fog/vcloud_director/models/compute/vapp.rb +56 -0
- data/lib/fog/vcloud_director/models/compute/vapps.rb +34 -0
- data/lib/fog/vcloud_director/models/compute/vdc.rb +33 -0
- data/lib/fog/vcloud_director/models/compute/vdcs.rb +32 -0
- data/lib/fog/vcloud_director/models/compute/vm.rb +99 -0
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +40 -0
- data/lib/fog/vcloud_director/models/compute/vm_customizations.rb +16 -0
- data/lib/fog/vcloud_director/models/compute/vm_network.rb +30 -0
- data/lib/fog/vcloud_director/models/compute/vm_networks.rb +21 -0
- data/lib/fog/vcloud_director/models/compute/vms.rb +41 -0
- data/lib/fog/vcloud_director/parsers/compute/disks.rb +57 -0
- data/lib/fog/vcloud_director/parsers/compute/metadata.rb +66 -0
- data/lib/fog/vcloud_director/parsers/compute/network.rb +108 -0
- data/lib/fog/vcloud_director/parsers/compute/vm.rb +82 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +56 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_network.rb +111 -0
- data/lib/fog/vcloud_director/parsers/compute/vms.rb +96 -0
- data/lib/fog/vcloud_director/parsers/compute/vms_by_metadata.rb +41 -0
- data/lib/fog/vcloud_director/requests/compute/delete_metadata.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/delete_vapp.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_catalog_item.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_current_session.rb +75 -0
- data/lib/fog/vcloud_director/requests/compute/get_href.rb +19 -0
- data/lib/fog/vcloud_director/requests/compute/get_metadata.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_network.rb +21 -0
- data/lib/fog/vcloud_director/requests/compute/get_organization.rb +72 -0
- data/lib/fog/vcloud_director/requests/compute/get_organizations.rb +37 -0
- data/lib/fog/vcloud_director/requests/compute/get_request.rb +17 -0
- data/lib/fog/vcloud_director/requests/compute/get_supported_versions.rb +1160 -0
- data/lib/fog/vcloud_director/requests/compute/get_task.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_tasks_list.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_vapp_template.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_vdc.rb +154 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_cpu.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_customization.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_disks.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_memory.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/get_vm_network.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_vms.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/get_vms_by_metadata.rb +20 -0
- data/lib/fog/vcloud_director/requests/compute/helper.rb +93 -0
- data/lib/fog/vcloud_director/requests/compute/instantiate_vapp_template.rb +124 -0
- data/lib/fog/vcloud_director/requests/compute/post_task_cancel.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/post_vapp_undeploy.rb +26 -0
- data/lib/fog/vcloud_director/requests/compute/post_vm_metadata.rb +29 -0
- data/lib/fog/vcloud_director/requests/compute/post_vm_poweroff.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/post_vm_poweron.rb +18 -0
- data/lib/fog/vcloud_director/requests/compute/put_metadata_value.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm_cpu.rb +34 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm_customization.rb +24 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm_disks.rb +25 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm_memory.rb +34 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm_network.rb +24 -0
- data/tests/aws/models/auto_scaling/groups_test.rb +5 -0
- data/tests/aws/models/compute/subnet_tests.rb +1 -1
- data/tests/aws/models/compute/subnets_tests.rb +1 -1
- data/tests/aws/requests/data_pipeline/helper.rb +38 -8
- data/tests/aws/requests/data_pipeline/pipeline_tests.rb +25 -1
- data/tests/aws/requests/elasticache/security_group_tests.rb +3 -2
- data/tests/aws/requests/redshift/cluster_parameter_group_tests.rb +77 -0
- data/tests/aws/requests/redshift/cluster_security_group_tests.rb +44 -0
- data/tests/aws/requests/redshift/cluster_snapshot_tests.rb +75 -0
- data/tests/aws/requests/redshift/cluster_tests.rb +82 -0
- data/tests/aws/requests/sts/get_federation_token_tests.rb +0 -1
- data/tests/aws/signed_params_tests.rb +12 -0
- data/tests/brightbox/compute/helper.rb +1 -0
- data/tests/brightbox/compute/schema.rb +696 -0
- data/tests/brightbox/requests/compute/account_tests.rb +7 -7
- data/tests/brightbox/requests/compute/api_client_tests.rb +6 -6
- data/tests/brightbox/requests/compute/application_test.rb +6 -6
- data/tests/brightbox/requests/compute/cloud_ip_tests.rb +7 -7
- data/tests/brightbox/requests/compute/firewall_policy_tests.rb +5 -5
- data/tests/brightbox/requests/compute/firewall_rule_tests.rb +4 -4
- data/tests/brightbox/requests/compute/helper.rb +0 -688
- data/tests/brightbox/requests/compute/image_tests.rb +2 -2
- data/tests/brightbox/requests/compute/interface_tests.rb +1 -1
- data/tests/brightbox/requests/compute/load_balancer_tests.rb +9 -9
- data/tests/brightbox/requests/compute/server_group_tests.rb +8 -8
- data/tests/brightbox/requests/compute/server_tests.rb +13 -10
- data/tests/brightbox/requests/compute/server_type_tests.rb +2 -2
- data/tests/brightbox/requests/compute/user_tests.rb +3 -3
- data/tests/brightbox/requests/compute/zone_tests.rb +2 -2
- data/tests/compute/helper.rb +3 -2
- data/tests/dynect/requests/dns/dns_tests.rb +29 -0
- data/tests/helpers/mock_helper.rb +3 -0
- data/tests/openstack/requests/compute/server_tests.rb +30 -0
- data/tests/openstack/requests/orchestration/stack_tests.rb +30 -0
- data/tests/rackspace/auto_scale_tests.rb +84 -0
- data/tests/rackspace/models/auto_scale/group.rb +19 -0
- data/tests/rackspace/models/auto_scale/groups.rb +13 -0
- data/tests/rackspace/models/auto_scale/policies.rb +23 -0
- data/tests/rackspace/models/auto_scale/policy.rb +29 -0
- data/tests/rackspace/models/auto_scale/webhook.rb +35 -0
- data/tests/rackspace/models/auto_scale/webhooks.rb +28 -0
- data/tests/rackspace/models/monitoring/notification_tests.rb +19 -0
- data/tests/rackspace/models/monitoring/notifications_tests.rb +10 -0
- data/tests/rackspace/requests/auto_scale/config_tests.rb +51 -0
- data/tests/rackspace/requests/auto_scale/group_tests.rb +38 -0
- data/tests/rackspace/requests/auto_scale/helper.rb +181 -0
- data/tests/rackspace/requests/auto_scale/policy_tests.rb +61 -0
- data/tests/rackspace/requests/auto_scale/webhook_tests.rb +49 -0
- data/tests/rackspace/requests/compute_v2/address_tests.rb +1 -1
- data/tests/rackspace/requests/monitoring/agent_tests.rb +0 -1
- data/tests/rackspace/requests/monitoring/alarm_tests.rb +3 -3
- data/tests/rackspace/requests/monitoring/check_tests.rb +0 -1
- data/tests/rackspace/requests/monitoring/entity_tests.rb +3 -12
- data/tests/rackspace/requests/monitoring/list_tests.rb +18 -6
- data/tests/rackspace/requests/monitoring/notification_tests.rb +46 -0
- data/tests/vcloud_director/models/compute/catalog_items_tests.rb +42 -0
- data/tests/vcloud_director/models/compute/catalogs_tests.rb +42 -0
- data/tests/vcloud_director/models/compute/helper.rb +67 -0
- data/tests/vcloud_director/models/compute/organizations_tests.rb +22 -0
- data/tests/vcloud_director/models/compute/vapp_life_cycle_tests.rb +98 -0
- data/tests/vcloud_director/models/compute/vapp_tests.rb +42 -0
- data/tests/vcloud_director/models/compute/vdcs_tests.rb +45 -0
- data/tests/vcloud_director/models/compute/vms_tests.rb +89 -0
- data/tests/vcloud_director/models/tools/reduced_vcr_requests.rb +27 -0
- data/tests/vcloud_director/requests/compute/organization_tests.rb +48 -0
- data/tests/vcloud_director/requests/compute/session_tests.rb +29 -0
- data/tests/vcloud_director/requests/compute/vdc_tests.rb +90 -0
- data/tests/vcloud_director/requests/compute/versions_tests.rb +28 -0
- metadata +342 -43
@@ -205,8 +205,8 @@ module Fog
|
|
205
205
|
@connection.reset
|
206
206
|
end
|
207
207
|
|
208
|
-
def request(params, parse_json = true
|
209
|
-
super
|
208
|
+
def request(params, parse_json = true)
|
209
|
+
super
|
210
210
|
rescue Excon::Errors::NotFound => error
|
211
211
|
raise NotFound.slurp(error, self)
|
212
212
|
rescue Excon::Errors::BadRequest => error
|
@@ -148,8 +148,8 @@ module Fog
|
|
148
148
|
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
|
149
149
|
end
|
150
150
|
|
151
|
-
def request(params, parse_json = true
|
152
|
-
super
|
151
|
+
def request(params, parse_json = true)
|
152
|
+
super
|
153
153
|
rescue Excon::Errors::NotFound => error
|
154
154
|
raise NotFound.slurp(error, self)
|
155
155
|
rescue Excon::Errors::BadRequest => error
|
@@ -85,8 +85,8 @@ module Fog
|
|
85
85
|
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
|
86
86
|
end
|
87
87
|
|
88
|
-
def request(params, parse_json = true
|
89
|
-
super
|
88
|
+
def request(params, parse_json = true)
|
89
|
+
super
|
90
90
|
rescue Excon::Errors::NotFound => error
|
91
91
|
raise NotFound.slurp(error, self)
|
92
92
|
rescue Excon::Errors::BadRequest => error
|
data/lib/fog/rackspace/dns.rb
CHANGED
@@ -111,22 +111,20 @@ module Fog
|
|
111
111
|
|
112
112
|
private
|
113
113
|
|
114
|
-
def request(params, parse_json = true
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
raise ServiceError.slurp(error, self)
|
129
|
-
end
|
114
|
+
def request(params, parse_json = true)
|
115
|
+
super
|
116
|
+
rescue Excon::Errors::NotFound => error
|
117
|
+
raise NotFound.slurp(error, self)
|
118
|
+
rescue Excon::Errors::BadRequest => error
|
119
|
+
raise BadRequest.slurp(error, self)
|
120
|
+
rescue Excon::Errors::InternalServerError => error
|
121
|
+
raise InternalServerError.slurp(error, self)
|
122
|
+
rescue Excon::Errors::ServiceUnavailable => error
|
123
|
+
raise ServiceUnavailable.slurp(error, self)
|
124
|
+
rescue Excon::Errors::Conflict => error
|
125
|
+
raise Conflict.slurp(error, self)
|
126
|
+
rescue Excon::Errors::HTTPStatusError => error
|
127
|
+
raise ServiceError.slurp(error, self)
|
130
128
|
end
|
131
129
|
|
132
130
|
def array_to_query_string(arr)
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This example demonstrates creating a private network and attaching it to a new server with the Rackpace Open Cloud
|
4
|
+
|
5
|
+
require 'rubygems' #required for Ruby 1.8.x
|
6
|
+
require 'fog'
|
7
|
+
|
8
|
+
# UUID for INTERNET
|
9
|
+
INTERNET = '00000000-0000-0000-0000-000000000000'
|
10
|
+
|
11
|
+
# UUID for Rackspace's service net
|
12
|
+
SERVICE_NET = '11111111-1111-1111-1111-111111111111'
|
13
|
+
|
14
|
+
def get_user_input(prompt)
|
15
|
+
print "#{prompt}: "
|
16
|
+
gets.chomp
|
17
|
+
end
|
18
|
+
|
19
|
+
# Use username defined in ~/.fog file, if absent prompt for username.
|
20
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
21
|
+
def rackspace_username
|
22
|
+
Fog.credentials[:rackspace_username] || get_user_input("Enter Rackspace Username")
|
23
|
+
end
|
24
|
+
|
25
|
+
# Use api key defined in ~/.fog file, if absent prompt for api key
|
26
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
27
|
+
def rackspace_api_key
|
28
|
+
Fog.credentials[:rackspace_api_key] || get_user_input("Enter Rackspace API key")
|
29
|
+
end
|
30
|
+
|
31
|
+
# create Next Generation Cloud Server service
|
32
|
+
service = Fog::Compute.new({
|
33
|
+
:provider => 'rackspace',
|
34
|
+
:rackspace_username => rackspace_username,
|
35
|
+
:rackspace_api_key => rackspace_api_key,
|
36
|
+
:version => :v2, # Use Next Gen Cloud Servers
|
37
|
+
:rackspace_region => :ord #Use Chicago Region
|
38
|
+
})
|
39
|
+
|
40
|
+
#create private network called my_private_net with an ip range between 192.168.0.1 - 192.168.0.255 (Note this will accept IPv6 CIDRs as well)
|
41
|
+
net = service.networks.create :label => 'my_private_net', :cidr => '192.168.0.0/24'
|
42
|
+
|
43
|
+
puts "\nCreating #{net.label} Network with CIDR #{net.cidr}"
|
44
|
+
|
45
|
+
# pick the first flavor
|
46
|
+
flavor = service.flavors.first
|
47
|
+
|
48
|
+
# pick the first Ubuntu image we can find
|
49
|
+
image = service.images.find {|image| image.name =~ /Ubuntu/}
|
50
|
+
|
51
|
+
# Create a server called alphabits connected our private network as well as the internet
|
52
|
+
server = service.servers.create :name => 'alphabits',
|
53
|
+
:flavor_id => flavor.id,
|
54
|
+
:image_id => image.id,
|
55
|
+
:networks => [net.id, INTERNET]
|
56
|
+
|
57
|
+
puts "\nNow creating server '#{server.name}' connected the the Internet and '#{net.label}'\n"
|
58
|
+
|
59
|
+
begin
|
60
|
+
# Check every 5 seconds to see if server is in the active state (ready?).
|
61
|
+
# If the server has not been built in 5 minutes (600 seconds) an exception will be raised.
|
62
|
+
server.wait_for(600, 5) do
|
63
|
+
print "."
|
64
|
+
STDOUT.flush
|
65
|
+
ready?
|
66
|
+
end
|
67
|
+
|
68
|
+
puts "[DONE]\n\n"
|
69
|
+
|
70
|
+
puts "The server has been successfully created, to login onto the server:\n\n"
|
71
|
+
puts "\t ssh #{server.username}@#{server.public_ip_address}\n\n"
|
72
|
+
|
73
|
+
rescue Fog::Errors::TimeoutError
|
74
|
+
puts "[TIMEOUT]\n\n"
|
75
|
+
|
76
|
+
puts "This server is currently #{server.progress}% into the build process and is taking longer to complete than expected."
|
77
|
+
puts "You can continute to monitor the build process through the web console at https://mycloud.rackspace.com/\n\n"
|
78
|
+
end
|
79
|
+
|
80
|
+
puts "The #{server.username} password is #{server.password}\n\n"
|
81
|
+
puts "To delete the server and private network please execute the delete_network.rb script\n\n"
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This example demonstrates deletes a private network and attaching it to a new server with the Rackpace Open Cloud
|
4
|
+
|
5
|
+
require 'rubygems' #required for Ruby 1.8.x
|
6
|
+
require 'fog'
|
7
|
+
|
8
|
+
def wait_for_server_deletion(server)
|
9
|
+
begin
|
10
|
+
server.wait_for { state = 'DELETED' }
|
11
|
+
rescue Fog::Compute::RackspaceV2::NotFound => e
|
12
|
+
# do nothing
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# I have notice that cloud networks is slow to acknowledge deleted servers. This method tries to mitigate this.
|
17
|
+
def delete_network(network)
|
18
|
+
attempt = 0
|
19
|
+
begin
|
20
|
+
network.destroy
|
21
|
+
rescue Fog::Compute::RackspaceV2::ServiceError => e
|
22
|
+
if attempt == 3
|
23
|
+
puts "Unable to delete #{network.label}"
|
24
|
+
return false
|
25
|
+
end
|
26
|
+
puts "Network #{network.label} Delete Fail Attempt #{attempt}- #{e.inspect}"
|
27
|
+
attempt += 1
|
28
|
+
sleep 60
|
29
|
+
retry
|
30
|
+
end
|
31
|
+
return true
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_user_input(prompt)
|
35
|
+
print "#{prompt}: "
|
36
|
+
gets.chomp
|
37
|
+
end
|
38
|
+
|
39
|
+
# Use username defined in ~/.fog file, if absent prompt for username.
|
40
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
41
|
+
def rackspace_username
|
42
|
+
Fog.credentials[:rackspace_username] || get_user_input("Enter Rackspace Username")
|
43
|
+
end
|
44
|
+
|
45
|
+
# Use api key defined in ~/.fog file, if absent prompt for api key
|
46
|
+
# For more details on ~/.fog refer to http://fog.io/about/getting_started.html
|
47
|
+
def rackspace_api_key
|
48
|
+
Fog.credentials[:rackspace_api_key] || get_user_input("Enter Rackspace API key")
|
49
|
+
end
|
50
|
+
|
51
|
+
# create Next Generation Cloud Server service
|
52
|
+
service = Fog::Compute.new({
|
53
|
+
:provider => 'rackspace',
|
54
|
+
:rackspace_username => rackspace_username,
|
55
|
+
:rackspace_api_key => rackspace_api_key,
|
56
|
+
:version => :v2, # Use Next Gen Cloud Servers
|
57
|
+
:rackspace_region => :ord #Use Chicago Region
|
58
|
+
})
|
59
|
+
|
60
|
+
# NOTE: The network must not be connected to any servers before deletion
|
61
|
+
|
62
|
+
# Find alpha bits server
|
63
|
+
server = service.servers.find {|s| s.name == 'alphabits'}
|
64
|
+
|
65
|
+
puts "\n"
|
66
|
+
if server
|
67
|
+
puts "Deleting alphabits server..."
|
68
|
+
server.destroy
|
69
|
+
else
|
70
|
+
puts "Unable to find server alphabits"
|
71
|
+
end
|
72
|
+
|
73
|
+
wait_for_server_deletion(server)
|
74
|
+
|
75
|
+
network = service.networks.find {|n| n.label == 'my_private_net'}
|
76
|
+
delete_network(network)
|
77
|
+
|
78
|
+
puts "The network '#{network.label}' has been successfully deleted"
|
@@ -120,8 +120,8 @@ module Fog
|
|
120
120
|
@connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
|
121
121
|
end
|
122
122
|
|
123
|
-
def request(params, parse_json = true
|
124
|
-
super
|
123
|
+
def request(params, parse_json = true)
|
124
|
+
super
|
125
125
|
rescue Excon::Errors::NotFound => error
|
126
126
|
raise NotFound.slurp(error, self)
|
127
127
|
rescue Excon::Errors::BadRequest => error
|
@@ -7,8 +7,9 @@ module Fog
|
|
7
7
|
def data
|
8
8
|
@@data ||= Hash.new do |hash, key|
|
9
9
|
hash[key] = begin
|
10
|
+
|
10
11
|
#Compute V2
|
11
|
-
flavor_id = Fog.credentials[:rackspace_flavor_id]
|
12
|
+
flavor_id = Fog.credentials[:rackspace_flavor_id] ||= '3'
|
12
13
|
image_id = Fog.credentials[:rackspace_image_id] ||= Fog::Rackspace::MockData.uuid
|
13
14
|
image_name = Fog::Mock.random_letters(6)
|
14
15
|
network_id = Fog::Rackspace::MockData.uuid
|
@@ -113,11 +114,72 @@ module Fog
|
|
113
114
|
"extra_specs" => {},
|
114
115
|
}
|
115
116
|
|
117
|
+
#AutoScale
|
118
|
+
launch_config = {
|
119
|
+
"args" => {
|
120
|
+
"loadBalancers" => [
|
121
|
+
{
|
122
|
+
"port" => 8080,
|
123
|
+
"loadBalancerId" => 9099
|
124
|
+
}
|
125
|
+
],
|
126
|
+
"server" => {
|
127
|
+
"name" => "autoscale_server",
|
128
|
+
"imageRef" => "0d589460-f177-4b0f-81c1-8ab8903ac7d8",
|
129
|
+
"flavorRef" => "2",
|
130
|
+
"OS-DCF =>diskConfig" => "AUTO",
|
131
|
+
"metadata" => {
|
132
|
+
"build_config" => "core",
|
133
|
+
"meta_key_1" => "meta_value_1",
|
134
|
+
"meta_key_2" => "meta_value_2"
|
135
|
+
},
|
136
|
+
"networks" => [
|
137
|
+
{
|
138
|
+
"uuid" => "11111111-1111-1111-1111-111111111111"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"uuid" => "00000000-0000-0000-0000-000000000000"
|
142
|
+
}
|
143
|
+
],
|
144
|
+
"personality" => [
|
145
|
+
{
|
146
|
+
"path" => "/root/.csivh",
|
147
|
+
"contents" => "VGhpcyBpcyBhIHRlc3QgZmlsZS4="
|
148
|
+
}
|
149
|
+
]
|
150
|
+
}
|
151
|
+
},
|
152
|
+
"type" => "launch_server"
|
153
|
+
}
|
154
|
+
|
155
|
+
group_config = {
|
156
|
+
"max_entities" => 10,
|
157
|
+
"cooldown" => 360,
|
158
|
+
"name" => "testscalinggroup198547",
|
159
|
+
"min_entities" => 0,
|
160
|
+
"metadata" => {
|
161
|
+
"gc_meta_key_2" => "gc_meta_value_2",
|
162
|
+
"gc_meta_key_1" => "gc_meta_value_1"
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
policy = {
|
167
|
+
"cooldown" => 0,
|
168
|
+
"type" => "webhook",
|
169
|
+
"name" => "scale up by 1",
|
170
|
+
"change" => 1
|
171
|
+
}
|
172
|
+
|
173
|
+
webhook = {
|
174
|
+
"name" => "webhook name",
|
175
|
+
"metadata" => {'foo' => 'bar'}
|
176
|
+
}
|
177
|
+
|
116
178
|
mock_data = {
|
117
179
|
#Compute V2
|
118
|
-
:flavors => Hash.new { |h,k| h[k] = flavor unless k
|
119
|
-
:images => Hash.new { |h,k| h[k] = image unless k
|
120
|
-
:networks => Hash.new { |h,k| h[k] = network unless k
|
180
|
+
:flavors => Hash.new { |h,k| h[k] = flavor unless [NOT_FOUND_ID, '0'].include?(k) },
|
181
|
+
:images => Hash.new { |h,k| h[k] = image unless [NOT_FOUND_ID, '0'].include?(k) },
|
182
|
+
:networks => Hash.new { |h,k| h[k] = network unless [NOT_FOUND_ID, '0'].include?(k) },
|
121
183
|
:keys => [],
|
122
184
|
:keypair => key_pair,
|
123
185
|
:keypairs => [],
|
@@ -128,6 +190,9 @@ module Fog
|
|
128
190
|
:snapshots => {},
|
129
191
|
:volume_attachments => [],
|
130
192
|
:volume_types => {volume_type1_id => volume_type1, volume_type2_id => volume_type2},
|
193
|
+
|
194
|
+
#Autoscale
|
195
|
+
:autoscale_groups => {}
|
131
196
|
}
|
132
197
|
|
133
198
|
# seed with initial data
|
@@ -0,0 +1,207 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/rackspace/models/auto_scale/group_config'
|
3
|
+
require 'fog/rackspace/models/auto_scale/launch_config'
|
4
|
+
require 'fog/rackspace/models/auto_scale/policies'
|
5
|
+
|
6
|
+
module Fog
|
7
|
+
module Rackspace
|
8
|
+
class AutoScale
|
9
|
+
class Group < Fog::Model
|
10
|
+
|
11
|
+
# @!attribute [r] id
|
12
|
+
# @return [String] The autoscale group's id
|
13
|
+
identity :id
|
14
|
+
|
15
|
+
# @!attribute [r] links
|
16
|
+
# @return [Array] group links.
|
17
|
+
attribute :links
|
18
|
+
|
19
|
+
# Gets the group configuration for this autoscale group. The configuration describes the
|
20
|
+
# minimum number of entities in the group, the maximum number of entities in the group,
|
21
|
+
# the global cooldown time for the group, and other metadata.
|
22
|
+
#
|
23
|
+
# @return [Fog::Rackspace::AutoScale::GroupConfiguration] group_config if found
|
24
|
+
#
|
25
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
26
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
27
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
28
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
29
|
+
#
|
30
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroupConfig_v1.0__tenantId__groups__groupId__config_Configurations.html
|
31
|
+
def group_config
|
32
|
+
if attributes[:group_config].nil?
|
33
|
+
data = service.get_group_config(identity)
|
34
|
+
attributes[:group_config] = load_model('GroupConfig', data.body['groupConfiguration'])
|
35
|
+
end
|
36
|
+
attributes[:group_config]
|
37
|
+
end
|
38
|
+
|
39
|
+
# Sets the configuration when this object is populated.
|
40
|
+
#
|
41
|
+
# @param object [Hash<String, String>] Object which will stock the object
|
42
|
+
def group_config=(object = {})
|
43
|
+
if object.is_a?(Hash)
|
44
|
+
attributes[:group_config] = load_model('GroupConfig', object)
|
45
|
+
else
|
46
|
+
attributes[:group_config] = object
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Gets the launch configuration for this autoscale group. The launch configuration describes
|
51
|
+
# the details of how to create a server, from what image to create a server, which load balancers
|
52
|
+
# to join the server to, which networks to add the server to, and other metadata.
|
53
|
+
#
|
54
|
+
# @return [Fog::Rackspace::AutoScale::LaunchConfiguration] group_config if found
|
55
|
+
#
|
56
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
57
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
58
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
59
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
60
|
+
#
|
61
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getLaunchConfig_v1.0__tenantId__groups__groupId__launch_Configurations.html
|
62
|
+
def launch_config
|
63
|
+
if attributes[:launch_config].nil?
|
64
|
+
data = service.get_launch_config(identity)
|
65
|
+
attributes[:launch_config] = load_model('LaunchConfig', data.body['launchConfiguration'])
|
66
|
+
end
|
67
|
+
attributes[:launch_config]
|
68
|
+
end
|
69
|
+
|
70
|
+
# Sets the configuration when this object is populated.
|
71
|
+
#
|
72
|
+
# @param object [Hash<String, String>] Object which will stock the object
|
73
|
+
def launch_config=(object={})
|
74
|
+
if object.is_a?(Hash)
|
75
|
+
attributes[:launch_config] = load_model('LaunchConfig', object)
|
76
|
+
else
|
77
|
+
attributes[:launch_config] = object
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# For the specified autoscaling group, this operation returns a list of the scaling policies
|
82
|
+
# that are available to the group. Each policy is described in terms of an ID, name, type,
|
83
|
+
# adjustment, cooldown time, and links.
|
84
|
+
#
|
85
|
+
# @return [Fog::Rackspace::AutoScale::Policies] policies
|
86
|
+
#
|
87
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getPolicies_v1.0__tenantId__groups__groupId__policies_Policies.html
|
88
|
+
def policies
|
89
|
+
@policies ||= load_model('Policies')
|
90
|
+
end
|
91
|
+
|
92
|
+
# Creates group
|
93
|
+
# * requires attributes: :launch_config, :group_config, :policies
|
94
|
+
#
|
95
|
+
# @return [Boolean] returns true if group is being created
|
96
|
+
#
|
97
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
98
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
99
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
100
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
101
|
+
#
|
102
|
+
# @see Groups#create
|
103
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_createGroup_v1.0__tenantId__groups_Groups.html
|
104
|
+
def save
|
105
|
+
requires :launch_config, :group_config, :policies
|
106
|
+
|
107
|
+
launch_config_hash = {
|
108
|
+
'args' => launch_config.args,
|
109
|
+
'type' => launch_config.type
|
110
|
+
}
|
111
|
+
group_config_hash = {
|
112
|
+
'name' => group_config.name,
|
113
|
+
'cooldown' => group_config.cooldown,
|
114
|
+
'maxEntities' => group_config.max_entities,
|
115
|
+
'minEntities' => group_config.min_entities
|
116
|
+
}
|
117
|
+
group_config_hash['metadata'] = group_config.metadata if group_config.metadata
|
118
|
+
|
119
|
+
data = service.create_group(launch_config_hash, group_config_hash, policies)
|
120
|
+
merge_attributes(data.body['group'])
|
121
|
+
true
|
122
|
+
end
|
123
|
+
|
124
|
+
# Destroy the group
|
125
|
+
#
|
126
|
+
# @return [Boolean] returns true if group has started deleting
|
127
|
+
#
|
128
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
129
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
130
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
131
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
132
|
+
#
|
133
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/DELETE_deleteGroup_v1.0__tenantId__groups__groupId__Groups.html
|
134
|
+
def destroy
|
135
|
+
requires :identity
|
136
|
+
service.delete_group(identity)
|
137
|
+
true
|
138
|
+
end
|
139
|
+
|
140
|
+
# Get the current state of the autoscale group
|
141
|
+
#
|
142
|
+
# @return [String] the state of the group
|
143
|
+
#
|
144
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
145
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
146
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
147
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
148
|
+
#
|
149
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroupState_v1.0__tenantId__groups__groupId__state_Groups.html
|
150
|
+
def state
|
151
|
+
requires :identity
|
152
|
+
data = service.get_group_state(identity)
|
153
|
+
data.body['group']
|
154
|
+
end
|
155
|
+
|
156
|
+
# This operation pauses all execution of autoscaling policies.
|
157
|
+
#
|
158
|
+
# @note NOT IMPLEMENTED YET
|
159
|
+
# @return [Boolean] returns true if paused
|
160
|
+
#
|
161
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
162
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
163
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
164
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
165
|
+
#
|
166
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_pauseGroup_v1.0__tenantId__groups__groupId__pause_Groups.html
|
167
|
+
def pause
|
168
|
+
requires :identity
|
169
|
+
data = service.pause_group_state(identity)
|
170
|
+
true
|
171
|
+
end
|
172
|
+
|
173
|
+
# This operation resumes all execution of autoscaling policies.
|
174
|
+
#
|
175
|
+
# @note NOT IMPLEMENTED YET
|
176
|
+
# @return [Boolean] returns true if resumed
|
177
|
+
#
|
178
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
179
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
180
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
181
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
182
|
+
#
|
183
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_resumeGroup_v1.0__tenantId__groups__groupId__resume_Groups.html
|
184
|
+
def resume
|
185
|
+
requires :identity
|
186
|
+
data = service.resume_group_state(identity)
|
187
|
+
true
|
188
|
+
end
|
189
|
+
|
190
|
+
private
|
191
|
+
|
192
|
+
def load_model(class_name, attrs = nil)
|
193
|
+
# Can use either Kernel.const_get or do an eval() - first is quicker
|
194
|
+
model = Kernel.const_get("Fog::Rackspace::AutoScale::#{class_name}").new({
|
195
|
+
:service => @service,
|
196
|
+
:group => self
|
197
|
+
})
|
198
|
+
if service && attrs
|
199
|
+
model.merge_attributes(attrs)
|
200
|
+
end
|
201
|
+
model
|
202
|
+
end
|
203
|
+
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|