fog 1.17.0 → 1.18.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +19 -1
- data/changelog.txt +408 -0
- data/fog.gemspec +3 -3
- data/fogkeytest1.pem +27 -0
- data/lib/fog/aws/compute.rb +0 -1
- data/lib/fog/aws/data_pipeline.rb +0 -1
- data/lib/fog/aws/models/auto_scaling/group.rb +1 -1
- data/lib/fog/aws/models/compute/route_table.rb +1 -1
- data/lib/fog/aws/models/compute/server.rb +1 -1
- data/lib/fog/aws/parsers/compute/describe_internet_gateways.rb +1 -1
- data/lib/fog/aws/requests/compute/create_internet_gateway.rb +5 -4
- data/lib/fog/aws/requests/compute/create_tags.rb +2 -0
- data/lib/fog/aws/requests/compute/create_volume.rb +1 -1
- data/lib/fog/aws/requests/compute/delete_internet_gateway.rb +1 -1
- data/lib/fog/aws/requests/compute/describe_internet_gateways.rb +1 -1
- data/lib/fog/aws/requests/compute/run_instances.rb +1 -1
- data/lib/fog/bin/hp.rb +17 -0
- data/lib/fog/compute.rb +11 -0
- data/lib/fog/ecloud/compute.rb +8 -3
- data/lib/fog/ecloud/models/compute/admin_organization.rb +4 -4
- data/lib/fog/ecloud/models/compute/catalog_item.rb +1 -1
- data/lib/fog/ecloud/models/compute/compute_pool.rb +8 -8
- data/lib/fog/ecloud/models/compute/environment.rb +15 -15
- data/lib/fog/ecloud/models/compute/firewall_acl.rb +1 -1
- data/lib/fog/ecloud/models/compute/internet_service.rb +1 -1
- data/lib/fog/ecloud/models/compute/internet_services.rb +1 -1
- data/lib/fog/ecloud/models/compute/location.rb +1 -1
- data/lib/fog/ecloud/models/compute/monitor.rb +1 -1
- data/lib/fog/ecloud/models/compute/network.rb +1 -1
- data/lib/fog/ecloud/models/compute/node.rb +1 -1
- data/lib/fog/ecloud/models/compute/nodes.rb +1 -1
- data/lib/fog/ecloud/models/compute/organization.rb +10 -10
- data/lib/fog/ecloud/models/compute/row.rb +1 -1
- data/lib/fog/ecloud/models/compute/rows.rb +1 -1
- data/lib/fog/ecloud/models/compute/server.rb +9 -9
- data/lib/fog/ecloud/models/compute/templates.rb +3 -1
- data/lib/fog/ecloud/models/compute/user.rb +2 -2
- data/lib/fog/ecloud/models/compute/virtual_machine_assigned_ip.rb +1 -1
- data/lib/fog/ecloud/requests/compute/get_virtual_machine_assigned_ips.rb +1 -1
- data/lib/fog/google/models/compute/disk.rb +5 -5
- data/lib/fog/google/models/compute/disks.rb +9 -2
- data/lib/fog/hp.rb +108 -19
- data/lib/fog/hp/CHANGELOG.hp +33 -0
- data/lib/fog/hp/block_storage.rb +5 -3
- data/lib/fog/hp/block_storage_v2.rb +164 -0
- data/lib/fog/hp/cdn.rb +3 -2
- data/lib/fog/hp/compute.rb +5 -4
- data/lib/fog/hp/compute_v2.rb +312 -0
- data/lib/fog/hp/dns.rb +135 -0
- data/lib/fog/hp/lb.rb +170 -0
- data/lib/fog/hp/models/block_storage_v2/snapshot.rb +76 -0
- data/lib/fog/hp/models/block_storage_v2/snapshots.rb +43 -0
- data/lib/fog/hp/models/block_storage_v2/volume.rb +139 -0
- data/lib/fog/hp/models/block_storage_v2/volume_backup.rb +58 -0
- data/lib/fog/hp/models/block_storage_v2/volume_backups.rb +42 -0
- data/lib/fog/hp/models/block_storage_v2/volumes.rb +42 -0
- data/lib/fog/hp/models/compute/image.rb +1 -1
- data/lib/fog/hp/models/compute/server.rb +41 -20
- data/lib/fog/hp/models/compute_v2/address.rb +70 -0
- data/lib/fog/hp/models/compute_v2/addresses.rb +29 -0
- data/lib/fog/hp/models/compute_v2/availability_zone.rb +22 -0
- data/lib/fog/hp/models/compute_v2/availability_zones.rb +29 -0
- data/lib/fog/hp/models/compute_v2/flavor.rb +22 -0
- data/lib/fog/hp/models/compute_v2/flavors.rb +42 -0
- data/lib/fog/hp/models/compute_v2/image.rb +87 -0
- data/lib/fog/hp/models/compute_v2/images.rb +43 -0
- data/lib/fog/hp/models/compute_v2/key_pair.rb +54 -0
- data/lib/fog/hp/models/compute_v2/key_pairs.rb +31 -0
- data/lib/fog/hp/models/compute_v2/meta.rb +29 -0
- data/lib/fog/hp/models/compute_v2/meta_parent.rb +33 -0
- data/lib/fog/hp/models/compute_v2/metadata.rb +79 -0
- data/lib/fog/hp/models/compute_v2/server.rb +339 -0
- data/lib/fog/hp/models/compute_v2/servers.rb +56 -0
- data/lib/fog/hp/models/compute_v2/volume_attachment.rb +42 -0
- data/lib/fog/hp/models/compute_v2/volume_attachments.rb +30 -0
- data/lib/fog/hp/models/dns/domain.rb +55 -0
- data/lib/fog/hp/models/dns/domains.rb +28 -0
- data/lib/fog/hp/models/dns/record.rb +59 -0
- data/lib/fog/hp/models/dns/records.rb +32 -0
- data/lib/fog/hp/models/lb/algorithm.rb +24 -0
- data/lib/fog/hp/models/lb/algorithms.rb +26 -0
- data/lib/fog/hp/models/lb/load_balancer.rb +83 -0
- data/lib/fog/hp/models/lb/load_balancers.rb +26 -0
- data/lib/fog/hp/models/lb/node.rb +53 -0
- data/lib/fog/hp/models/lb/nodes.rb +30 -0
- data/lib/fog/hp/models/lb/protocol.rb +25 -0
- data/lib/fog/hp/models/lb/protocols.rb +26 -0
- data/lib/fog/hp/models/lb/virtual_ip.rb +34 -0
- data/lib/fog/hp/models/lb/virtual_ips.rb +33 -0
- data/lib/fog/hp/models/network/floating_ip.rb +45 -0
- data/lib/fog/hp/models/network/floating_ips.rb +36 -0
- data/lib/fog/hp/models/network/network.rb +56 -0
- data/lib/fog/hp/models/network/networks.rb +36 -0
- data/lib/fog/hp/models/network/port.rb +54 -0
- data/lib/fog/hp/models/network/ports.rb +36 -0
- data/lib/fog/hp/models/network/router.rb +66 -0
- data/lib/fog/hp/models/network/routers.rb +36 -0
- data/lib/fog/hp/models/network/security_group.rb +30 -0
- data/lib/fog/hp/models/network/security_group_rule.rb +35 -0
- data/lib/fog/hp/models/network/security_group_rules.rb +36 -0
- data/lib/fog/hp/models/network/security_groups.rb +36 -0
- data/lib/fog/hp/models/network/subnet.rb +49 -0
- data/lib/fog/hp/models/network/subnets.rb +36 -0
- data/lib/fog/hp/models/storage/directories.rb +1 -1
- data/lib/fog/hp/models/storage/directory.rb +41 -8
- data/lib/fog/hp/models/storage/meta.rb +29 -0
- data/lib/fog/hp/models/storage/meta_parent.rb +23 -0
- data/lib/fog/hp/models/storage/metadata.rb +82 -0
- data/lib/fog/hp/network.rb +198 -0
- data/lib/fog/hp/requests/block_storage_v2/create_snapshot.rb +76 -0
- data/lib/fog/hp/requests/block_storage_v2/create_volume.rb +90 -0
- data/lib/fog/hp/requests/block_storage_v2/create_volume_backup.rb +83 -0
- data/lib/fog/hp/requests/block_storage_v2/delete_snapshot.rb +38 -0
- data/lib/fog/hp/requests/block_storage_v2/delete_volume.rb +38 -0
- data/lib/fog/hp/requests/block_storage_v2/delete_volume_backup.rb +38 -0
- data/lib/fog/hp/requests/block_storage_v2/get_snapshot_details.rb +54 -0
- data/lib/fog/hp/requests/block_storage_v2/get_volume_backup_details.rb +55 -0
- data/lib/fog/hp/requests/block_storage_v2/get_volume_details.rb +58 -0
- data/lib/fog/hp/requests/block_storage_v2/list_snapshots.rb +57 -0
- data/lib/fog/hp/requests/block_storage_v2/list_snapshots_detail.rb +54 -0
- data/lib/fog/hp/requests/block_storage_v2/list_volume_backups.rb +52 -0
- data/lib/fog/hp/requests/block_storage_v2/list_volume_backups_detail.rb +58 -0
- data/lib/fog/hp/requests/block_storage_v2/list_volumes.rb +61 -0
- data/lib/fog/hp/requests/block_storage_v2/list_volumes_detail.rb +59 -0
- data/lib/fog/hp/requests/block_storage_v2/restore_volume_backup.rb +97 -0
- data/lib/fog/hp/requests/block_storage_v2/update_snapshot.rb +69 -0
- data/lib/fog/hp/requests/block_storage_v2/update_volume.rb +70 -0
- data/lib/fog/hp/requests/compute/get_console_output.rb +0 -2
- data/lib/fog/hp/requests/compute/get_vnc_console.rb +45 -0
- data/lib/fog/hp/requests/compute_v2/add_security_group.rb +40 -0
- data/lib/fog/hp/requests/compute_v2/allocate_address.rb +53 -0
- data/lib/fog/hp/requests/compute_v2/associate_address.rb +46 -0
- data/lib/fog/hp/requests/compute_v2/attach_volume.rb +80 -0
- data/lib/fog/hp/requests/compute_v2/create_image.rb +63 -0
- data/lib/fog/hp/requests/compute_v2/create_key_pair.rb +73 -0
- data/lib/fog/hp/requests/compute_v2/create_persistent_server.rb +183 -0
- data/lib/fog/hp/requests/compute_v2/create_server.rb +168 -0
- data/lib/fog/hp/requests/compute_v2/delete_image.rb +44 -0
- data/lib/fog/hp/requests/compute_v2/delete_key_pair.rb +38 -0
- data/lib/fog/hp/requests/compute_v2/delete_meta.rb +55 -0
- data/lib/fog/hp/requests/compute_v2/delete_server.rb +43 -0
- data/lib/fog/hp/requests/compute_v2/detach_volume.rb +47 -0
- data/lib/fog/hp/requests/compute_v2/disassociate_address.rb +39 -0
- data/lib/fog/hp/requests/compute_v2/get_address.rb +48 -0
- data/lib/fog/hp/requests/compute_v2/get_console_output.rb +41 -0
- data/lib/fog/hp/requests/compute_v2/get_flavor_details.rb +57 -0
- data/lib/fog/hp/requests/compute_v2/get_image_details.rb +55 -0
- data/lib/fog/hp/requests/compute_v2/get_key_pair.rb +44 -0
- data/lib/fog/hp/requests/compute_v2/get_meta.rb +57 -0
- data/lib/fog/hp/requests/compute_v2/get_server_details.rb +72 -0
- data/lib/fog/hp/requests/compute_v2/get_server_volume_details.rb +47 -0
- data/lib/fog/hp/requests/compute_v2/get_vnc_console.rb +45 -0
- data/lib/fog/hp/requests/compute_v2/get_windows_password.rb +43 -0
- data/lib/fog/hp/requests/compute_v2/list_addresses.rb +44 -0
- data/lib/fog/hp/requests/compute_v2/list_availability_zones.rb +47 -0
- data/lib/fog/hp/requests/compute_v2/list_flavors.rb +53 -0
- data/lib/fog/hp/requests/compute_v2/list_flavors_detail.rb +53 -0
- data/lib/fog/hp/requests/compute_v2/list_images.rb +52 -0
- data/lib/fog/hp/requests/compute_v2/list_images_detail.rb +66 -0
- data/lib/fog/hp/requests/compute_v2/list_key_pairs.rb +42 -0
- data/lib/fog/hp/requests/compute_v2/list_limits.rb +62 -0
- data/lib/fog/hp/requests/compute_v2/list_metadata.rb +56 -0
- data/lib/fog/hp/requests/compute_v2/list_server_addresses.rb +42 -0
- data/lib/fog/hp/requests/compute_v2/list_server_addresses_by_network.rb +46 -0
- data/lib/fog/hp/requests/compute_v2/list_server_volumes.rb +49 -0
- data/lib/fog/hp/requests/compute_v2/list_servers.rb +53 -0
- data/lib/fog/hp/requests/compute_v2/list_servers_detail.rb +80 -0
- data/lib/fog/hp/requests/compute_v2/reboot_server.rb +34 -0
- data/lib/fog/hp/requests/compute_v2/rebuild_server.rb +82 -0
- data/lib/fog/hp/requests/compute_v2/release_address.rb +38 -0
- data/lib/fog/hp/requests/compute_v2/remove_security_group.rb +37 -0
- data/lib/fog/hp/requests/compute_v2/server_action.rb +25 -0
- data/lib/fog/hp/requests/compute_v2/set_metadata.rb +60 -0
- data/lib/fog/hp/requests/compute_v2/update_meta.rb +61 -0
- data/lib/fog/hp/requests/compute_v2/update_metadata.rb +60 -0
- data/lib/fog/hp/requests/compute_v2/update_server.rb +73 -0
- data/lib/fog/hp/requests/dns/create_domain.rb +66 -0
- data/lib/fog/hp/requests/dns/create_record.rb +79 -0
- data/lib/fog/hp/requests/dns/delete_domain.rb +37 -0
- data/lib/fog/hp/requests/dns/delete_record.rb +36 -0
- data/lib/fog/hp/requests/dns/get_domain.rb +43 -0
- data/lib/fog/hp/requests/dns/get_record.rb +47 -0
- data/lib/fog/hp/requests/dns/get_servers_hosting_domain.rb +62 -0
- data/lib/fog/hp/requests/dns/list_domains.rb +38 -0
- data/lib/fog/hp/requests/dns/list_records_in_a_domain.rb +55 -0
- data/lib/fog/hp/requests/dns/update_domain.rb +62 -0
- data/lib/fog/hp/requests/dns/update_record.rb +70 -0
- data/lib/fog/hp/requests/lb/create_load_balancer.rb +110 -0
- data/lib/fog/hp/requests/lb/create_load_balancer_node.rb +72 -0
- data/lib/fog/hp/requests/lb/delete_load_balancer.rb +36 -0
- data/lib/fog/hp/requests/lb/delete_load_balancer_node.rb +47 -0
- data/lib/fog/hp/requests/lb/get_load_balancer.rb +60 -0
- data/lib/fog/hp/requests/lb/get_load_balancer_node.rb +54 -0
- data/lib/fog/hp/requests/lb/list_algorithms.rb +32 -0
- data/lib/fog/hp/requests/lb/list_limits.rb +40 -0
- data/lib/fog/hp/requests/lb/list_load_balancer_nodes.rb +41 -0
- data/lib/fog/hp/requests/lb/list_load_balancer_virtual_ips.rb +44 -0
- data/lib/fog/hp/requests/lb/list_load_balancers.rb +41 -0
- data/lib/fog/hp/requests/lb/list_protocols.rb +34 -0
- data/lib/fog/hp/requests/lb/list_versions.rb +27 -0
- data/lib/fog/hp/requests/lb/update_load_balancer.rb +47 -0
- data/lib/fog/hp/requests/lb/update_load_balancer_node.rb +59 -0
- data/lib/fog/hp/requests/network/add_router_interface.rb +75 -0
- data/lib/fog/hp/requests/network/associate_floating_ip.rb +71 -0
- data/lib/fog/hp/requests/network/create_floating_ip.rb +69 -0
- data/lib/fog/hp/requests/network/create_network.rb +68 -0
- data/lib/fog/hp/requests/network/create_port.rb +92 -0
- data/lib/fog/hp/requests/network/create_router.rb +64 -0
- data/lib/fog/hp/requests/network/create_security_group.rb +100 -0
- data/lib/fog/hp/requests/network/create_security_group_rule.rb +83 -0
- data/lib/fog/hp/requests/network/create_subnet.rb +97 -0
- data/lib/fog/hp/requests/network/delete_floating_ip.rb +34 -0
- data/lib/fog/hp/requests/network/delete_network.rb +34 -0
- data/lib/fog/hp/requests/network/delete_port.rb +34 -0
- data/lib/fog/hp/requests/network/delete_router.rb +34 -0
- data/lib/fog/hp/requests/network/delete_security_group.rb +36 -0
- data/lib/fog/hp/requests/network/delete_security_group_rule.rb +36 -0
- data/lib/fog/hp/requests/network/delete_subnet.rb +34 -0
- data/lib/fog/hp/requests/network/disassociate_floating_ip.rb +71 -0
- data/lib/fog/hp/requests/network/get_floating_ip.rb +47 -0
- data/lib/fog/hp/requests/network/get_network.rb +49 -0
- data/lib/fog/hp/requests/network/get_port.rb +53 -0
- data/lib/fog/hp/requests/network/get_router.rb +46 -0
- data/lib/fog/hp/requests/network/get_security_group.rb +56 -0
- data/lib/fog/hp/requests/network/get_security_group_rule.rb +51 -0
- data/lib/fog/hp/requests/network/get_subnet.rb +52 -0
- data/lib/fog/hp/requests/network/list_floating_ips.rb +46 -0
- data/lib/fog/hp/requests/network/list_networks.rb +48 -0
- data/lib/fog/hp/requests/network/list_ports.rb +52 -0
- data/lib/fog/hp/requests/network/list_routers.rb +45 -0
- data/lib/fog/hp/requests/network/list_security_group_rules.rb +52 -0
- data/lib/fog/hp/requests/network/list_security_groups.rb +57 -0
- data/lib/fog/hp/requests/network/list_subnets.rb +51 -0
- data/lib/fog/hp/requests/network/remove_router_interface.rb +67 -0
- data/lib/fog/hp/requests/network/update_network.rb +62 -0
- data/lib/fog/hp/requests/network/update_port.rb +75 -0
- data/lib/fog/hp/requests/network/update_router.rb +62 -0
- data/lib/fog/hp/requests/network/update_subnet.rb +72 -0
- data/lib/fog/hp/requests/storage/post_container.rb +38 -0
- data/lib/fog/hp/requests/storage/post_object.rb +56 -0
- data/lib/fog/hp/simple_http_instrumentor.rb +59 -0
- data/lib/fog/hp/storage.rb +6 -6
- data/lib/fog/internet_archive/models/storage/file.rb +1 -1
- data/lib/fog/internet_archive/requests/storage/head_object.rb +2 -2
- data/lib/fog/openstack/identity.rb +1 -1
- data/lib/fog/openstack/models/storage/file.rb +1 -1
- data/lib/fog/rackspace.rb +4 -1
- data/lib/fog/rackspace/docs/compute_v2.md +2 -2
- data/lib/fog/rackspace/docs/storage.md +1 -1
- data/lib/fog/rackspace/examples/compute_v2/create_image.rb +1 -1
- data/lib/fog/rackspace/examples/compute_v2/delete_image.rb +1 -1
- data/lib/fog/rackspace/examples/compute_v2/delete_server.rb +1 -1
- data/lib/fog/rackspace/examples/compute_v2/detach_volume.rb +2 -2
- data/lib/fog/rackspace/examples/compute_v2/resize_server.rb +1 -1
- data/lib/fog/rackspace/examples/compute_v2/server_attachments.rb +1 -1
- data/lib/fog/rackspace/examples/storage/create_cdn_directory.rb +1 -1
- data/lib/fog/rackspace/examples/storage/delete_directory.rb +1 -1
- data/lib/fog/rackspace/examples/storage/delete_file.rb +1 -1
- data/lib/fog/rackspace/examples/storage/download_file.rb +1 -1
- data/lib/fog/rackspace/models/compute_v2/images.rb +1 -1
- data/lib/fog/rackspace/models/compute_v2/metadata.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/server.rb +2 -2
- data/lib/fog/rackspace/models/compute_v2/servers.rb +1 -1
- data/lib/fog/rackspace/models/storage/file.rb +19 -0
- data/lib/fog/rackspace/models/storage/files.rb +25 -0
- data/lib/fog/rackspace/monitoring.rb +20 -1
- data/lib/fog/rackspace/requests/compute_v2/delete_image.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/list_metadata.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/set_metadata.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/set_metadata_item.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/update_metadata.rb +1 -1
- data/lib/fog/rackspace/requests/monitoring/get_monitoring_zone.rb +15 -0
- data/lib/fog/rackspace/requests/monitoring/list_monitoring_zones.rb +15 -0
- data/lib/fog/rackspace/requests/storage/get_object_http_url.rb +30 -0
- data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +2 -1
- data/lib/fog/rackspace/storage.rb +1 -0
- data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +10 -8
- data/lib/fog/vcloud_director/requests/compute/get_edge_gateway.rb +2 -0
- data/lib/fog/vcloud_director/requests/compute/get_task.rb +10 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +1 -0
- data/lib/fog/vsphere/models/compute/server.rb +2 -2
- data/lib/fog/vsphere/models/compute/volume.rb +59 -4
- data/lib/fog/vsphere/models/compute/volumes.rb +22 -7
- data/lib/fog/vsphere/requests/compute/create_vm.rb +9 -3
- data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +3 -1
- data/lib/fog/vsphere/requests/compute/modify_vm_volume.rb +26 -0
- data/lib/tasks/changelog_task.rb +2 -0
- data/tests/aws/requests/compute/internet_gateway_tests.rb +5 -0
- data/tests/compute/helper.rb +6 -4
- data/tests/ecloud/compute/models/server_tests.rb +34 -41
- data/tests/hp/block_storage_tests.rb +47 -0
- data/tests/hp/cdn_tests.rb +23 -0
- data/tests/hp/compute_tests.rb +22 -0
- data/tests/hp/models/block_storage_v2/snapshot_tests.rb +22 -0
- data/tests/hp/models/block_storage_v2/snapshots_tests.rb +10 -0
- data/tests/hp/models/block_storage_v2/volume_backup_tests.rb +22 -0
- data/tests/hp/models/block_storage_v2/volume_backups_tests.rb +9 -0
- data/tests/hp/models/block_storage_v2/volume_tests.rb +22 -0
- data/tests/hp/models/block_storage_v2/volumes_tests.rb +5 -0
- data/tests/hp/models/compute_v2/address_tests.rb +23 -0
- data/tests/hp/models/compute_v2/addresses_tests.rb +7 -0
- data/tests/hp/models/compute_v2/availability_zone_tests.rb +13 -0
- data/tests/hp/models/compute_v2/availability_zones_tests.rb +13 -0
- data/tests/hp/models/compute_v2/key_pair_tests.rb +29 -0
- data/tests/hp/models/compute_v2/key_pairs_tests.rb +7 -0
- data/tests/hp/models/compute_v2/metadata_image_tests.rb +60 -0
- data/tests/hp/models/compute_v2/metadata_server_tests.rb +56 -0
- data/tests/hp/models/compute_v2/server_tests.rb +45 -0
- data/tests/hp/models/compute_v2/servers_tests.rb +9 -0
- data/tests/hp/models/compute_v2/volume_attachment_tests.rb +40 -0
- data/tests/hp/models/compute_v2/volume_attachments_tests.rb +17 -0
- data/tests/hp/models/dns/domain_tests.rb +25 -0
- data/tests/hp/models/dns/domains_tests.rb +14 -0
- data/tests/hp/models/dns/record_tests.rb +29 -0
- data/tests/hp/models/dns/records_tests.rb +9 -0
- data/tests/hp/models/lb/algorithms_tests.rb +15 -0
- data/tests/hp/models/lb/load_balancer_node_tests.rb +9 -0
- data/tests/hp/models/lb/load_balancer_nodes_tests.rb +27 -0
- data/tests/hp/models/lb/load_balancer_tests.rb +6 -0
- data/tests/hp/models/lb/load_balancer_virtual_ips_tests.rb +22 -0
- data/tests/hp/models/lb/load_balancers_tests.rb +22 -0
- data/tests/hp/models/lb/protocols_tests.rb +15 -0
- data/tests/hp/models/network/floating_ip_tests.rb +37 -0
- data/tests/hp/models/network/floating_ips_tests.rb +8 -0
- data/tests/hp/models/network/network_tests.rb +25 -0
- data/tests/hp/models/network/networks_tests.rb +15 -0
- data/tests/hp/models/network/port_tests.rb +30 -0
- data/tests/hp/models/network/ports_tests.rb +21 -0
- data/tests/hp/models/network/router_tests.rb +55 -0
- data/tests/hp/models/network/routers_tests.rb +19 -0
- data/tests/hp/models/network/security_group_rule_tests.rb +25 -0
- data/tests/hp/models/network/security_group_rules_tests.rb +23 -0
- data/tests/hp/models/network/security_group_tests.rb +20 -0
- data/tests/hp/models/network/security_groups_tests.rb +20 -0
- data/tests/hp/models/network/subnet_tests.rb +30 -0
- data/tests/hp/models/network/subnets_tests.rb +22 -0
- data/tests/hp/models/storage/directory_tests.rb +70 -0
- data/tests/hp/requests/block_storage_v2/snapshot_tests.rb +69 -0
- data/tests/hp/requests/block_storage_v2/volume_backup_tests.rb +117 -0
- data/tests/hp/requests/block_storage_v2/volume_tests.rb +106 -0
- data/tests/hp/requests/compute_v2/address_tests.rb +80 -0
- data/tests/hp/requests/compute_v2/availability_zone_tests.rb +19 -0
- data/tests/hp/requests/compute_v2/flavor_tests.rb +45 -0
- data/tests/hp/requests/compute_v2/image_tests.rb +86 -0
- data/tests/hp/requests/compute_v2/key_pair_tests.rb +66 -0
- data/tests/hp/requests/compute_v2/metadata_tests.rb +101 -0
- data/tests/hp/requests/compute_v2/persistent_server_tests.rb +67 -0
- data/tests/hp/requests/compute_v2/server_address_tests.rb +46 -0
- data/tests/hp/requests/compute_v2/server_security_group_tests.rb +43 -0
- data/tests/hp/requests/compute_v2/server_tests.rb +113 -0
- data/tests/hp/requests/compute_v2/server_volume_tests.rb +85 -0
- data/tests/hp/requests/dns/domain_tests.rb +72 -0
- data/tests/hp/requests/dns/records_tests.rb +65 -0
- data/tests/hp/requests/lb/algorithms_tests.rb +15 -0
- data/tests/hp/requests/lb/limits_tests.rb +18 -0
- data/tests/hp/requests/lb/load_balancer_nodes_tests.rb +47 -0
- data/tests/hp/requests/lb/load_balancer_tests.rb +56 -0
- data/tests/hp/requests/lb/protocols_tests.rb +15 -0
- data/tests/hp/requests/lb/versions_tests.rb +17 -0
- data/tests/hp/requests/lb/virtual_ips_tests.rb +34 -0
- data/tests/hp/requests/network/floating_ip_tests.rb +70 -0
- data/tests/hp/requests/network/network_tests.rb +57 -0
- data/tests/hp/requests/network/port_tests.rb +71 -0
- data/tests/hp/requests/network/router_tests.rb +108 -0
- data/tests/hp/requests/network/security_group_rule_tests.rb +58 -0
- data/tests/hp/requests/network/security_group_tests.rb +48 -0
- data/tests/hp/requests/network/subnet_tests.rb +71 -0
- data/tests/hp/requests/storage/container_tests.rb +9 -1
- data/tests/hp/requests/storage/object_tests.rb +15 -1
- data/tests/hp/storage_tests.rb +25 -0
- data/tests/rackspace/cdn_tests.rb +1 -1
- data/tests/rackspace/models/compute_v2/metadata_tests.rb +1 -1
- data/tests/rackspace/models/identity/service_catalog_tests.rb +1 -1
- data/tests/rackspace/models/storage/file_tests.rb +19 -6
- data/tests/rackspace/models/storage/files_tests.rb +44 -0
- data/tests/rackspace/requests/monitoring/helper.rb +64 -0
- data/tests/rackspace/requests/monitoring/list_tests.rb +14 -2
- data/tests/rackspace/requests/storage/large_object_tests.rb +8 -6
- data/tests/rackspace/requests/storage/object_tests.rb +11 -0
- data/tests/rackspace/storage_tests.rb +4 -4
- data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +48 -44
- data/tests/vcloud_director/requests/compute/network_tests.rb +2 -0
- metadata +356 -5
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'fog/core/model'
|
2
|
+
require 'fog/hp/models/storage/meta_parent'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Storage
|
6
|
+
class HP
|
7
|
+
class Meta < Fog::Model
|
8
|
+
|
9
|
+
include Fog::Storage::HP::MetaParent
|
10
|
+
|
11
|
+
identity :key
|
12
|
+
attribute :value
|
13
|
+
|
14
|
+
def destroy
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
18
|
+
def save
|
19
|
+
requires :identity, :value
|
20
|
+
if @parent.key
|
21
|
+
service.put_container(@parent.key, {key => value})
|
22
|
+
true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Storage
|
3
|
+
class HP
|
4
|
+
module MetaParent
|
5
|
+
|
6
|
+
def parent
|
7
|
+
@parent
|
8
|
+
end
|
9
|
+
|
10
|
+
def parent=(new_parent)
|
11
|
+
@parent = new_parent
|
12
|
+
end
|
13
|
+
|
14
|
+
def metas_to_hash(metas)
|
15
|
+
hash = {}
|
16
|
+
metas.each { |meta| hash.store(meta.key, meta.value) }
|
17
|
+
hash
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/hp/models/storage/meta_parent'
|
3
|
+
require 'fog/hp/models/storage/meta'
|
4
|
+
|
5
|
+
module Fog
|
6
|
+
module Storage
|
7
|
+
class HP
|
8
|
+
|
9
|
+
class Metadata < Fog::Collection
|
10
|
+
|
11
|
+
model Fog::Storage::HP::Meta
|
12
|
+
|
13
|
+
include Fog::Storage::HP::MetaParent
|
14
|
+
|
15
|
+
def all
|
16
|
+
requires :parent
|
17
|
+
if @parent.key
|
18
|
+
metadata = service.head_container(@parent.key).headers
|
19
|
+
metas = []
|
20
|
+
metadata.each_pair {|k,v| metas << {'key' => k, 'value' => v} }
|
21
|
+
load(metas)
|
22
|
+
end
|
23
|
+
rescue Fog::Storage::HP::NotFound
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def destroy
|
28
|
+
false
|
29
|
+
end
|
30
|
+
|
31
|
+
def get(key)
|
32
|
+
requires :parent
|
33
|
+
if @parent.key
|
34
|
+
metadata = service.head_container(@parent.key).headers
|
35
|
+
metas = []
|
36
|
+
metas << {'key' => key, 'value' => metadata[key]}
|
37
|
+
new(metas[0])
|
38
|
+
end
|
39
|
+
rescue Fog::Storage::HP::NotFound
|
40
|
+
nil
|
41
|
+
end
|
42
|
+
|
43
|
+
def new(attributes = {})
|
44
|
+
requires :parent
|
45
|
+
super({ :parent => @parent }.merge!(attributes))
|
46
|
+
end
|
47
|
+
|
48
|
+
def set(data=nil)
|
49
|
+
requires :parent
|
50
|
+
if @parent.key
|
51
|
+
service.put_container(@parent.key, meta_hash(data))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def update(data=nil)
|
56
|
+
requires :parent
|
57
|
+
if @parent.key
|
58
|
+
service.post_container(@parent.key, meta_hash(data))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
private
|
64
|
+
def meta_hash(data=nil)
|
65
|
+
if data.nil?
|
66
|
+
data={}
|
67
|
+
self.each do |meta|
|
68
|
+
if meta.is_a?(Fog::Storage::HP::Meta) then
|
69
|
+
data.store(meta.key, meta.value)
|
70
|
+
else
|
71
|
+
data.store(meta['key'], meta['value'])
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
data
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,198 @@
|
|
1
|
+
require 'fog/hp'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module HP
|
5
|
+
class Network < Fog::Service
|
6
|
+
|
7
|
+
requires :hp_access_key, :hp_secret_key, :hp_tenant_id, :hp_avl_zone
|
8
|
+
recognizes :hp_auth_uri, :credentials, :hp_service_type
|
9
|
+
recognizes :persistent, :connection_options
|
10
|
+
recognizes :hp_use_upass_auth_style, :hp_auth_version, :user_agent
|
11
|
+
|
12
|
+
secrets :hp_secret_key
|
13
|
+
|
14
|
+
model_path 'fog/hp/models/network'
|
15
|
+
model :floating_ip
|
16
|
+
collection :floating_ips
|
17
|
+
model :network
|
18
|
+
collection :networks
|
19
|
+
model :port
|
20
|
+
collection :ports
|
21
|
+
model :router
|
22
|
+
collection :routers
|
23
|
+
model :security_group
|
24
|
+
collection :security_groups
|
25
|
+
model :security_group_rule
|
26
|
+
collection :security_group_rules
|
27
|
+
model :subnet
|
28
|
+
collection :subnets
|
29
|
+
|
30
|
+
request_path 'fog/hp/requests/network'
|
31
|
+
request :add_router_interface
|
32
|
+
request :associate_floating_ip
|
33
|
+
request :create_floating_ip
|
34
|
+
request :create_network
|
35
|
+
request :create_port
|
36
|
+
request :create_router
|
37
|
+
request :create_security_group
|
38
|
+
request :create_security_group_rule
|
39
|
+
request :create_subnet
|
40
|
+
request :disassociate_floating_ip
|
41
|
+
request :delete_floating_ip
|
42
|
+
request :delete_network
|
43
|
+
request :delete_port
|
44
|
+
request :delete_router
|
45
|
+
request :delete_security_group
|
46
|
+
request :delete_security_group_rule
|
47
|
+
request :delete_subnet
|
48
|
+
request :get_floating_ip
|
49
|
+
request :get_network
|
50
|
+
request :get_port
|
51
|
+
request :get_router
|
52
|
+
request :get_security_group
|
53
|
+
request :get_security_group_rule
|
54
|
+
request :get_subnet
|
55
|
+
request :list_floating_ips
|
56
|
+
request :list_networks
|
57
|
+
request :list_ports
|
58
|
+
request :list_routers
|
59
|
+
request :list_security_group_rules
|
60
|
+
request :list_security_groups
|
61
|
+
request :list_subnets
|
62
|
+
request :remove_router_interface
|
63
|
+
request :update_network
|
64
|
+
request :update_port
|
65
|
+
request :update_router
|
66
|
+
request :update_subnet
|
67
|
+
|
68
|
+
module Utils
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
class Mock
|
73
|
+
include Utils
|
74
|
+
|
75
|
+
def self.data
|
76
|
+
@data ||= Hash.new do |hash, key|
|
77
|
+
hash[key] = {
|
78
|
+
:floating_ips => {},
|
79
|
+
:networks => {
|
80
|
+
'X0X0X0ExtNetX0X0X0' =>
|
81
|
+
{
|
82
|
+
'id' => 'X0X0X0ExtNetX0X0X0',
|
83
|
+
'name' => 'Mock-Ext-Net',
|
84
|
+
'tenant_id' => Fog::Mock.random_numbers(14).to_s,
|
85
|
+
'status' => 'ACTIVE',
|
86
|
+
'subnets' => [],
|
87
|
+
'router:external' => true,
|
88
|
+
'admin_state_up' => true,
|
89
|
+
'shared' => true
|
90
|
+
}
|
91
|
+
},
|
92
|
+
:ports => {},
|
93
|
+
:routers => {},
|
94
|
+
:security_groups => {},
|
95
|
+
:security_group_rules => {},
|
96
|
+
:subnets => {}
|
97
|
+
}
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.reset
|
102
|
+
@data = nil
|
103
|
+
end
|
104
|
+
|
105
|
+
def initialize(options={})
|
106
|
+
@hp_access_key = options[:hp_access_key]
|
107
|
+
end
|
108
|
+
|
109
|
+
def data
|
110
|
+
self.class.data[@hp_access_key]
|
111
|
+
end
|
112
|
+
|
113
|
+
def reset_data
|
114
|
+
self.class.data.delete(@hp_access_key)
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
class Real
|
120
|
+
include Utils
|
121
|
+
attr_reader :credentials
|
122
|
+
|
123
|
+
def initialize(options={})
|
124
|
+
@hp_access_key = options[:hp_access_key]
|
125
|
+
@hp_secret_key = options[:hp_secret_key]
|
126
|
+
@hp_auth_uri = options[:hp_auth_uri]
|
127
|
+
@connection_options = options[:connection_options] || {}
|
128
|
+
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
|
129
|
+
auth_version = options[:hp_auth_version] || :v2
|
130
|
+
### Pass the service name for network to the authentication call
|
131
|
+
options[:hp_service_type] ||= "Networking"
|
132
|
+
@hp_tenant_id = options[:hp_tenant_id]
|
133
|
+
@hp_avl_zone = options[:hp_avl_zone]
|
134
|
+
|
135
|
+
### Make the authentication call
|
136
|
+
if (auth_version == :v2)
|
137
|
+
# Call the control services authentication
|
138
|
+
credentials = Fog::HP.authenticate_v2(options, @connection_options)
|
139
|
+
# the CS service catalog returns the network endpoint
|
140
|
+
@hp_network_uri = credentials[:endpoint_url]
|
141
|
+
@credentials = credentials
|
142
|
+
else
|
143
|
+
# Call the legacy v1.0/v1.1 authentication
|
144
|
+
credentials = Fog::HP.authenticate_v1(options, @connection_options)
|
145
|
+
# the user sends in the network endpoint
|
146
|
+
@hp_network_uri = options[:hp_auth_uri]
|
147
|
+
end
|
148
|
+
|
149
|
+
@auth_token = credentials[:auth_token]
|
150
|
+
@persistent = options[:persistent] || false
|
151
|
+
|
152
|
+
uri = URI.parse(@hp_network_uri)
|
153
|
+
@host = uri.host
|
154
|
+
@path = uri.path
|
155
|
+
@port = uri.port
|
156
|
+
@scheme = uri.scheme
|
157
|
+
|
158
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
|
159
|
+
end
|
160
|
+
|
161
|
+
def reload
|
162
|
+
@connection.reset
|
163
|
+
end
|
164
|
+
|
165
|
+
def request(params, parse_json = true, &block)
|
166
|
+
begin
|
167
|
+
response = @connection.request(params.merge!({
|
168
|
+
:headers => {
|
169
|
+
'Content-Type' => 'application/json',
|
170
|
+
'Accept' => 'application/json',
|
171
|
+
'X-Auth-Token' => @auth_token
|
172
|
+
}.merge!(params[:headers] || {}),
|
173
|
+
:path => "#{@path}/v2.0/#{params[:path]}"
|
174
|
+
}), &block)
|
175
|
+
rescue Excon::Errors::HTTPStatusError => error
|
176
|
+
raise case error
|
177
|
+
when Excon::Errors::NotFound
|
178
|
+
Fog::HP::Network::NotFound.slurp(error)
|
179
|
+
else
|
180
|
+
error
|
181
|
+
end
|
182
|
+
end
|
183
|
+
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
|
184
|
+
if response.body.nil? || response.body == 'null'
|
185
|
+
response.body = ''
|
186
|
+
else
|
187
|
+
response.body = Fog::JSON.decode(response.body)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
response
|
191
|
+
end
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Fog
|
2
|
+
module HP
|
3
|
+
class BlockStorageV2
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Create a new block storage snapshot
|
7
|
+
# The snapshot is created in the same availability_zone as the specified volume
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# * 'volume_id'<~String> - UUId of the volume to create the snapshot from
|
11
|
+
# * options<~Hash>:
|
12
|
+
# * 'display_name'<~String> - Name of the snapshot
|
13
|
+
# * 'display_description'<~String> - Description of the snapshot
|
14
|
+
# * 'force'<~Boolean> - true or false, defaults to false. It allows online snapshots (i.e. when volume is attached)
|
15
|
+
#
|
16
|
+
# ==== Returns
|
17
|
+
# * response<~Excon::Response>:
|
18
|
+
# * body<~Hash>:
|
19
|
+
# * snapshot<~Hash>:
|
20
|
+
# * 'id'<~String>: - UUId for the snapshot
|
21
|
+
# * 'display_name'<~String>: - Name of the snapshot
|
22
|
+
# * 'display_description'<~String>: - Description of the snapshot
|
23
|
+
# * 'size'<~Integer>: - Size in GB for the snapshot
|
24
|
+
# * 'status'<~String>: - Status of the snapshot i.e. "available"
|
25
|
+
# * 'volume_id'<~String>: - UUId of the volume from which the snapshot was created
|
26
|
+
# * 'created_at'<~String>: - Timestamp in UTC when volume was created
|
27
|
+
# * metadata<~Hash>: Hash of metadata for the snapshot
|
28
|
+
def create_snapshot(volume_id, options={})
|
29
|
+
data = {
|
30
|
+
'snapshot' => {
|
31
|
+
'volume_id' => volume_id
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
l_options = ['display_name', 'display_description', 'force']
|
36
|
+
l_options.select{|o| options[o]}.each do |key|
|
37
|
+
data['snapshot'][key] = options[key]
|
38
|
+
end
|
39
|
+
|
40
|
+
request(
|
41
|
+
:body => Fog::JSON.encode(data),
|
42
|
+
:expects => 200,
|
43
|
+
:method => 'POST',
|
44
|
+
:path => 'snapshots'
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
class Mock # :nodoc:all
|
51
|
+
|
52
|
+
def create_snapshot(volume_id, options={})
|
53
|
+
response = Excon::Response.new
|
54
|
+
if self.data[:volumes][volume_id]
|
55
|
+
response.status = 200
|
56
|
+
data = {
|
57
|
+
'id' => Fog::HP::Mock.uuid.to_s,
|
58
|
+
'display_name' => options['display_name'] || '',
|
59
|
+
'display_description' => options['display_description'] || '',
|
60
|
+
'size' => self.data[:volumes][volume_id]['size'],
|
61
|
+
'status' => 'available',
|
62
|
+
'volume_id' => volume_id,
|
63
|
+
'created_at' => Time.now.to_s
|
64
|
+
}
|
65
|
+
self.data[:snapshots][data['id']] = data
|
66
|
+
response.body = { 'snapshot' => data }
|
67
|
+
else
|
68
|
+
raise Fog::HP::BlockStorageV2::NotFound
|
69
|
+
end
|
70
|
+
response
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
module Fog
|
2
|
+
module HP
|
3
|
+
class BlockStorageV2
|
4
|
+
class Real
|
5
|
+
|
6
|
+
# Create a new block storage volume
|
7
|
+
#
|
8
|
+
# ==== Parameters
|
9
|
+
# * options<~Hash>:
|
10
|
+
# * 'display_name'<~String> - Name of the volume
|
11
|
+
# * 'display_description'<~String> - Description of the volume
|
12
|
+
# * 'size'<~Integer> - Size of the volume (in GBs). Size is optional only if 'snapshot_id' is specified.
|
13
|
+
# * 'snapshot_id'<~String> - UUId of the volume snapshot to create the volume from. The snapshot_id, imageRef and the source_volid parameters are mutually exclusive, and only one should be specified in the request.
|
14
|
+
# * 'imageRef'<~String> - UUId of the image to create the volume from. This creates a bootable volume. The snapshot_id, imageRef and the source_volid parameters are mutually exclusive, and only one should be specified in the request.
|
15
|
+
# * 'source_volid'<~String> - UUId of an 'available' volume to create the volume from. The request is invalid if the volume is not available. The snapshot_id, imageRef and the source_volid parameters are mutually exclusive, and only one should be specified in the request.
|
16
|
+
# * 'availability_zone'<~String> - Availability zone where the volume should be created. Defaults to 'az1'.
|
17
|
+
# * 'volume_type'<~String> - Type of the volume
|
18
|
+
# * 'metadata'<~Hash> - Up to 5 key value pairs containing 255 bytes of info
|
19
|
+
#
|
20
|
+
# ==== Returns
|
21
|
+
# * response<~Excon::Response>:
|
22
|
+
# * body<~Hash>:
|
23
|
+
# * volume<~Hash>:
|
24
|
+
# * 'id'<~String> - UUId for the volume
|
25
|
+
# * 'display_name'<~String> - Name of the volume
|
26
|
+
# * 'display_description'<~String> - Description of the volume
|
27
|
+
# * 'size'<~Integer> - Size in GB for the volume
|
28
|
+
# * 'status'<~String> - Status of the volume i.e. "creating"
|
29
|
+
# * 'volume_type'<~String> - Type of the volume
|
30
|
+
# * 'snapshot_id'<~String> - UUId of the snapshot, the volume was created from.
|
31
|
+
# * 'source_volid'<~String> - UUId of a volume, the volume was created from.
|
32
|
+
# * 'created_at'<~String> - Timestamp in UTC when volume was created
|
33
|
+
# * 'availability_zone'<~String> - Availability zone i.e. "az1"
|
34
|
+
# * attachments<~Array>: Array of hashes of attachments
|
35
|
+
# * metadata<~Hash>: Hash of metadata for the volume
|
36
|
+
def create_volume(options={})
|
37
|
+
data = {
|
38
|
+
'volume' => {}
|
39
|
+
}
|
40
|
+
|
41
|
+
l_options = ['display_name', 'display_description', 'size',
|
42
|
+
'snapshot_id', 'imageRef', 'source_volid',
|
43
|
+
'availability_zone', 'volume_type', 'metadata']
|
44
|
+
l_options.select{|o| options[o]}.each do |key|
|
45
|
+
data['volume'][key] = options[key]
|
46
|
+
end
|
47
|
+
|
48
|
+
request(
|
49
|
+
:body => Fog::JSON.encode(data),
|
50
|
+
:expects => 200,
|
51
|
+
:method => 'POST',
|
52
|
+
:path => 'volumes'
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
class Mock # :nodoc:all
|
59
|
+
|
60
|
+
def create_volume(options={})
|
61
|
+
if options['snapshot_id'] && options['imageRef'] && options['source_volid']
|
62
|
+
raise Fog::Errors::BadRequest.new('The snapshot_id, imageRef and the source_volid parameters are mutually exclusive, and only one should be specified in the request.')
|
63
|
+
else
|
64
|
+
response = Excon::Response.new
|
65
|
+
response.status = 200
|
66
|
+
data = {
|
67
|
+
'id' => Fog::HP::Mock.uuid.to_s,
|
68
|
+
'status' => 'available',
|
69
|
+
'display_name' => options['display_name'] || '',
|
70
|
+
'attachments' => [{}],
|
71
|
+
'availability_zone' => options['availability_zone'] || 'az1',
|
72
|
+
'bootable' => false,
|
73
|
+
'created_at' => Time.now.to_s,
|
74
|
+
'display_description' => options['display_description'] || '',
|
75
|
+
'volume_type' => 'None',
|
76
|
+
'snapshot_id' => options['snapshot_id'] || '',
|
77
|
+
'source_volid' => options['source_volid'] || '',
|
78
|
+
'metadata' => options['metadata'] || {},
|
79
|
+
'size' => options['size']
|
80
|
+
}
|
81
|
+
self.data[:volumes][data['id']] = data
|
82
|
+
response.body = { 'volume' => data }
|
83
|
+
response
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|