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
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Rackspace
|
5
|
+
class AutoScale
|
6
|
+
class GroupConfig < Fog::Model
|
7
|
+
|
8
|
+
# @!attribute [r] group
|
9
|
+
# @return [Fog::Rackspace::AutoScale::Group] The parent group
|
10
|
+
attribute :group
|
11
|
+
|
12
|
+
# @!attribute [r] name
|
13
|
+
# @return [String] The name of the group
|
14
|
+
attribute :name
|
15
|
+
|
16
|
+
# @!attribute [r] cooldown
|
17
|
+
# @return [String] The group's cooldown
|
18
|
+
attribute :cooldown
|
19
|
+
|
20
|
+
# @!attribute [r] min_entities
|
21
|
+
# @return [Fixnum] The minimum amount of units which should exist in the group
|
22
|
+
attribute :min_entities, :aliases => 'minEntities'
|
23
|
+
|
24
|
+
# @!attribute [r] max_entities
|
25
|
+
# @return [Fixnum] The maximum amount of units which should exist in the group
|
26
|
+
attribute :max_entities, :aliases => 'maxEntities'
|
27
|
+
|
28
|
+
# @!attribute [r] metadata
|
29
|
+
# @return [Hash] The group's metadata
|
30
|
+
attribute :metadata
|
31
|
+
|
32
|
+
# Update this group's configuration
|
33
|
+
#
|
34
|
+
# @return [Boolean] returns true if group config has been updated
|
35
|
+
#
|
36
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
37
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
38
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
39
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
40
|
+
#
|
41
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/PUT_putGroupConfig_v1.0__tenantId__groups__groupId__config_Configurations.html
|
42
|
+
def update
|
43
|
+
|
44
|
+
options = {}
|
45
|
+
|
46
|
+
options['name'] = name unless name.nil?
|
47
|
+
options['cooldown'] = cooldown unless cooldown.nil?
|
48
|
+
options['minEntities'] = min_entities
|
49
|
+
options['maxEntities'] = max_entities
|
50
|
+
options['metadata'] = metadata unless metadata.nil?
|
51
|
+
|
52
|
+
data = service.update_group_config(group.id, options)
|
53
|
+
merge_attributes(data.body)
|
54
|
+
true
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/rackspace/models/auto_scale/group'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Rackspace
|
6
|
+
class AutoScale
|
7
|
+
class Groups < Fog::Collection
|
8
|
+
|
9
|
+
model Fog::Rackspace::AutoScale::Group
|
10
|
+
|
11
|
+
# Returns list of autoscale grouos
|
12
|
+
#
|
13
|
+
# @return [Fog::Rackspace::AutoScale::Groups] Retrieves a list images.
|
14
|
+
#
|
15
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
16
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
17
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
18
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
19
|
+
#
|
20
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroups_v1.0__tenantId__groups_Groups.html
|
21
|
+
def all
|
22
|
+
data = service.list_groups.body['groups']
|
23
|
+
load(data)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns an individual autoscale group
|
27
|
+
#
|
28
|
+
# @return [Fog::Rackspace::AutoScale::Group] Retrieves a list images.
|
29
|
+
# @return nil if not found
|
30
|
+
#
|
31
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
32
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
33
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
34
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
35
|
+
#
|
36
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getGroupManifest_v1.0__tenantId__groups__groupId__Groups.html
|
37
|
+
def get(group_id)
|
38
|
+
data = service.get_group(group_id).body['group']
|
39
|
+
new(data)
|
40
|
+
rescue Fog::Rackspace::AutoScale::NotFound
|
41
|
+
nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Rackspace
|
5
|
+
class AutoScale
|
6
|
+
class LaunchConfig < Fog::Model
|
7
|
+
|
8
|
+
# @!attribute [r] group
|
9
|
+
# @return [Fog::Rackspace::AutoScale::Group] The parent group
|
10
|
+
attribute :group
|
11
|
+
|
12
|
+
# @!attribute [r] type
|
13
|
+
# @return [Fog::Rackspace::AutoScale::Group] The type of operation (usually "launch_server")
|
14
|
+
attribute :type
|
15
|
+
|
16
|
+
# @!attribute [r] args
|
17
|
+
# @return [Fog::Rackspace::AutoScale::Group] The arguments for the operation
|
18
|
+
attribute :args
|
19
|
+
|
20
|
+
# Update this group's launch configuration
|
21
|
+
#
|
22
|
+
# @return [Boolean] returns true if launch config has been updated
|
23
|
+
#
|
24
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
25
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
26
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
27
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
28
|
+
#
|
29
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/PUT_putLaunchConfig_v1.0__tenantId__groups__groupId__launch_Configurations.html
|
30
|
+
def update
|
31
|
+
|
32
|
+
options = {}
|
33
|
+
options['type'] = type unless type.nil?
|
34
|
+
options['args'] = args unless args.nil?
|
35
|
+
|
36
|
+
data = service.update_launch_config(group.id, options)
|
37
|
+
merge_attributes(data.body['launchConfiguration'])
|
38
|
+
true
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/rackspace/models/auto_scale/policy'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Rackspace
|
6
|
+
class AutoScale
|
7
|
+
class Policies < Fog::Collection
|
8
|
+
|
9
|
+
model Fog::Rackspace::AutoScale::Policy
|
10
|
+
|
11
|
+
attr_accessor :group
|
12
|
+
|
13
|
+
# Returns list of autoscale policies
|
14
|
+
#
|
15
|
+
# @return [Fog::Rackspace::AutoScale::Policies] Retrieves policies
|
16
|
+
#
|
17
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
18
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
19
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
20
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
21
|
+
#
|
22
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getPolicies_v1.0__tenantId__groups__groupId__policies_Policies.html
|
23
|
+
def all
|
24
|
+
data = service.list_policies(group.id).body['policies']
|
25
|
+
load(data)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns an individual autoscale policy
|
29
|
+
#
|
30
|
+
# @return [Fog::Rackspace::AutoScale::Group] Retrieves a policy
|
31
|
+
# @return nil if not found
|
32
|
+
#
|
33
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
34
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
35
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
36
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
37
|
+
#
|
38
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/GET_getPolicy_v1.0__tenantId__groups__groupId__policies__policyId__Policies.html
|
39
|
+
def get(policy_id)
|
40
|
+
data = service.get_policy(group.id, policy_id).body['policy']
|
41
|
+
data['group_id'] = group.id
|
42
|
+
new(data)
|
43
|
+
rescue Fog::Rackspace::AutoScale::NotFound
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
47
|
+
# Create an autoscale policy
|
48
|
+
#
|
49
|
+
# @return [Fog::Rackspace::AutoScale::Policy] Returns the new policy
|
50
|
+
#
|
51
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
52
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
53
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
54
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
55
|
+
#
|
56
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_createPolicies_v1.0__tenantId__groups__groupId__policies_Policies.html
|
57
|
+
def create(attributes = {})
|
58
|
+
attributes['group_id'] = group.id
|
59
|
+
super(attributes)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,206 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/rackspace/models/auto_scale/webhooks'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Rackspace
|
6
|
+
class AutoScale
|
7
|
+
class Policy < Fog::Model
|
8
|
+
|
9
|
+
# @!attribute [r] id
|
10
|
+
# @return [String] The policy id
|
11
|
+
identity :id
|
12
|
+
|
13
|
+
# @!attribute [r] group_id
|
14
|
+
# @return [String] The autoscale group's id
|
15
|
+
attribute :group_id
|
16
|
+
|
17
|
+
# @!attribute [r] links
|
18
|
+
# @return [Array] Policy links
|
19
|
+
attribute :links
|
20
|
+
|
21
|
+
# @!attribute [r] name
|
22
|
+
# @return [String] The policy's name
|
23
|
+
attribute :name
|
24
|
+
|
25
|
+
# @!attribute [r] change
|
26
|
+
# @return [Fixnum] The fixed change to the autoscale group's number of units
|
27
|
+
attribute :change
|
28
|
+
|
29
|
+
# @!attribute [r] changePercent
|
30
|
+
# @return [Fixnum] The percentage change to the autoscale group's number of units
|
31
|
+
attribute :change_percent, :aliases => 'changePercent'
|
32
|
+
|
33
|
+
# @!attribute [r] cooldown
|
34
|
+
# @return [Fixnum] The policy's cooldown
|
35
|
+
attribute :cooldown
|
36
|
+
|
37
|
+
# @!attribute [r] type
|
38
|
+
# @note Can only be "webhook", "schedule" or "cloud_monitoring"
|
39
|
+
# @return [String] The policy's type
|
40
|
+
attribute :type
|
41
|
+
|
42
|
+
# @!attribute [r] args
|
43
|
+
# @example See below:
|
44
|
+
# - "cron": "23 * * * *"
|
45
|
+
# - "at": "2013-06-05T03:12Z"
|
46
|
+
# - "check": {
|
47
|
+
# "label": "Website check 1",
|
48
|
+
# "type": "remote.http",
|
49
|
+
# "details": {
|
50
|
+
# "url": "http://www.example.com",
|
51
|
+
# "method": "GET"
|
52
|
+
# },
|
53
|
+
# "monitoring_zones_poll": [
|
54
|
+
# "mzA"
|
55
|
+
# ],
|
56
|
+
# "timeout": 30,
|
57
|
+
# "period": 100,
|
58
|
+
# "target_alias": "default"
|
59
|
+
# },
|
60
|
+
# "alarm_criteria": {
|
61
|
+
# "criteria": "if (metric[\"duration\"] >= 2) { return new AlarmStatus(OK); } return new AlarmStatus(CRITICAL);"
|
62
|
+
# }
|
63
|
+
#
|
64
|
+
# @return [String] Arguments used for the policy
|
65
|
+
attribute :args
|
66
|
+
|
67
|
+
# @!attribute [r] desiredCapacity
|
68
|
+
# @return [Fixnum] The desired capacity of the group
|
69
|
+
attribute :desired_capacity, :aliases => 'desiredCapacity'
|
70
|
+
|
71
|
+
# Basic sanity check to make sure attributes are valid
|
72
|
+
#
|
73
|
+
# @raise ArgumentError If no type is set
|
74
|
+
# @raise ArgumentError If args attribute is missing required keys (if type == 'schedule')
|
75
|
+
|
76
|
+
# @return [Boolean] Returns true if the check passes
|
77
|
+
def check_attributes
|
78
|
+
raise ArgumentError, "This #{self.name} resource requires the #{type} argument" if type.nil?
|
79
|
+
|
80
|
+
if type == 'schedule'
|
81
|
+
raise ArgumentError, "This #{self.name} resource requires the args[cron] OR args[at] argument" if args['cron'].nil? && args['at'].nil?
|
82
|
+
end
|
83
|
+
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Creates policy
|
88
|
+
# * requires attributes: :name, :type, :cooldown
|
89
|
+
#
|
90
|
+
# @return [Boolean] returns true if policy is being created
|
91
|
+
#
|
92
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
93
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
94
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
95
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
96
|
+
#
|
97
|
+
# @see Policies#create
|
98
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_createPolicies_v1.0__tenantId__groups__groupId__policies_Policies.html
|
99
|
+
def save
|
100
|
+
requires :name, :type, :cooldown
|
101
|
+
|
102
|
+
check_attributes
|
103
|
+
|
104
|
+
options = {}
|
105
|
+
options['name'] = name unless name.nil?
|
106
|
+
options['change'] = change unless change.nil?
|
107
|
+
options['changePercent'] = change_percent unless change_percent.nil?
|
108
|
+
options['cooldown'] = cooldown unless cooldown.nil?
|
109
|
+
options['type'] = type unless type.nil?
|
110
|
+
options['desiredCapacity'] = desired_capacity unless desired_capacity.nil?
|
111
|
+
|
112
|
+
if type == 'schedule'
|
113
|
+
options['args'] = args
|
114
|
+
end
|
115
|
+
|
116
|
+
data = service.create_policy(group_id, options)
|
117
|
+
merge_attributes(data.body['policies'][0])
|
118
|
+
true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Updates the policy
|
122
|
+
#
|
123
|
+
# @return [Boolean] returns true if policy has started updating
|
124
|
+
#
|
125
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
126
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
127
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
128
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
129
|
+
#
|
130
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/PUT_putPolicy_v1.0__tenantId__groups__groupId__policies__policyId__Policies.html
|
131
|
+
def update
|
132
|
+
requires :identity
|
133
|
+
|
134
|
+
check_attributes
|
135
|
+
|
136
|
+
options = {}
|
137
|
+
options['name'] = name unless name.nil?
|
138
|
+
options['change'] = change unless change.nil?
|
139
|
+
options['changePercent'] = change_percent unless change_percent.nil?
|
140
|
+
options['cooldown'] = cooldown unless cooldown.nil?
|
141
|
+
options['type'] = type unless type.nil?
|
142
|
+
options['desiredCapacity'] = desired_capacity unless desired_capacity.nil?
|
143
|
+
|
144
|
+
if type == 'schedule'
|
145
|
+
options['args'] = args
|
146
|
+
end
|
147
|
+
|
148
|
+
data = service.update_policy(group_id, identity, options)
|
149
|
+
merge_attributes(data.body)
|
150
|
+
true
|
151
|
+
end
|
152
|
+
|
153
|
+
# Destroy the policy
|
154
|
+
#
|
155
|
+
# @return [Boolean] returns true if policy has started deleting
|
156
|
+
#
|
157
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
158
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
159
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
160
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
161
|
+
#
|
162
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/DELETE_deletePolicy_v1.0__tenantId__groups__groupId__policies__policyId__Policies.html
|
163
|
+
def destroy
|
164
|
+
requires :identity
|
165
|
+
service.delete_policy(group_id, identity)
|
166
|
+
true
|
167
|
+
end
|
168
|
+
|
169
|
+
# Executes the scaling policy
|
170
|
+
#
|
171
|
+
# @return [Boolean] returns true if policy has been executed
|
172
|
+
#
|
173
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
174
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
175
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
176
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
177
|
+
#
|
178
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_executePolicy_v1.0__tenantId__groups__groupId__policies__policyId__execute_Policies.html
|
179
|
+
def execute
|
180
|
+
requires :identity
|
181
|
+
service.execute_policy(group_id, identity)
|
182
|
+
true
|
183
|
+
end
|
184
|
+
|
185
|
+
# Gets the associated webhooks for this policy
|
186
|
+
#
|
187
|
+
# @return [Fog::Rackspace::AutoScale::Webhooks] returns Webhooks
|
188
|
+
#
|
189
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
190
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
191
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
192
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
193
|
+
def webhooks
|
194
|
+
data = service.list_webhooks(group_id, self.id)
|
195
|
+
|
196
|
+
Fog::Rackspace::AutoScale::Webhooks.new({
|
197
|
+
:service => service,
|
198
|
+
:policy_id => self.id,
|
199
|
+
:group_id => group_id
|
200
|
+
}).merge_attributes(data.body)
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Rackspace
|
5
|
+
class AutoScale
|
6
|
+
class Webhook < Fog::Model
|
7
|
+
|
8
|
+
# @!attribute [r] id
|
9
|
+
# @return [String] The webhook id
|
10
|
+
identity :id
|
11
|
+
|
12
|
+
# @!attribute [r] id
|
13
|
+
# @return [String] The group id (i.e. grand-parent)
|
14
|
+
attribute :group_id
|
15
|
+
|
16
|
+
# @!attribute [r] id
|
17
|
+
# @return [String] The policy id (i.e. parent)
|
18
|
+
attribute :policy_id
|
19
|
+
|
20
|
+
# @!attribute [r] name
|
21
|
+
# @return [String] The webhook name
|
22
|
+
attribute :name
|
23
|
+
|
24
|
+
# @!attribute [r] metadata
|
25
|
+
# @return [Hash] The metadata
|
26
|
+
attribute :metadata
|
27
|
+
|
28
|
+
# @!attribute [r] links
|
29
|
+
# @return [Array] The webhook links
|
30
|
+
attribute :links
|
31
|
+
|
32
|
+
# Creates webhook
|
33
|
+
# * requires attribute: :name
|
34
|
+
#
|
35
|
+
# @return [Boolean] returns true if webhook is being created
|
36
|
+
#
|
37
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
38
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
39
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
40
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
41
|
+
#
|
42
|
+
# @see Webhooks#create
|
43
|
+
# @see
|
44
|
+
def save
|
45
|
+
requires :name
|
46
|
+
|
47
|
+
options = {}
|
48
|
+
options['name'] = name if name
|
49
|
+
options['metadata'] = metadata if metadata
|
50
|
+
|
51
|
+
data = service.create_webhook(group_id, policy_id, options)
|
52
|
+
merge_attributes(data.body['webhooks'][0])
|
53
|
+
true
|
54
|
+
end
|
55
|
+
|
56
|
+
# Updates the webhook
|
57
|
+
#
|
58
|
+
# @return [Boolean] returns true if webhook has started updating
|
59
|
+
#
|
60
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
61
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
62
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
63
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
64
|
+
#
|
65
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/PUT_putWebhook_v1.0__tenantId__groups__groupId__policies__policyId__webhooks__webhookId__Webhooks.html
|
66
|
+
def update
|
67
|
+
requires :identity
|
68
|
+
|
69
|
+
options = {
|
70
|
+
'name' => name,
|
71
|
+
'metadata' => metadata
|
72
|
+
}
|
73
|
+
|
74
|
+
data = service.update_webhook(group_id, policy_id, identity, options)
|
75
|
+
merge_attributes(data.body)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Destroy the webhook
|
79
|
+
#
|
80
|
+
# @return [Boolean] returns true if webhook has started deleting
|
81
|
+
#
|
82
|
+
# @raise [Fog::Rackspace::AutoScale:::NotFound] - HTTP 404
|
83
|
+
# @raise [Fog::Rackspace::AutoScale:::BadRequest] - HTTP 400
|
84
|
+
# @raise [Fog::Rackspace::AutoScale:::InternalServerError] - HTTP 500
|
85
|
+
# @raise [Fog::Rackspace::AutoScale:::ServiceError]
|
86
|
+
#
|
87
|
+
# @see http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/DELETE_deleteWebhook_v1.0__tenantId__groups__groupId__policies__policyId__webhooks__webhookId__Webhooks.html
|
88
|
+
def destroy
|
89
|
+
requires :identity
|
90
|
+
service.delete_webhook(group_id, policy_id, identity)
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Retrieves the URL for anonymously executing the policy webhook
|
95
|
+
# @return [String] the URL
|
96
|
+
def execution_url
|
97
|
+
requires :links
|
98
|
+
link = links.find { |l| l['rel'] == 'capability' }
|
99
|
+
link['href'] rescue nil
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|