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
@@ -11,8 +11,104 @@ module Fog
|
|
11
11
|
:query => options
|
12
12
|
)
|
13
13
|
end
|
14
|
-
|
15
14
|
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
def list_overview(options={})
|
18
|
+
|
19
|
+
alarm_id = Fog::Mock.random_letters(10)
|
20
|
+
check_id = Fog::Mock.random_letters(10)
|
21
|
+
entity_id = Fog::Mock.random_letters(10)
|
22
|
+
account_id = Fog::Mock.random_numbers(6).to_s
|
23
|
+
server_id = Fog::Rackspace::MockData.uuid
|
24
|
+
|
25
|
+
response = Excon::Response.new
|
26
|
+
response.status = 200
|
27
|
+
response.body = {
|
28
|
+
"values" => [
|
29
|
+
{
|
30
|
+
"entity" => {
|
31
|
+
"id" => entity_id,
|
32
|
+
"label" => "mock_entity",
|
33
|
+
"ip_addresses" => {
|
34
|
+
"access_ip0_v6" => Fog::Rackspace::MockData.ipv6_address,
|
35
|
+
"public0_v4" => Fog::Rackspace::MockData.ipv4_address,
|
36
|
+
"public1_v6" => Fog::Rackspace::MockData.ipv6_address,
|
37
|
+
"access_ip1_v4" => Fog::Rackspace::MockData.ipv4_address,
|
38
|
+
"private0_v4" => Fog::Rackspace::MockData.ipv4_address
|
39
|
+
},
|
40
|
+
"metadata" => {
|
41
|
+
"testing" => "Bar"
|
42
|
+
},
|
43
|
+
"managed" => false,
|
44
|
+
"uri" => "https://ord.servers.api.rackspacecloud.com/" + account_id + "/servers/" + server_id,
|
45
|
+
"agent_id" => nil,
|
46
|
+
"created_at" => Time.now.to_i - 1,
|
47
|
+
"updated_at" => Time.now.to_i
|
48
|
+
},
|
49
|
+
"checks" => [
|
50
|
+
{
|
51
|
+
"id" => check_id,
|
52
|
+
"label" => "mock",
|
53
|
+
"type" => "remote.mock",
|
54
|
+
"details" => {},
|
55
|
+
"monitoring_zones_poll" => nil,
|
56
|
+
"timeout" => 10,
|
57
|
+
"period" => 30,
|
58
|
+
"target_alias" => nil,
|
59
|
+
"target_hostname" => nil,
|
60
|
+
"target_resolver" => nil,
|
61
|
+
"disabled " => false,
|
62
|
+
"metadata" => nil,
|
63
|
+
"created_at" => Time.now.to_i - 1,
|
64
|
+
"updated_at" => Time.now.to_i
|
65
|
+
}
|
66
|
+
],
|
67
|
+
"alarms" => [
|
68
|
+
{
|
69
|
+
"id" => alarm_id,
|
70
|
+
"label" => nil,
|
71
|
+
"check_id" => check_id,
|
72
|
+
"criteria" => nil,
|
73
|
+
"disabled" => false,
|
74
|
+
"notification_plan_id" => "npTechnicalContactsEmail",
|
75
|
+
"metadata" => nil,
|
76
|
+
"created_at" => Time.now.to_i - 1,
|
77
|
+
"updated_at" => Time.now.to_i
|
78
|
+
}
|
79
|
+
],
|
80
|
+
"latest_alarm_states" => []
|
81
|
+
}
|
82
|
+
],
|
83
|
+
|
84
|
+
"metadata" => {
|
85
|
+
"count" => 1,
|
86
|
+
"limit" => 100,
|
87
|
+
"marker" => nil,
|
88
|
+
"next_marker" => nil,
|
89
|
+
"next_href" => nil
|
90
|
+
}
|
91
|
+
|
92
|
+
}
|
93
|
+
|
94
|
+
response.headers = {
|
95
|
+
"Date" => Time.now.utc.to_s,
|
96
|
+
"Content-Type" => "application/json; charset=UTF-8",
|
97
|
+
"X-RateLimit-Limit" => "50000",
|
98
|
+
"X-RateLimit-Remaining" => "49627",
|
99
|
+
"X-RateLimit-Window" => "24 hours",
|
100
|
+
"X-RateLimit-Type" => "global",
|
101
|
+
"X-Response-Id" =>" zsdvasdtrq345",
|
102
|
+
"X-LB" => "dfw1-maas-prod-api0",
|
103
|
+
"Vary" => "Accept-Encoding",
|
104
|
+
"Transfer-Encoding" => "chunked"
|
105
|
+
}
|
106
|
+
|
107
|
+
response.remote_ip = Fog::Rackspace::MockData.ipv4_address
|
108
|
+
response
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
16
112
|
end
|
17
113
|
end
|
18
114
|
end
|
@@ -3,15 +3,46 @@ module Fog
|
|
3
3
|
class Monitoring
|
4
4
|
class Real
|
5
5
|
|
6
|
-
def update_alarm(entity_id,
|
6
|
+
def update_alarm(entity_id, alarm_id, options)
|
7
7
|
request(
|
8
8
|
:body => JSON.encode(options),
|
9
9
|
:expects => [204],
|
10
10
|
:method => 'PUT',
|
11
|
-
:path => "entities/#{entity_id}/alarms/#{
|
11
|
+
:path => "entities/#{entity_id}/alarms/#{alarm_id}"
|
12
12
|
)
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
|
18
|
+
def update_alarm(entity_id, alarm_id, options)
|
19
|
+
|
20
|
+
account_id = Fog::Mock.random_numbers(6).to_s
|
21
|
+
|
22
|
+
if entity_id == -1 || alarm_id == -1 || options[:testing]
|
23
|
+
raise Fog::Rackspace::Monitoring::NotFound
|
24
|
+
end
|
25
|
+
|
26
|
+
response = Excon::Response.new
|
27
|
+
response.status = 204
|
28
|
+
response.body = ""
|
29
|
+
response.headers = {
|
30
|
+
"Date" => Time.now.utc.to_s,
|
31
|
+
"Location" => "https://monitoring.api.rackspacecloud.com/v1.0/" + account_id + "/entities/" + entity_id.to_s + "/alarms/" + alarm_id,
|
32
|
+
"X-Object-ID" => alarm_id,
|
33
|
+
"X-RateLimit-Limit" => "50000",
|
34
|
+
"X-RateLimit-Remaining" => "47877",
|
35
|
+
"X-RateLimit-Window" => "24 hours",
|
36
|
+
"X-RateLimit-Type" => "global",
|
37
|
+
"X-Response-Id" => "laolsgggopsnfksdovnsv",
|
38
|
+
"X-LB" => "dfw1-maas-prod-api1",
|
39
|
+
"Content-Length" => "0",
|
40
|
+
"Content-Type" => "text/plain"
|
41
|
+
}
|
42
|
+
response.remote_ip = Fog::Rackspace::MockData.ipv4_address
|
43
|
+
response
|
44
|
+
end
|
45
|
+
end
|
15
46
|
end
|
16
47
|
end
|
17
48
|
end
|
@@ -3,15 +3,45 @@ module Fog
|
|
3
3
|
class Monitoring
|
4
4
|
class Real
|
5
5
|
|
6
|
-
def update_check(entity_id,
|
6
|
+
def update_check(entity_id, check_id, options)
|
7
7
|
request(
|
8
8
|
:body => JSON.encode(options),
|
9
9
|
:expects => [204],
|
10
10
|
:method => 'PUT',
|
11
|
-
:path => "entities/#{entity_id}/checks/#{
|
11
|
+
:path => "entities/#{entity_id}/checks/#{check_id}"
|
12
12
|
)
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
def update_check(entity_id, check_id, options)
|
18
|
+
|
19
|
+
account_id = Fog::Mock.random_numbers(6).to_s
|
20
|
+
|
21
|
+
if entity_id == -1 || check_id == -1 || options[:testing]
|
22
|
+
raise Fog::Rackspace::Monitoring::NotFound
|
23
|
+
end
|
24
|
+
|
25
|
+
response = Excon::Response.new
|
26
|
+
response.status = 204
|
27
|
+
response.body = ""
|
28
|
+
response.headers = {
|
29
|
+
"Date" => Time.now.utc.to_s,
|
30
|
+
"Location" => "https://monitoring.api.rackspacecloud.com/v1.0/" + account_id + "/entities/" + entity_id + "/checks/" + check_id,
|
31
|
+
"X-Object-ID" => check_id,
|
32
|
+
"X-RateLimit-Limit" => "50000",
|
33
|
+
"X-RateLimit-Remaining" => "49627",
|
34
|
+
"X-RateLimit-Window" => "24 hours",
|
35
|
+
"X-RateLimit-Type" => "global",
|
36
|
+
"X-Response-Id" => "owbgowb989wno73ubgvw89",
|
37
|
+
"X-LB" => "ord1-maas-prod-api1",
|
38
|
+
"Content-Length" => "0",
|
39
|
+
"Content-Type" => "text/plain",
|
40
|
+
}
|
41
|
+
response.remote_ip = Fog::Rackspace::MockData.ipv4_address
|
42
|
+
response
|
43
|
+
end
|
44
|
+
end
|
15
45
|
end
|
16
46
|
end
|
17
47
|
end
|
@@ -3,15 +3,46 @@ module Fog
|
|
3
3
|
class Monitoring
|
4
4
|
class Real
|
5
5
|
|
6
|
-
def update_entity(
|
6
|
+
def update_entity(entity_id, options)
|
7
7
|
request(
|
8
8
|
:body => JSON.encode(options),
|
9
9
|
:expects => [204],
|
10
10
|
:method => 'PUT',
|
11
|
-
:path => "entities/#{
|
11
|
+
:path => "entities/#{entity_id}"
|
12
12
|
)
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
class Mock
|
17
|
+
|
18
|
+
def update_entity(entity_id, options)
|
19
|
+
|
20
|
+
account_id = Fog::Mock.random_numbers(6).to_s
|
21
|
+
|
22
|
+
if entity_id == -1
|
23
|
+
raise Fog::Rackspace::Monitoring::NotFound
|
24
|
+
end
|
25
|
+
|
26
|
+
response = Excon::Response.new
|
27
|
+
response.status = 204
|
28
|
+
response.body = ""
|
29
|
+
response.headers = {
|
30
|
+
"Date" => Time.now.utc.to_s,
|
31
|
+
"Location" => "https://monitoring.api.rackspacecloud.com/v1.0/" + account_id + "/entities/" + entity_id.to_s,
|
32
|
+
"X-Object-ID" => entity_id.to_s,
|
33
|
+
"X-RateLimit-Limit" => "50000",
|
34
|
+
"X-RateLimit-Remaining" => "47877",
|
35
|
+
"X-RateLimit-Window" => "24 hours",
|
36
|
+
"X-RateLimit-Type" => "global",
|
37
|
+
"X-Response-Id" => "lakbngf9bsgkn69gb39sobnsv",
|
38
|
+
"X-LB" => "dfw1-maas-prod-api1",
|
39
|
+
"Content-Length" => "0",
|
40
|
+
"Content-Type" => "text/plain"
|
41
|
+
}
|
42
|
+
response.remote_ip = Fog::Rackspace::MockData.ipv4_address
|
43
|
+
response
|
44
|
+
end
|
45
|
+
end
|
15
46
|
end
|
16
47
|
end
|
17
48
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Monitoring
|
4
|
+
class Real
|
5
|
+
def update_notification(id, options)
|
6
|
+
request(
|
7
|
+
:body => JSON.encode(options),
|
8
|
+
:expects => [204],
|
9
|
+
:method => 'PUT',
|
10
|
+
:path => "notifications/#{id}"
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -13,19 +13,17 @@ module Fog
|
|
13
13
|
# @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500
|
14
14
|
# @raise [Fog::Storage::Rackspace::ServiceError]
|
15
15
|
def get_object(container, object, &block)
|
16
|
-
params = {
|
16
|
+
params = {
|
17
|
+
:expects => 200,
|
18
|
+
:method => 'GET',
|
19
|
+
:path => "#{Fog::Rackspace.escape(container)}/#{Fog::Rackspace.escape(object)}"
|
20
|
+
}
|
17
21
|
|
18
22
|
if block_given?
|
19
|
-
params[:response_block] =
|
23
|
+
params[:response_block] = block
|
20
24
|
end
|
21
25
|
|
22
|
-
request(params
|
23
|
-
:expects => 200,
|
24
|
-
:method => 'GET',
|
25
|
-
:path => "#{Fog::Rackspace.escape(container)}/#{Fog::Rackspace.escape(object)}"
|
26
|
-
}),
|
27
|
-
false,
|
28
|
-
&block)
|
26
|
+
request(params, false)
|
29
27
|
end
|
30
28
|
|
31
29
|
end
|
@@ -30,17 +30,17 @@ module Fog
|
|
30
30
|
self.send authentication_method, options
|
31
31
|
end
|
32
32
|
|
33
|
-
def request_without_retry(params, parse_json = true
|
34
|
-
response = @connection.request(request_params(params)
|
33
|
+
def request_without_retry(params, parse_json = true)
|
34
|
+
response = @connection.request(request_params(params))
|
35
35
|
|
36
36
|
process_response(response) if parse_json
|
37
37
|
response
|
38
38
|
end
|
39
39
|
|
40
|
-
def request(params, parse_json = true
|
40
|
+
def request(params, parse_json = true)
|
41
41
|
first_attempt = true
|
42
42
|
begin
|
43
|
-
response = @connection.request(request_params(params)
|
43
|
+
response = @connection.request(request_params(params))
|
44
44
|
rescue Excon::Errors::Unauthorized => error
|
45
45
|
raise error unless first_attempt
|
46
46
|
first_attempt = false
|
@@ -55,7 +55,11 @@ module Fog
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def process_response(response)
|
58
|
-
if response &&
|
58
|
+
if response &&
|
59
|
+
response.body &&
|
60
|
+
response.body.is_a?(String) &&
|
61
|
+
!response.body.strip.empty? &&
|
62
|
+
Fog::Rackspace.json_response?(response)
|
59
63
|
begin
|
60
64
|
response.body = Fog::JSON.decode(response.body)
|
61
65
|
rescue MultiJson::DecodeError => e
|
@@ -66,8 +70,7 @@ module Fog
|
|
66
70
|
end
|
67
71
|
|
68
72
|
def headers(options={})
|
69
|
-
|
70
|
-
'Content-Type' => 'application/json',
|
73
|
+
{ 'Content-Type' => 'application/json',
|
71
74
|
'Accept' => 'application/json',
|
72
75
|
'X-Auth-Token' => auth_token
|
73
76
|
}.merge(options[:headers] || {})
|
@@ -85,7 +88,7 @@ module Fog
|
|
85
88
|
if v2_authentication?
|
86
89
|
:authenticate_v2
|
87
90
|
else
|
88
|
-
Fog::Logger.deprecation "Authentication using a v1.0/v1.1 endpoint is deprecated. Please specify a v2.0 endpoint using :rackpace_auth_url.\
|
91
|
+
Fog::Logger.deprecation "Authentication using a v1.0/v1.1 endpoint is deprecated. Please specify a v2.0 endpoint using :rackpace_auth_url.\
|
89
92
|
For a list of v2.0 endpoints refer to http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/Endpoints-d1e180.html"
|
90
93
|
:authenticate_v1
|
91
94
|
end
|
@@ -123,6 +126,11 @@ module Fog
|
|
123
126
|
@auth_token || @identity_service.auth_token
|
124
127
|
end
|
125
128
|
|
129
|
+
def select_options(keys)
|
130
|
+
return nil unless @options && keys
|
131
|
+
@options.select {|k,v| keys.include?(k)}
|
132
|
+
end
|
133
|
+
|
126
134
|
end
|
127
135
|
end
|
128
136
|
end
|
@@ -145,8 +145,8 @@ module Fog
|
|
145
145
|
@connection.reset
|
146
146
|
end
|
147
147
|
|
148
|
-
def request(params, parse_json = true
|
149
|
-
super
|
148
|
+
def request(params, parse_json = true)
|
149
|
+
super
|
150
150
|
rescue Excon::Errors::NotFound => error
|
151
151
|
raise NotFound.slurp(error, self)
|
152
152
|
rescue Excon::Errors::BadRequest => error
|
@@ -0,0 +1,967 @@
|
|
1
|
+
# VMware vCloud Director 5.1 API client
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Collection and Model representation in vcloud_director fog provider.
|
6
|
+
|
7
|
+
```no-highlight
|
8
|
+
Organizations
|
9
|
+
Organization
|
10
|
+
vdcs -> vdc -> vapps -> vapp -> vms -> vm -> customizations -> script
|
11
|
+
-> network
|
12
|
+
-> disks -> disk
|
13
|
+
-> tags -> tag
|
14
|
+
-> power_on
|
15
|
+
networks -> network
|
16
|
+
catalogs -> catalog -> catalog_items -> catalog_item -> instantiate_vapp
|
17
|
+
```
|
18
|
+
|
19
|
+
### Actions
|
20
|
+
|
21
|
+
Every collection supports the following methods:
|
22
|
+
|
23
|
+
Method Name | Lazy Load
|
24
|
+
----------------- | ---------
|
25
|
+
get(id) | false
|
26
|
+
get_by_name(name) | false
|
27
|
+
all | true
|
28
|
+
all(false) | false
|
29
|
+
|
30
|
+
### Lazy Loading
|
31
|
+
|
32
|
+
When listing a collection (eg: `vdc.vapps`), lazy load will be used by default
|
33
|
+
to improve the performance, otherwise it will make as many requests as items
|
34
|
+
are in the collection.
|
35
|
+
|
36
|
+
You can disable lazy load using the explict caller and passing a *false*
|
37
|
+
option: `vdc.vapps.all(false)`.
|
38
|
+
|
39
|
+
Attributes showing the value **NonLoaded** will be populated when accessing the
|
40
|
+
value, if there are more than one **NonLoaded** values the first time accessing
|
41
|
+
on any of those values will populate the others.
|
42
|
+
|
43
|
+
You can explicitly load those attributes with the `reload` method:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
org = vcloud.organizations.first
|
47
|
+
org.reload
|
48
|
+
```
|
49
|
+
|
50
|
+
Lazy load isn't used with `get` and `get_by_name` methods are used.
|
51
|
+
|
52
|
+
## Initialization
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
vcloud = Fog::Compute::VcloudDirector.new(
|
56
|
+
vcloud_director_username: "<username>@<org_name>",
|
57
|
+
vcloud_director_password: "<password>",
|
58
|
+
vcloud_director_host: 'example.com',
|
59
|
+
:connection_options => {
|
60
|
+
:ssl_verify_peer => false,
|
61
|
+
:connect_timeout => 200,
|
62
|
+
:read_timeout => 200
|
63
|
+
}
|
64
|
+
)
|
65
|
+
```
|
66
|
+
|
67
|
+
## Organizations
|
68
|
+
|
69
|
+
### List Organizations
|
70
|
+
|
71
|
+
Note that when listing, by default only the attributes `id`, `name`, `type`,
|
72
|
+
and `href` are loaded. To disable lazy loading, and load all attributes, just
|
73
|
+
specify `false`. Another option is to reload a specific item:
|
74
|
+
`vcloud.organizations.first.reload`
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
vcloud.organizations
|
78
|
+
```
|
79
|
+
```
|
80
|
+
<Fog::Compute::VcloudDirector::Organizations
|
81
|
+
[
|
82
|
+
<Fog::Compute::VcloudDirector::Organization
|
83
|
+
id="c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
84
|
+
name="DevOps",
|
85
|
+
type="application/vnd.vmware.vcloud.org+xml",
|
86
|
+
href="https://example.com/api/org/c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
87
|
+
description=NonLoaded
|
88
|
+
>
|
89
|
+
]
|
90
|
+
>
|
91
|
+
```
|
92
|
+
|
93
|
+
### Retrieve an Organization by Id
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
org = vcloud.organizations.get("c6a4c623-c158-41cf-a87a-dbc1637ad55a")
|
97
|
+
```
|
98
|
+
|
99
|
+
### Retrieve an Organization by Name
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
org = vcloud.organizations.get_by_name("DevOps")
|
103
|
+
```
|
104
|
+
|
105
|
+
## vDCs
|
106
|
+
|
107
|
+
It shows the Organization's vDCs.
|
108
|
+
|
109
|
+
### List vDCs
|
110
|
+
|
111
|
+
```ruby
|
112
|
+
org = vcloud.organizations.first
|
113
|
+
org.vdcs
|
114
|
+
```
|
115
|
+
```ruby
|
116
|
+
<Fog::Compute::VcloudDirector::Vdcs
|
117
|
+
organization= <Fog::Compute::VcloudDirector::Organization
|
118
|
+
id="c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
119
|
+
name="DevOps",
|
120
|
+
type="application/vnd.vmware.vcloud.org+xml",
|
121
|
+
href="https://example.com/api/org/c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
122
|
+
description=NonLoaded
|
123
|
+
>
|
124
|
+
[
|
125
|
+
<Fog::Compute::VcloudDirector::Vdc
|
126
|
+
id="9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
127
|
+
name="DevOps - VDC",
|
128
|
+
type="application/vnd.vmware.vcloud.vdc+xml",
|
129
|
+
href="https://example.com/api/vdc/9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
130
|
+
description=NonLoaded,
|
131
|
+
available_networks=NonLoaded,
|
132
|
+
compute_capacity_cpu=NonLoaded,
|
133
|
+
compute_capacity_memory=NonLoaded,
|
134
|
+
storage_capacity=NonLoaded,
|
135
|
+
allocation_model=NonLoaded,
|
136
|
+
capabilities=NonLoaded,
|
137
|
+
nic_quota=NonLoaded,
|
138
|
+
network_quota=NonLoaded,
|
139
|
+
vm_quota=NonLoaded,
|
140
|
+
is_enabled=NonLoaded
|
141
|
+
>
|
142
|
+
]
|
143
|
+
>
|
144
|
+
```
|
145
|
+
|
146
|
+
### Retrieve a vDC
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
org = vcloud.organizations.first
|
150
|
+
org.vdcs.get_by_name("DevOps - VDC")
|
151
|
+
```
|
152
|
+
```ruby
|
153
|
+
<Fog::Compute::VcloudDirector::Vdc
|
154
|
+
id="9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
155
|
+
name="DevOps - VDC",
|
156
|
+
type="application/vnd.vmware.vcloud.vdc+xml",
|
157
|
+
href="https://example.com/api/vdc/9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
158
|
+
description="",
|
159
|
+
available_networks={:type=>"application/vnd.vmware.vcloud.network+xml", :name=>"DevOps - Dev Network Connection", :href=>"https://example.com/api/network/d5f47bbf-de27-4cf5-aaaa-56772f2ccd17"},
|
160
|
+
compute_capacity_cpu=NonLoaded,
|
161
|
+
compute_capacity_memory={:Units=>"MB", :Allocated=>"0", :Limit=>"0", :Used=>"3584", :Overhead=>"65"},
|
162
|
+
storage_capacity={:Units=>"MB", :Allocated=>"1048320", :Limit=>"1048320", :Used=>"903168", :Overhead=>"0"},
|
163
|
+
allocation_model="AllocationVApp",
|
164
|
+
capabilities={:SupportedHardwareVersion=>"vmx-09"},
|
165
|
+
nic_quota=0,
|
166
|
+
network_quota=1024,
|
167
|
+
vm_quota=0,
|
168
|
+
is_enabled=true
|
169
|
+
>
|
170
|
+
```
|
171
|
+
|
172
|
+
## vApps
|
173
|
+
|
174
|
+
### List vApps
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
org = vcloud.organizations.first
|
178
|
+
vdc = org.vdcs.first
|
179
|
+
vdc.vapps
|
180
|
+
```
|
181
|
+
```ruby
|
182
|
+
<Fog::Compute::VcloudDirector::Vapps
|
183
|
+
vdc= <Fog::Compute::VcloudDirector::Vdc
|
184
|
+
id="9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
185
|
+
name="DevOps - VDC",
|
186
|
+
type="application/vnd.vmware.vcloud.vdc+xml",
|
187
|
+
href="https://example.com/api/vdc/9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
188
|
+
description=NonLoaded,
|
189
|
+
available_networks=NonLoaded,
|
190
|
+
compute_capacity_cpu=NonLoaded,
|
191
|
+
compute_capacity_memory=NonLoaded,
|
192
|
+
storage_capacity=NonLoaded,
|
193
|
+
allocation_model=NonLoaded,
|
194
|
+
capabilities=NonLoaded,
|
195
|
+
nic_quota=NonLoaded,
|
196
|
+
network_quota=NonLoaded,
|
197
|
+
vm_quota=NonLoaded,
|
198
|
+
is_enabled=NonLoaded
|
199
|
+
>
|
200
|
+
[
|
201
|
+
<Fog::Compute::VcloudDirector::Vapp
|
202
|
+
id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
203
|
+
name="segundo",
|
204
|
+
type="application/vnd.vmware.vcloud.vApp+xml",
|
205
|
+
href="https://example.com/api/vApp/vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
206
|
+
description=NonLoaded,
|
207
|
+
deployed=NonLoaded,
|
208
|
+
status=NonLoaded,
|
209
|
+
deployment_lease_in_seconds=NonLoaded,
|
210
|
+
storage_lease_in_seconds=NonLoaded,
|
211
|
+
startup_section=NonLoaded,
|
212
|
+
network_section=NonLoaded,
|
213
|
+
network_config=NonLoaded,
|
214
|
+
owner=NonLoaded,
|
215
|
+
InMaintenanceMode=NonLoaded
|
216
|
+
>,
|
217
|
+
<Fog::Compute::VcloudDirector::Vapp
|
218
|
+
id="vapp-6ac43e0e-13e2-4642-a58a-6dc3a12f585b",
|
219
|
+
name="vApp_restebanez_9",
|
220
|
+
type="application/vnd.vmware.vcloud.vApp+xml",
|
221
|
+
href="https://example.com/api/vApp/vapp-6ac43e0e-13e2-4642-a58a-6dc3a12f585b",
|
222
|
+
description=NonLoaded,
|
223
|
+
deployed=NonLoaded,
|
224
|
+
status=NonLoaded,
|
225
|
+
deployment_lease_in_seconds=NonLoaded,
|
226
|
+
storage_lease_in_seconds=NonLoaded,
|
227
|
+
startup_section=NonLoaded,
|
228
|
+
network_section=NonLoaded,
|
229
|
+
network_config=NonLoaded,
|
230
|
+
owner=NonLoaded,
|
231
|
+
InMaintenanceMode=NonLoaded
|
232
|
+
>
|
233
|
+
]
|
234
|
+
>
|
235
|
+
```
|
236
|
+
|
237
|
+
### Retrieve a vApp
|
238
|
+
|
239
|
+
```ruby
|
240
|
+
org = vcloud.organizations.first
|
241
|
+
vdc = org.vdcs.first
|
242
|
+
vdc.vapps.get_by_name("segundo")
|
243
|
+
```
|
244
|
+
```ruby
|
245
|
+
<Fog::Compute::VcloudDirector::Vapp
|
246
|
+
id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
247
|
+
name="segundo",
|
248
|
+
type="application/vnd.vmware.vcloud.vApp+xml",
|
249
|
+
href="https://example.com/api/vApp/vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
250
|
+
description="",
|
251
|
+
deployed=false,
|
252
|
+
status="8",
|
253
|
+
deployment_lease_in_seconds=NonLoaded,
|
254
|
+
storage_lease_in_seconds="7776000",
|
255
|
+
startup_section={:ovf_stopDelay=>"0", :ovf_stopAction=>"powerOff", :ovf_startDelay=>"0", :ovf_startAction=>"powerOn", :ovf_order=>"0", :ovf_id=>"DEVWEB"},
|
256
|
+
network_section={:ovf_name=>"DevOps - Dev Network Connection", :"ovf:Description"=>""},
|
257
|
+
network_config={:networkName=>"DevOps - Dev Network Connection", :Link=>{:rel=>"repair", :href=>"https://example.com/api/admin/network/82a07044-4dda-4a3e-a53d-8981cf0d5baa/action/reset"}, :Description=>"", :Configuration=>{:IpScope=>{:IsInherited=>"true", :Gateway=>"10.192.0.1", :Netmask=>"255.255.252.0", :Dns1=>"10.192.0.11", :Dns2=>"10.192.0.12", :DnsSuffix=>"dev.ad.mdsol.com", :IpRanges=>{:IpRange=>{:StartAddress=>"10.192.0.100", :EndAddress=>"10.192.3.254"}}}, :ParentNetwork=>{:name=>"DevOps - Dev Network Connection", :id=>"d5f47bbf-de27-4cf5-aaaa-56772f2ccd17", :href=>"https://example.com/api/admin/network/d5f47bbf-de27-4cf5-aaaa-56772f2ccd17"}, :FenceMode=>"bridged", :RetainNetInfoAcrossDeployments=>"false"}, :IsDeployed=>"false"},
|
258
|
+
owner={:type=>"application/vnd.vmware.admin.user+xml", :name=>"restebanez", :href=>"https://example.com/api/admin/user/c3ca7b97-ddea-425f-8bdb-1fdb946f7349"},
|
259
|
+
InMaintenanceMode=false
|
260
|
+
>
|
261
|
+
```
|
262
|
+
|
263
|
+
## VMs
|
264
|
+
|
265
|
+
### List VMs
|
266
|
+
|
267
|
+
```ruby
|
268
|
+
org = vcloud.organizations.first
|
269
|
+
vdc = org.vdcs.first
|
270
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
271
|
+
vapp.vms
|
272
|
+
```
|
273
|
+
```ruby
|
274
|
+
<Fog::Compute::VcloudDirector::Vms
|
275
|
+
vapp= <Fog::Compute::VcloudDirector::Vapp
|
276
|
+
id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
277
|
+
name="segundo",
|
278
|
+
type="application/vnd.vmware.vcloud.vApp+xml",
|
279
|
+
href="https://example.com/api/vApp/vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
280
|
+
description="",
|
281
|
+
deployed=false,
|
282
|
+
status="8",
|
283
|
+
deployment_lease_in_seconds=NonLoaded,
|
284
|
+
storage_lease_in_seconds="7776000",
|
285
|
+
startup_section={:ovf_stopDelay=>"0", :ovf_stopAction=>"powerOff", :ovf_startDelay=>"0", :ovf_startAction=>"powerOn", :ovf_order=>"0", :ovf_id=>"DEVWEB"},
|
286
|
+
network_section={:ovf_name=>"DevOps - Dev Network Connection", :"ovf:Description"=>""},
|
287
|
+
network_config={:networkName=>"DevOps - Dev Network Connection", :Link=>{:rel=>"repair", :href=>"https://example.com/api/admin/network/82a07044-4dda-4a3e-a53d-8981cf0d5baa/action/reset"}, :Description=>"", :Configuration=>{:IpScope=>{:IsInherited=>"true", :Gateway=>"10.192.0.1", :Netmask=>"255.255.252.0", :Dns1=>"10.192.0.11", :Dns2=>"10.192.0.12", :DnsSuffix=>"dev.ad.mdsol.com", :IpRanges=>{:IpRange=>{:StartAddress=>"10.192.0.100", :EndAddress=>"10.192.3.254"}}}, :ParentNetwork=>{:name=>"DevOps - Dev Network Connection", :id=>"d5f47bbf-de27-4cf5-aaaa-56772f2ccd17", :href=>"https://example.com/api/admin/network/d5f47bbf-de27-4cf5-aaaa-56772f2ccd17"}, :FenceMode=>"bridged", :RetainNetInfoAcrossDeployments=>"false"}, :IsDeployed=>"false"},
|
288
|
+
owner={:type=>"application/vnd.vmware.admin.user+xml", :name=>"restebanez", :href=>"https://example.com/api/admin/user/c3ca7b97-ddea-425f-8bdb-1fdb946f7349"},
|
289
|
+
InMaintenanceMode=false
|
290
|
+
>
|
291
|
+
[
|
292
|
+
<Fog::Compute::VcloudDirector::Vm
|
293
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
294
|
+
vapp_id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
295
|
+
name="DEVWEB",
|
296
|
+
type="application/vnd.vmware.vcloud.vm+xml",
|
297
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
298
|
+
status="off",
|
299
|
+
operating_system="Microsoft Windows Server 2008 R2 (64-bit)",
|
300
|
+
ip_address="10.192.0.144",
|
301
|
+
cpu=3,
|
302
|
+
memory=3584,
|
303
|
+
hard_disks=[{"Hard disk 1"=>163840}]
|
304
|
+
>
|
305
|
+
]
|
306
|
+
>
|
307
|
+
```
|
308
|
+
|
309
|
+
### Retrieve a VM
|
310
|
+
|
311
|
+
```ruby
|
312
|
+
org = vcloud.organizations.first
|
313
|
+
vdc = org.vdcs.first
|
314
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
315
|
+
vapp.vms.get_by_name("DEVWEB")
|
316
|
+
```
|
317
|
+
```ruby
|
318
|
+
<Fog::Compute::VcloudDirector::Vm
|
319
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
320
|
+
vapp_id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
321
|
+
name="DEVWEB",
|
322
|
+
type="application/vnd.vmware.vcloud.vm+xml",
|
323
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
324
|
+
status="off",
|
325
|
+
operating_system="Microsoft Windows Server 2008 R2 (64-bit)",
|
326
|
+
ip_address="10.192.0.144",
|
327
|
+
cpu=3,
|
328
|
+
memory=3584,
|
329
|
+
hard_disks=[{"Hard disk 1"=>163840}]
|
330
|
+
>
|
331
|
+
```
|
332
|
+
|
333
|
+
### Modify CPU
|
334
|
+
|
335
|
+
```ruby
|
336
|
+
org = vcloud.organizations.first
|
337
|
+
vdc = org.vdcs.first
|
338
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
339
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
340
|
+
vm.cpu = 4
|
341
|
+
```
|
342
|
+
```no-highlight
|
343
|
+
... success
|
344
|
+
4
|
345
|
+
```
|
346
|
+
|
347
|
+
### Modify Memory
|
348
|
+
|
349
|
+
```ruby
|
350
|
+
org = vcloud.organizations.first
|
351
|
+
vdc = org.vdcs.first
|
352
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
353
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
354
|
+
vm.memory = 4096
|
355
|
+
```
|
356
|
+
```no-highlight
|
357
|
+
... success
|
358
|
+
4096
|
359
|
+
```
|
360
|
+
|
361
|
+
### Power On a VM
|
362
|
+
|
363
|
+
```ruby
|
364
|
+
org = vcloud.organizations.first
|
365
|
+
vdc = org.vdcs.first
|
366
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
367
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
368
|
+
vm.power_on
|
369
|
+
```
|
370
|
+
```no-highlight
|
371
|
+
..... success
|
372
|
+
true
|
373
|
+
```
|
374
|
+
|
375
|
+
## VM Customization
|
376
|
+
|
377
|
+
### Retrieve VM Customization
|
378
|
+
|
379
|
+
```ruby
|
380
|
+
org = vcloud.organizations.first
|
381
|
+
vdc = org.vdcs.first
|
382
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
383
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
384
|
+
vm.customization
|
385
|
+
```
|
386
|
+
```ruby
|
387
|
+
<Fog::Compute::VcloudDirector::VmCustomization
|
388
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
389
|
+
type="application/vnd.vmware.vcloud.guestCustomizationSection+xml",
|
390
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192/guestCustomizationSection/",
|
391
|
+
enabled=false,
|
392
|
+
change_sid=false,
|
393
|
+
join_domain_enabled=false,
|
394
|
+
use_org_settings=false,
|
395
|
+
admin_password_enabled=false,
|
396
|
+
reset_password_required=false,
|
397
|
+
virtual_machine_id="2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
398
|
+
computer_name="DEVWEB-001",
|
399
|
+
has_customization_script=true
|
400
|
+
>
|
401
|
+
```
|
402
|
+
|
403
|
+
### Modify VM Customization
|
404
|
+
|
405
|
+
Customization attributes model requires to `save` it after setting the
|
406
|
+
attributes.
|
407
|
+
|
408
|
+
```ruby
|
409
|
+
org = vcloud.organizations.first
|
410
|
+
vdc = org.vdcs.first
|
411
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
412
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
413
|
+
customization = vm.customization
|
414
|
+
customization.compute_name = "NEWNAME"
|
415
|
+
customization.enabled = false
|
416
|
+
customization.script = "new userdata script"
|
417
|
+
customization.save
|
418
|
+
```
|
419
|
+
```no-highlight
|
420
|
+
.. success
|
421
|
+
true
|
422
|
+
```
|
423
|
+
|
424
|
+
## VM Network
|
425
|
+
|
426
|
+
### Show VM Networks
|
427
|
+
|
428
|
+
```ruby
|
429
|
+
org = vcloud.organizations.first
|
430
|
+
vdc = org.vdcs.first
|
431
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
432
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
433
|
+
vm.network
|
434
|
+
```
|
435
|
+
```ruby
|
436
|
+
<Fog::Compute::VcloudDirector::VmNetwork
|
437
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
438
|
+
type="application/vnd.vmware.vcloud.networkConnectionSection+xml",
|
439
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192/networkConnectionSection/",
|
440
|
+
info="Specifies the available VM network connections",
|
441
|
+
primary_network_connection_index=0,
|
442
|
+
network="DevOps - Dev Network Connection",
|
443
|
+
needs_customization=true,
|
444
|
+
network_connection_index=0,
|
445
|
+
is_connected=true,
|
446
|
+
mac_address="00:50:56:01:00:ea",
|
447
|
+
ip_address_allocation_mode="POOL"
|
448
|
+
>
|
449
|
+
```
|
450
|
+
|
451
|
+
### Modify one or more attributes
|
452
|
+
|
453
|
+
Network attributes model requires to `save` it after setting the attributes.
|
454
|
+
|
455
|
+
```ruby
|
456
|
+
org = vcloud.organizations.first
|
457
|
+
vdc = org.vdcs.first
|
458
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
459
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
460
|
+
network = vm.network
|
461
|
+
network.is_connected = false
|
462
|
+
network.ip_address_allocation_mode = "DHCP"
|
463
|
+
network.save
|
464
|
+
```
|
465
|
+
```no-highlight
|
466
|
+
.. success
|
467
|
+
true
|
468
|
+
```
|
469
|
+
|
470
|
+
## VM Disk
|
471
|
+
|
472
|
+
### List VM Disks
|
473
|
+
|
474
|
+
```ruby
|
475
|
+
org = vcloud.organizations.first
|
476
|
+
vdc = org.vdcs.first
|
477
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
478
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
479
|
+
vm.disks
|
480
|
+
```
|
481
|
+
```ruby
|
482
|
+
<Fog::Compute::VcloudDirector::Disks
|
483
|
+
vm= <Fog::Compute::VcloudDirector::Vm
|
484
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
485
|
+
vapp_id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
486
|
+
name="DEVWEB",
|
487
|
+
type="application/vnd.vmware.vcloud.vm+xml",
|
488
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
489
|
+
status="off",
|
490
|
+
operating_system="Microsoft Windows Server 2008 R2 (64-bit)",
|
491
|
+
ip_address="10.192.0.144",
|
492
|
+
cpu=4,
|
493
|
+
memory=4096,
|
494
|
+
hard_disks=[{"Hard disk 1"=>163840}]
|
495
|
+
>
|
496
|
+
[
|
497
|
+
<Fog::Compute::VcloudDirector::Disk
|
498
|
+
id=2,
|
499
|
+
address=0,
|
500
|
+
description="SCSI Controller",
|
501
|
+
name="SCSI Controller 0",
|
502
|
+
resource_sub_type="lsilogicsas",
|
503
|
+
resource_type=6,
|
504
|
+
address_on_parent=nil,
|
505
|
+
parent=nil,
|
506
|
+
capacity=nil,
|
507
|
+
bus_sub_type=nil,
|
508
|
+
bus_type=nil
|
509
|
+
>,
|
510
|
+
<Fog::Compute::VcloudDirector::Disk
|
511
|
+
id=2000,
|
512
|
+
address=nil,
|
513
|
+
description="Hard disk",
|
514
|
+
name="Hard disk 1",
|
515
|
+
resource_sub_type=nil,
|
516
|
+
resource_type=17,
|
517
|
+
address_on_parent=0,
|
518
|
+
parent=2,
|
519
|
+
capacity=163840,
|
520
|
+
bus_sub_type="lsilogicsas",
|
521
|
+
bus_type=6
|
522
|
+
>,
|
523
|
+
<Fog::Compute::VcloudDirector::Disk
|
524
|
+
id=3,
|
525
|
+
address=0,
|
526
|
+
description="IDE Controller",
|
527
|
+
name="IDE Controller 0",
|
528
|
+
resource_sub_type=nil,
|
529
|
+
resource_type=5,
|
530
|
+
address_on_parent=nil,
|
531
|
+
parent=nil,
|
532
|
+
capacity=nil,
|
533
|
+
bus_sub_type=nil,
|
534
|
+
bus_type=nil
|
535
|
+
>
|
536
|
+
]
|
537
|
+
>
|
538
|
+
```
|
539
|
+
|
540
|
+
### Create a New Disk
|
541
|
+
|
542
|
+
```ruby
|
543
|
+
org = vcloud.organizations.first
|
544
|
+
vdc = org.vdcs.first
|
545
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
546
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
547
|
+
vm.disks.create(1024)
|
548
|
+
```
|
549
|
+
```no-highlight
|
550
|
+
... success
|
551
|
+
true
|
552
|
+
```
|
553
|
+
|
554
|
+
The new disk should show up.
|
555
|
+
|
556
|
+
```ruby
|
557
|
+
>> vm.disks
|
558
|
+
<Fog::Compute::VcloudDirector::Disks
|
559
|
+
vm= <Fog::Compute::VcloudDirector::Vm
|
560
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
561
|
+
vapp_id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
562
|
+
name="DEVWEB",
|
563
|
+
type="application/vnd.vmware.vcloud.vm+xml",
|
564
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
565
|
+
status="off",
|
566
|
+
operating_system="Microsoft Windows Server 2008 R2 (64-bit)",
|
567
|
+
ip_address="10.192.0.144",
|
568
|
+
cpu=4,
|
569
|
+
memory=4096,
|
570
|
+
hard_disks=[{"Hard disk 1"=>163840}]
|
571
|
+
>
|
572
|
+
[
|
573
|
+
<Fog::Compute::VcloudDirector::Disk
|
574
|
+
id=2,
|
575
|
+
address=0,
|
576
|
+
description="SCSI Controller",
|
577
|
+
name="SCSI Controller 0",
|
578
|
+
resource_sub_type="lsilogicsas",
|
579
|
+
resource_type=6,
|
580
|
+
address_on_parent=nil,
|
581
|
+
parent=nil,
|
582
|
+
capacity=nil,
|
583
|
+
bus_sub_type=nil,
|
584
|
+
bus_type=nil
|
585
|
+
>,
|
586
|
+
<Fog::Compute::VcloudDirector::Disk
|
587
|
+
id=2000,
|
588
|
+
address=nil,
|
589
|
+
description="Hard disk",
|
590
|
+
name="Hard disk 1",
|
591
|
+
resource_sub_type=nil,
|
592
|
+
resource_type=17,
|
593
|
+
address_on_parent=0,
|
594
|
+
parent=2,
|
595
|
+
capacity=163840,
|
596
|
+
bus_sub_type="lsilogicsas",
|
597
|
+
bus_type=6
|
598
|
+
>,
|
599
|
+
<Fog::Compute::VcloudDirector::Disk
|
600
|
+
id=2001,
|
601
|
+
address=nil,
|
602
|
+
description="Hard disk",
|
603
|
+
name="Hard disk 2",
|
604
|
+
resource_sub_type=nil,
|
605
|
+
resource_type=17,
|
606
|
+
address_on_parent=1,
|
607
|
+
parent=2,
|
608
|
+
capacity=1024,
|
609
|
+
bus_sub_type="lsilogicsas",
|
610
|
+
bus_type=6
|
611
|
+
>,
|
612
|
+
<Fog::Compute::VcloudDirector::Disk
|
613
|
+
id=3,
|
614
|
+
address=0,
|
615
|
+
description="IDE Controller",
|
616
|
+
name="IDE Controller 0",
|
617
|
+
resource_sub_type=nil,
|
618
|
+
resource_type=5,
|
619
|
+
address_on_parent=nil,
|
620
|
+
parent=nil,
|
621
|
+
capacity=nil,
|
622
|
+
bus_sub_type=nil,
|
623
|
+
bus_type=nil
|
624
|
+
>
|
625
|
+
]
|
626
|
+
>
|
627
|
+
```
|
628
|
+
|
629
|
+
### Modify the Hard Disk Size
|
630
|
+
|
631
|
+
```ruby
|
632
|
+
org = vcloud.organizations.first
|
633
|
+
vdc = org.vdcs.first
|
634
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
635
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
636
|
+
disk = vm.disks.get_by_name("Hard disk 2")
|
637
|
+
disk.capacity = 2048
|
638
|
+
```
|
639
|
+
```no-highlight
|
640
|
+
... success
|
641
|
+
true
|
642
|
+
```
|
643
|
+
|
644
|
+
### Destroy a Hard Disk
|
645
|
+
|
646
|
+
```ruby
|
647
|
+
org = vcloud.organizations.first
|
648
|
+
vdc = org.vdcs.first
|
649
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
650
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
651
|
+
disk = vm.disks.get_by_name("Hard disk 2")
|
652
|
+
disk.destroy
|
653
|
+
```
|
654
|
+
```no-highlight
|
655
|
+
... success
|
656
|
+
true
|
657
|
+
```
|
658
|
+
|
659
|
+
## VM Tags
|
660
|
+
|
661
|
+
### List VM Tags
|
662
|
+
|
663
|
+
```ruby
|
664
|
+
org = vcloud.organizations.first
|
665
|
+
vdc = org.vdcs.first
|
666
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
667
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
668
|
+
vm.tags
|
669
|
+
```
|
670
|
+
```ruby
|
671
|
+
<Fog::Compute::VcloudDirector::Tags
|
672
|
+
vm= <Fog::Compute::VcloudDirector::Vm
|
673
|
+
id="vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
674
|
+
vapp_id="vapp-11c7102f-443d-40fd-b1da-cca981fb44b6",
|
675
|
+
name="DEVWEB",
|
676
|
+
type="application/vnd.vmware.vcloud.vm+xml",
|
677
|
+
href="https://example.com/api/vApp/vm-2ddeea36-ac71-470f-abc5-c6e3c2aca192",
|
678
|
+
status="off",
|
679
|
+
operating_system="Microsoft Windows Server 2008 R2 (64-bit)",
|
680
|
+
ip_address="10.192.0.144",
|
681
|
+
cpu=4,
|
682
|
+
memory=4096,
|
683
|
+
hard_disks=[{"Hard disk 1"=>163840}]
|
684
|
+
>
|
685
|
+
[
|
686
|
+
<Fog::Compute::VcloudDirector::Tag
|
687
|
+
id="environment",
|
688
|
+
value="devlab"
|
689
|
+
>,
|
690
|
+
<Fog::Compute::VcloudDirector::Tag
|
691
|
+
id="product",
|
692
|
+
value="devlabtest"
|
693
|
+
>,
|
694
|
+
<Fog::Compute::VcloudDirector::Tag
|
695
|
+
id="hello",
|
696
|
+
value="ddd"
|
697
|
+
>,
|
698
|
+
<Fog::Compute::VcloudDirector::Tag
|
699
|
+
id="uno",
|
700
|
+
value="jander"
|
701
|
+
>
|
702
|
+
]
|
703
|
+
>
|
704
|
+
```
|
705
|
+
|
706
|
+
### Create a Tag
|
707
|
+
|
708
|
+
```ruby
|
709
|
+
org = vcloud.organizations.first
|
710
|
+
vdc = org.vdcs.first
|
711
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
712
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
713
|
+
vm.tags.create('this_is_a_key', 'this_is_a_value')
|
714
|
+
```
|
715
|
+
```no-highlight
|
716
|
+
success
|
717
|
+
true
|
718
|
+
```
|
719
|
+
|
720
|
+
### Retrieve a Tag
|
721
|
+
|
722
|
+
```ruby
|
723
|
+
org = vcloud.organizations.first
|
724
|
+
vdc = org.vdcs.first
|
725
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
726
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
727
|
+
vm.tags.get_by_name('this_is_a_key')
|
728
|
+
```
|
729
|
+
```ruby
|
730
|
+
<Fog::Compute::VcloudDirector::Tag
|
731
|
+
id="this_is_a_key",
|
732
|
+
value="this_is_a_value"
|
733
|
+
>
|
734
|
+
```
|
735
|
+
|
736
|
+
### Modify a Tag
|
737
|
+
|
738
|
+
```ruby
|
739
|
+
org = vcloud.organizations.first
|
740
|
+
vdc = org.vdcs.first
|
741
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
742
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
743
|
+
vm.tags.get_by_name('this_is_a_key').value = 'new_value'
|
744
|
+
```
|
745
|
+
```no-highlight
|
746
|
+
success
|
747
|
+
"new_value"
|
748
|
+
```
|
749
|
+
|
750
|
+
### Destroy a Tag
|
751
|
+
|
752
|
+
```ruby
|
753
|
+
org = vcloud.organizations.first
|
754
|
+
vdc = org.vdcs.first
|
755
|
+
vapp = vdc.vapps.get_by_name("segundo")
|
756
|
+
vm = vapp.vms.get_by_name("DEVWEB")
|
757
|
+
vm.tags.get_by_name('this_is_a_key').destroy
|
758
|
+
```
|
759
|
+
```no-highlight
|
760
|
+
success
|
761
|
+
true
|
762
|
+
```
|
763
|
+
|
764
|
+
## Networks
|
765
|
+
|
766
|
+
It shows the Organization's Networks.
|
767
|
+
|
768
|
+
### List Networks
|
769
|
+
|
770
|
+
```ruby
|
771
|
+
org = vcloud.organizations.first
|
772
|
+
org.networks
|
773
|
+
```
|
774
|
+
```ruby
|
775
|
+
<Fog::Compute::VcloudDirector::Networks
|
776
|
+
organization= <Fog::Compute::VcloudDirector::Organization
|
777
|
+
id="c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
778
|
+
name="DevOps",
|
779
|
+
type="application/vnd.vmware.vcloud.org+xml",
|
780
|
+
href="https://example.com/api/org/c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
781
|
+
description=NonLoaded
|
782
|
+
>
|
783
|
+
[
|
784
|
+
<Fog::Compute::VcloudDirector::Network
|
785
|
+
id="d5f47bbf-de27-4cf5-aaaa-56772f2ccd17",
|
786
|
+
name="DevOps - Dev Network Connection",
|
787
|
+
type="application/vnd.vmware.vcloud.orgNetwork+xml",
|
788
|
+
href="https://example.com/api/network/d5f47bbf-de27-4cf5-aaaa-56772f2ccd17",
|
789
|
+
description=NonLoaded,
|
790
|
+
is_inherited=NonLoaded,
|
791
|
+
gateway=NonLoaded,
|
792
|
+
netmask=NonLoaded,
|
793
|
+
dns1=NonLoaded,
|
794
|
+
dns2=NonLoaded,
|
795
|
+
dns_suffix=NonLoaded,
|
796
|
+
ip_ranges=NonLoaded
|
797
|
+
>
|
798
|
+
]
|
799
|
+
>
|
800
|
+
```
|
801
|
+
|
802
|
+
### Retrieve a Network
|
803
|
+
|
804
|
+
```ruby
|
805
|
+
org = vcloud.organizations.first
|
806
|
+
org.networks.get_by_name("DevOps - Dev Network Connection")
|
807
|
+
```
|
808
|
+
```ruby
|
809
|
+
<Fog::Compute::VcloudDirector::Network
|
810
|
+
id="d5f47bbf-de27-4cf5-aaaa-56772f2ccd17",
|
811
|
+
name="DevOps - Dev Network Connection",
|
812
|
+
type="application/vnd.vmware.vcloud.orgNetwork+xml",
|
813
|
+
href="https://example.com/api/network/d5f47bbf-de27-4cf5-aaaa-56772f2ccd17",
|
814
|
+
description=nil,
|
815
|
+
is_inherited=true,
|
816
|
+
gateway="10.192.0.1",
|
817
|
+
netmask="255.255.252.0",
|
818
|
+
dns1="10.192.0.11",
|
819
|
+
dns2="10.192.0.12",
|
820
|
+
dns_suffix="dev.ad.mdsol.com",
|
821
|
+
ip_ranges=[{:start_address=>"10.192.0.100", :end_address=>"10.192.3.254"}]
|
822
|
+
>
|
823
|
+
```
|
824
|
+
|
825
|
+
## Catalogs
|
826
|
+
|
827
|
+
It shows the Organization's Catalogs.
|
828
|
+
|
829
|
+
### List Catalogs
|
830
|
+
|
831
|
+
```ruby
|
832
|
+
org = vcloud.organizations.first
|
833
|
+
org.catalogs
|
834
|
+
```
|
835
|
+
```ruby
|
836
|
+
<Fog::Compute::VcloudDirector::Catalogs
|
837
|
+
organization= <Fog::Compute::VcloudDirector::Organization
|
838
|
+
id="c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
839
|
+
name="DevOps",
|
840
|
+
type="application/vnd.vmware.vcloud.org+xml",
|
841
|
+
href="https://example.com/api/org/c6a4c623-c158-41cf-a87a-dbc1637ad55a",
|
842
|
+
description=NonLoaded
|
843
|
+
>
|
844
|
+
[
|
845
|
+
<Fog::Compute::VcloudDirector::Catalog
|
846
|
+
id="4ee720e5-173a-41ac-824b-6f4908bac975",
|
847
|
+
name="Public VM Templates",
|
848
|
+
type="application/vnd.vmware.vcloud.catalog+xml",
|
849
|
+
href="https://example.com/api/catalog/4ee720e5-173a-41ac-824b-6f4908bac975",
|
850
|
+
description=NonLoaded,
|
851
|
+
is_published=NonLoaded
|
852
|
+
>,
|
853
|
+
<Fog::Compute::VcloudDirector::Catalog
|
854
|
+
id="ea0c6acf-c9c0-46b7-b19f-4b2d3bf8aa33",
|
855
|
+
name="prueba",
|
856
|
+
type="application/vnd.vmware.vcloud.catalog+xml",
|
857
|
+
href="https://example.com/api/catalog/ea0c6acf-c9c0-46b7-b19f-4b2d3bf8aa33",
|
858
|
+
description=NonLoaded,
|
859
|
+
is_published=NonLoaded
|
860
|
+
>
|
861
|
+
]
|
862
|
+
>
|
863
|
+
```
|
864
|
+
|
865
|
+
### Retrieve a Catalog
|
866
|
+
|
867
|
+
```ruby
|
868
|
+
org = vcloud.organizations.first
|
869
|
+
org.catalogs.get("4ee720e5-173a-41ac-824b-6f4908bac975") # or get_by_name("Public VM Templates")
|
870
|
+
```
|
871
|
+
```ruby
|
872
|
+
<Fog::Compute::VcloudDirector::Catalog
|
873
|
+
id="4ee720e5-173a-41ac-824b-6f4908bac975",
|
874
|
+
name="Public VM Templates",
|
875
|
+
type="application/vnd.vmware.vcloud.catalog+xml",
|
876
|
+
href="https://example.com/api/catalog/4ee720e5-173a-41ac-824b-6f4908bac975",
|
877
|
+
description="",
|
878
|
+
is_published=true
|
879
|
+
>
|
880
|
+
```
|
881
|
+
|
882
|
+
## Catalog Items
|
883
|
+
|
884
|
+
### List Catalog Items
|
885
|
+
|
886
|
+
```ruby
|
887
|
+
org = vcloud.organizations.first
|
888
|
+
catalog = org.catalogs.first
|
889
|
+
catalog.catalog_items
|
890
|
+
```
|
891
|
+
```ruby
|
892
|
+
<Fog::Compute::VcloudDirector::CatalogItems
|
893
|
+
catalog= <Fog::Compute::VcloudDirector::Catalog
|
894
|
+
id="4ee720e5-173a-41ac-824b-6f4908bac975",
|
895
|
+
name="Public VM Templates",
|
896
|
+
type="application/vnd.vmware.vcloud.catalog+xml",
|
897
|
+
href="https://example.com/api/catalog/4ee720e5-173a-41ac-824b-6f4908bac975",
|
898
|
+
description=NonLoaded,
|
899
|
+
is_published=NonLoaded
|
900
|
+
>
|
901
|
+
[
|
902
|
+
<Fog::Compute::VcloudDirector::CatalogItem
|
903
|
+
id="2bd55629-2734-420c-9068-2ff06a4a8028",
|
904
|
+
name="DEVWIN",
|
905
|
+
type="application/vnd.vmware.vcloud.catalogItem+xml",
|
906
|
+
href="https://example.com/api/catalogItem/2bd55629-2734-420c-9068-2ff06a4a8028",
|
907
|
+
description=NonLoaded,
|
908
|
+
vapp_template_id=NonLoaded
|
909
|
+
>,
|
910
|
+
<Fog::Compute::VcloudDirector::CatalogItem
|
911
|
+
id="5437aa3f-e369-40b2-b985-2e63e1bc9f2e",
|
912
|
+
name="DEVRHL",
|
913
|
+
type="application/vnd.vmware.vcloud.catalogItem+xml",
|
914
|
+
href="https://example.com/api/catalogItem/5437aa3f-e369-40b2-b985-2e63e1bc9f2e",
|
915
|
+
description=NonLoaded,
|
916
|
+
vapp_template_id=NonLoaded
|
917
|
+
>,
|
918
|
+
<Fog::Compute::VcloudDirector::CatalogItem
|
919
|
+
id="54cf5deb-326f-4770-a91a-39048689b6ea",
|
920
|
+
name="DEVAPP",
|
921
|
+
type="application/vnd.vmware.vcloud.catalogItem+xml",
|
922
|
+
href="https://example.com/api/catalogItem/54cf5deb-326f-4770-a91a-39048689b6ea",
|
923
|
+
description=NonLoaded,
|
924
|
+
vapp_template_id=NonLoaded
|
925
|
+
>
|
926
|
+
]
|
927
|
+
>
|
928
|
+
```
|
929
|
+
|
930
|
+
### Retrieve a Catalog Item
|
931
|
+
|
932
|
+
```ruby
|
933
|
+
org = vcloud.organizations.first
|
934
|
+
catalog = org.catalogs.first
|
935
|
+
catalog.catalog_items.get_by_name('DEVAPP')
|
936
|
+
```
|
937
|
+
```ruby
|
938
|
+
<Fog::Compute::VcloudDirector::CatalogItem
|
939
|
+
id="54cf5deb-326f-4770-a91a-39048689b6ea",
|
940
|
+
name="DEVAPP",
|
941
|
+
type="application/vnd.vmware.vcloud.catalogItem+xml",
|
942
|
+
href="https://example.com/api/catalogItem/54cf5deb-326f-4770-a91a-39048689b6ea",
|
943
|
+
description="Windows Server 2008 R2 Application Server",
|
944
|
+
vapp_template_id="vappTemplate-b5902d57-7906-49c8-8af5-bbebe0a60a97"
|
945
|
+
>
|
946
|
+
```
|
947
|
+
|
948
|
+
### Instantiate a vApp Template
|
949
|
+
|
950
|
+
It creates a Vapp from a CatalogItem.
|
951
|
+
|
952
|
+
```ruby
|
953
|
+
org = vcloud.organizations.first
|
954
|
+
catalog = org.catalogs.first
|
955
|
+
template = catalog.catalog_items.get_by_name('DEVAPP')
|
956
|
+
template.instantiate('webserver')
|
957
|
+
```
|
958
|
+
|
959
|
+
It there were more than one vDC or/and network you'd have to specify it as a
|
960
|
+
second param:
|
961
|
+
|
962
|
+
```ruby
|
963
|
+
template.instantiate('webserver', {
|
964
|
+
vdc_id: "9a06a16b-12c6-44dc-aee1-06aa52262ea3",
|
965
|
+
network_id: "d5f47bbf-de27-4cf5-aaaa-56772f2ccd17"
|
966
|
+
}
|
967
|
+
```
|