fog 1.18.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +6 -0
- data/CONTRIBUTING.md +22 -0
- data/LICENSE.md +20 -0
- data/README.md +41 -60
- data/Rakefile +2 -0
- data/changelog.txt +262 -0
- data/fog.gemspec +3 -3
- data/lib/fog/aws.rb +9 -7
- data/lib/fog/aws/cloud_watch.rb +0 -1
- data/lib/fog/aws/compute.rb +2 -0
- data/lib/fog/aws/dns.rb +2 -1
- data/lib/fog/aws/elb.rb +2 -0
- data/lib/fog/aws/models/auto_scaling/configuration.rb +4 -0
- data/lib/fog/aws/models/compute/address.rb +6 -5
- data/lib/fog/aws/models/compute/flavors.rb +10 -0
- data/lib/fog/aws/models/compute/spot_request.rb +1 -1
- data/lib/fog/aws/models/compute/subnet.rb +4 -0
- data/lib/fog/aws/models/compute/vpc.rb +5 -0
- data/lib/fog/aws/models/dns/records.rb +1 -3
- data/lib/fog/aws/models/elb/load_balancer.rb +10 -0
- data/lib/fog/aws/models/glacier/vault.rb +1 -1
- data/lib/fog/aws/models/rds/server.rb +5 -2
- data/lib/fog/aws/models/rds/subnet_group.rb +15 -1
- data/lib/fog/aws/models/storage/file.rb +2 -2
- data/lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb +6 -0
- data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +25 -0
- data/lib/fog/aws/parsers/compute/describe_addresses.rb +1 -1
- data/lib/fog/aws/parsers/elb/describe_load_balancer_attributes.rb +40 -0
- data/lib/fog/aws/parsers/rds/delete_db_subnet_group.rb +35 -0
- data/lib/fog/aws/rds.rb +3 -3
- data/lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb +2 -0
- data/lib/fog/aws/requests/auto_scaling/describe_notification_configurations.rb +1 -1
- data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +60 -0
- data/lib/fog/aws/requests/compute/create_route.rb +1 -1
- data/lib/fog/aws/requests/compute/describe_images.rb +1 -1
- data/lib/fog/aws/requests/compute/describe_subnets.rb +8 -0
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +8 -0
- data/lib/fog/aws/requests/compute/modify_vpc_attribute.rb +59 -0
- data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +26 -9
- data/lib/fog/aws/requests/dns/create_hosted_zone.rb +12 -3
- data/lib/fog/aws/requests/dns/delete_hosted_zone.rb +33 -0
- data/lib/fog/aws/requests/dns/get_change.rb +26 -0
- data/lib/fog/aws/requests/dns/get_hosted_zone.rb +1 -1
- data/lib/fog/aws/requests/dns/list_hosted_zones.rb +3 -8
- data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +68 -0
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -0
- data/lib/fog/aws/requests/elb/describe_load_balancer_attributes.rb +54 -0
- data/lib/fog/aws/requests/elb/modify_load_balancer_attributes.rb +59 -0
- data/lib/fog/aws/requests/rds/create_db_instance.rb +7 -1
- data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +7 -1
- data/lib/fog/aws/requests/rds/delete_db_subnet_group.rb +42 -0
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +6 -4
- data/lib/fog/aws/requests/storage/put_bucket.rb +4 -1
- data/lib/fog/aws/sqs.rb +2 -4
- data/lib/fog/aws/storage.rb +14 -1
- data/lib/fog/bluebox/compute.rb +1 -1
- data/lib/fog/brightbox/compute.rb +7 -9
- data/lib/fog/brightbox/compute/image_selector.rb +1 -1
- data/lib/fog/brightbox/compute/shared.rb +8 -10
- data/lib/fog/brightbox/models/compute/api_client.rb +1 -1
- data/lib/fog/brightbox/models/compute/application.rb +1 -4
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +8 -5
- data/lib/fog/brightbox/models/compute/collaboration.rb +0 -2
- data/lib/fog/brightbox/models/compute/collaborations.rb +1 -1
- data/lib/fog/brightbox/models/compute/firewall_policy.rb +2 -4
- data/lib/fog/brightbox/models/compute/firewall_rule.rb +1 -1
- data/lib/fog/brightbox/models/compute/image.rb +1 -3
- data/lib/fog/brightbox/models/compute/load_balancer.rb +11 -8
- data/lib/fog/brightbox/models/compute/server.rb +28 -20
- data/lib/fog/brightbox/models/compute/server_group.rb +9 -11
- data/lib/fog/brightbox/models/compute/zone.rb +1 -1
- data/lib/fog/brightbox/oauth2.rb +3 -3
- data/lib/fog/brightbox/requests/compute/update_server.rb +1 -1
- data/lib/fog/cloudstack.rb +1 -1
- data/lib/fog/compute.rb +2 -2
- data/lib/fog/core.rb +1 -1
- data/lib/fog/core/connection.rb +1 -2
- data/lib/fog/core/errors.rb +3 -3
- data/lib/fog/core/hmac.rb +3 -3
- data/lib/fog/core/mock.rb +9 -2
- data/lib/fog/core/scp.rb +1 -1
- data/lib/fog/core/wait_for.rb +1 -1
- data/lib/fog/core/{timeout.rb → wait_for_defaults.rb} +10 -0
- data/lib/fog/digitalocean/models/compute/server.rb +4 -0
- data/lib/fog/digitalocean/requests/compute/create_server.rb +2 -0
- data/lib/fog/dnsimple/dns.rb +1 -1
- data/lib/fog/dreamhost/dns.rb +2 -4
- data/lib/fog/ecloud/compute.rb +1 -1
- data/lib/fog/ecloud/models/compute/environments.rb +5 -3
- data/lib/fog/google/compute.rb +105 -68
- data/lib/fog/google/examples/create.rb +1 -0
- data/lib/fog/google/models/compute/disk.rb +7 -1
- data/lib/fog/google/models/compute/operation.rb +42 -0
- data/lib/fog/google/models/compute/operations.rb +26 -0
- data/lib/fog/google/models/compute/server.rb +18 -2
- data/lib/fog/google/models/compute/servers.rb +2 -1
- data/lib/fog/google/models/compute/zones.rb +1 -1
- data/lib/fog/google/models/storage/file.rb +1 -1
- data/lib/fog/google/models/storage/files.rb +1 -1
- data/lib/fog/google/requests/compute/delete_disk.rb +22 -2
- data/lib/fog/google/requests/compute/delete_global_operation.rb +29 -0
- data/lib/fog/google/requests/compute/delete_server.rb +13 -9
- data/lib/fog/google/requests/compute/delete_zone_operation.rb +33 -0
- data/lib/fog/google/requests/compute/get_disk.rb +26 -2
- data/lib/fog/google/requests/compute/{delete_operation.rb → get_global_operation.rb} +5 -6
- data/lib/fog/google/requests/compute/get_image.rb +3 -3
- data/lib/fog/google/requests/compute/get_server.rb +1 -0
- data/lib/fog/google/requests/compute/get_zone_operation.rb +58 -0
- data/lib/fog/google/requests/compute/insert_disk.rb +43 -3
- data/lib/fog/google/requests/compute/insert_firewall.rb +2 -1
- data/lib/fog/google/requests/compute/insert_image.rb +2 -2
- data/lib/fog/google/requests/compute/insert_server.rb +64 -35
- data/lib/fog/google/requests/compute/list_disks.rb +8 -2
- data/lib/fog/google/requests/compute/list_images.rb +2 -2
- data/lib/fog/google/requests/compute/list_machine_types.rb +2 -2
- data/lib/fog/google/requests/compute/list_servers.rb +2 -2
- data/lib/fog/google/requests/compute/list_zone_operations.rb +2 -1
- data/lib/fog/google/requests/compute/list_zones.rb +1 -1
- data/lib/fog/google/requests/storage/copy_object.rb +1 -1
- data/lib/fog/hp.rb +1 -1
- data/lib/fog/hp/README.md +57 -0
- data/lib/fog/hp/articles/auth_caching.md +23 -0
- data/lib/fog/hp/docs/connect.md +152 -0
- data/lib/fog/hp/docs/install.md +133 -0
- data/lib/fog/hp/examples/block_storage.md +296 -0
- data/lib/fog/hp/examples/block_storage_v2.md +446 -0
- data/lib/fog/hp/examples/cdn.md +54 -0
- data/lib/fog/hp/examples/compute.md +794 -0
- data/lib/fog/hp/examples/compute_v2.md +848 -0
- data/lib/fog/hp/examples/getting_started_examples.md +30 -0
- data/lib/fog/hp/examples/networking.md +472 -0
- data/lib/fog/hp/examples/object_storage.md +387 -0
- data/lib/fog/json.rb +6 -3
- data/lib/fog/local/models/storage/directories.rb +8 -4
- data/lib/fog/openstack/compute.rb +3 -0
- data/lib/fog/openstack/examples/compute/basics.rb +74 -0
- data/lib/fog/openstack/identity.rb +2 -3
- data/lib/fog/openstack/image.rb +1 -4
- data/lib/fog/openstack/metering.rb +1 -4
- data/lib/fog/openstack/models/compute/host.rb +5 -1
- data/lib/fog/openstack/models/compute/security_group.rb +18 -4
- data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
- data/lib/fog/openstack/models/compute/security_group_rules.rb +22 -0
- data/lib/fog/openstack/models/volume/volume_type.rb +20 -0
- data/lib/fog/openstack/models/volume/volume_types.rb +26 -0
- data/lib/fog/openstack/network.rb +34 -6
- data/lib/fog/openstack/requests/compute/add_flavor_access.rb +1 -1
- data/lib/fog/openstack/requests/compute/allocate_address.rb +1 -1
- data/lib/fog/openstack/requests/compute/attach_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_key_pair.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group.rb +4 -4
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +2 -2
- data/lib/fog/openstack/requests/compute/create_server.rb +12 -5
- data/lib/fog/openstack/requests/compute/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +2 -0
- data/lib/fog/openstack/requests/compute/get_security_group.rb +14 -24
- data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
- data/lib/fog/openstack/requests/compute/list_hosts.rb +3 -3
- data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -1
- data/lib/fog/openstack/requests/compute/remove_flavor_access.rb +1 -1
- data/lib/fog/openstack/requests/compute/update_quota.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_ec2_credential.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
- data/lib/fog/openstack/requests/identity/update_user.rb +1 -1
- data/lib/fog/openstack/requests/image/update_image_members.rb +1 -1
- data/lib/fog/openstack/requests/orchestration/create_stack.rb +2 -2
- data/lib/fog/openstack/requests/orchestration/update_stack.rb +1 -1
- data/lib/fog/openstack/requests/storage/get_object_http_url.rb +13 -0
- data/lib/fog/openstack/requests/storage/get_object_https_url.rb +0 -14
- data/lib/fog/openstack/requests/volume/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/volume/get_volume_type_details.rb +32 -0
- data/lib/fog/openstack/requests/volume/list_volume_types.rb +41 -0
- data/lib/fog/openstack/storage.rb +2 -0
- data/lib/fog/openstack/volume.rb +9 -5
- data/lib/fog/rackspace/compute.rb +1 -4
- data/lib/fog/rackspace/compute_v2.rb +1 -0
- data/lib/fog/rackspace/docs/auto_scale.md +9 -9
- data/lib/fog/rackspace/docs/getting_started.md +1 -0
- data/lib/fog/rackspace/docs/queues.md +312 -0
- data/lib/fog/rackspace/examples/queues/claim_messages.rb +60 -0
- data/lib/fog/rackspace/examples/queues/create_queue.rb +45 -0
- data/lib/fog/rackspace/examples/queues/delete_message.rb +72 -0
- data/lib/fog/rackspace/examples/queues/delete_queue.rb +53 -0
- data/lib/fog/rackspace/examples/queues/list_messages.rb +64 -0
- data/lib/fog/rackspace/examples/queues/post_message.rb +59 -0
- data/lib/fog/rackspace/models/compute_v2/key_pairs.rb +1 -1
- data/lib/fog/rackspace/models/compute_v2/server.rb +9 -3
- data/lib/fog/rackspace/models/compute_v2/servers.rb +2 -2
- data/lib/fog/rackspace/models/identity/service_catalog.rb +44 -59
- data/lib/fog/rackspace/models/queues/claim.rb +41 -1
- data/lib/fog/rackspace/models/queues/claims.rb +25 -0
- data/lib/fog/rackspace/models/queues/message.rb +43 -5
- data/lib/fog/rackspace/models/queues/messages.rb +37 -0
- data/lib/fog/rackspace/models/queues/queue.rb +66 -3
- data/lib/fog/rackspace/models/queues/queues.rb +15 -0
- data/lib/fog/rackspace/models/storage/file.rb +8 -1
- data/lib/fog/rackspace/requests/compute_v2/delete_keypair.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/get_keypair.rb +1 -1
- data/lib/fog/rackspace/requests/queues/create_claim.rb +15 -0
- data/lib/fog/rackspace/requests/queues/create_message.rb +15 -0
- data/lib/fog/rackspace/requests/queues/create_queue.rb +11 -0
- data/lib/fog/rackspace/requests/queues/delete_claim.rb +12 -0
- data/lib/fog/rackspace/requests/queues/delete_message.rb +14 -0
- data/lib/fog/rackspace/requests/queues/delete_queue.rb +10 -0
- data/lib/fog/rackspace/requests/queues/get_claim.rb +11 -0
- data/lib/fog/rackspace/requests/queues/get_message.rb +12 -0
- data/lib/fog/rackspace/requests/queues/get_queue.rb +10 -0
- data/lib/fog/rackspace/requests/queues/get_queue_stats.rb +10 -0
- data/lib/fog/rackspace/requests/queues/list_messages.rb +26 -0
- data/lib/fog/rackspace/requests/queues/list_queues.rb +17 -2
- data/lib/fog/rackspace/requests/queues/update_claim.rb +7 -0
- data/lib/fog/rackspace/service.rb +6 -2
- data/lib/fog/rackspace/storage.rb +1 -4
- data/lib/fog/riakcs.rb +2 -2
- data/lib/fog/riakcs/provisioning.rb +1 -3
- data/lib/fog/riakcs/requests/provisioning/create_user.rb +2 -2
- data/lib/fog/riakcs/requests/provisioning/get_user.rb +1 -1
- data/lib/fog/riakcs/requests/provisioning/list_users.rb +1 -1
- data/lib/fog/riakcs/requests/usage/get_usage.rb +1 -1
- data/lib/fog/riakcs/usage.rb +0 -2
- data/lib/fog/vcloud_director/README.md +2 -0
- data/lib/fog/vcloud_director/compute.rb +79 -8
- data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +91 -0
- data/lib/fog/vcloud_director/generators/compute/vapp.rb +30 -0
- data/lib/fog/vcloud_director/generators/compute/vm.rb +33 -0
- data/lib/fog/vcloud_director/models/compute/medias.rb +1 -1
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/requests/compute/delete_network.rb +64 -0
- data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +433 -333
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +3 -1
- data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_configure_edge_gateway_services.rb +20 -2
- data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +176 -0
- data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +1 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +37 -0
- data/lib/fog/vcloud_director/requests/compute/put_vm.rb +39 -0
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +3 -0
- data/lib/fog/vsphere/models/compute/datastore.rb +1 -0
- data/lib/fog/vsphere/models/compute/interface.rb +50 -2
- data/lib/fog/vsphere/models/compute/interfaces.rb +25 -10
- data/lib/fog/vsphere/models/compute/scsicontroller.rb +19 -0
- data/lib/fog/vsphere/models/compute/server.rb +27 -8
- data/lib/fog/vsphere/requests/compute/create_vm.rb +34 -8
- data/lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb +26 -0
- data/lib/fog/vsphere/requests/compute/list_datastores.rb +9 -8
- data/lib/fog/vsphere/requests/compute/modify_vm_interface.rb +9 -6
- data/lib/fog/vsphere/requests/compute/set_vm_customvalue.rb +19 -0
- data/lib/fog/xenserver.rb +2 -1
- data/lib/fog/xenserver/compute.rb +37 -1
- data/lib/fog/xenserver/models/compute/blob.rb +22 -0
- data/lib/fog/xenserver/models/compute/blobs.rb +25 -0
- data/lib/fog/xenserver/models/compute/bond.rb +23 -0
- data/lib/fog/xenserver/models/compute/bonds.rb +25 -0
- data/lib/fog/xenserver/models/compute/console.rb +3 -1
- data/lib/fog/xenserver/models/compute/crash_dump.rb +19 -0
- data/lib/fog/xenserver/models/compute/crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/dr_task.rb +17 -0
- data/lib/fog/xenserver/models/compute/dr_tasks.rb +25 -0
- data/lib/fog/xenserver/models/compute/gpu_group.rb +22 -0
- data/lib/fog/xenserver/models/compute/gpu_groups.rb +25 -0
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +2 -1
- data/lib/fog/xenserver/models/compute/host.rb +41 -8
- data/lib/fog/xenserver/models/compute/host_cpu.rb +2 -1
- data/lib/fog/xenserver/models/compute/host_crash_dump.rb +20 -0
- data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/host_patch.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/network.rb +7 -6
- data/lib/fog/xenserver/models/compute/pbd.rb +3 -1
- data/lib/fog/xenserver/models/compute/pci.rb +22 -0
- data/lib/fog/xenserver/models/compute/pcis.rb +25 -0
- data/lib/fog/xenserver/models/compute/pgpu.rb +20 -0
- data/lib/fog/xenserver/models/compute/pgpus.rb +25 -0
- data/lib/fog/xenserver/models/compute/pif.rb +19 -8
- data/lib/fog/xenserver/models/compute/pif_metrics.rb +28 -0
- data/lib/fog/xenserver/models/compute/pifs_metrics.rb +25 -0
- data/lib/fog/xenserver/models/compute/pool.rb +18 -1
- data/lib/fog/xenserver/models/compute/pool_patch.rb +24 -0
- data/lib/fog/xenserver/models/compute/pool_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/role.rb +19 -0
- data/lib/fog/xenserver/models/compute/roles.rb +25 -0
- data/lib/fog/xenserver/models/compute/server.rb +59 -26
- data/lib/fog/xenserver/models/compute/server_appliance.rb +21 -0
- data/lib/fog/xenserver/models/compute/server_appliances.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_manager.rb +28 -0
- data/lib/fog/xenserver/models/compute/storage_managers.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_repository.rb +4 -1
- data/lib/fog/xenserver/models/compute/tunnel.rb +20 -0
- data/lib/fog/xenserver/models/compute/tunnels.rb +25 -0
- data/lib/fog/xenserver/models/compute/vbd.rb +3 -2
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/vdi.rb +4 -1
- data/lib/fog/xenserver/models/compute/vif.rb +11 -2
- data/lib/fog/xenserver/models/compute/vlan.rb +2 -1
- data/lib/fog/xenserver/models/compute/vmpp.rb +35 -0
- data/lib/fog/xenserver/models/compute/vmpps.rb +25 -0
- data/lib/fog/xenserver/models/compute/vtpm.rb +18 -0
- data/lib/fog/xenserver/models/compute/vtpms.rb +25 -0
- data/lib/fog/xenserver/requests/compute/reboot_server.rb +1 -1
- data/lib/tasks/changelog_task.rb +0 -1
- data/tests/aws/models/dns/record_tests.rb +1 -2
- data/tests/aws/models/dns/records_tests.rb +2 -7
- data/tests/aws/models/dns/zone_tests.rb +1 -1
- data/tests/aws/models/dns/zones_tests.rb +1 -1
- data/tests/aws/models/elb/model_tests.rb +10 -0
- data/tests/aws/models/storage/file_tests.rb +4 -0
- data/tests/aws/requests/compute/assign_private_ip_tests.rb +52 -0
- data/tests/aws/requests/compute/vpc_tests.rb +17 -1
- data/tests/aws/requests/dns/dns_tests.rb +1 -26
- data/tests/aws/requests/elb/load_balancer_tests.rb +6 -0
- data/tests/aws/requests/rds/{subnet_groups_test.rb → subnet_groups_tests.rb} +4 -0
- data/tests/aws/requests/storage/bucket_tests.rb +17 -0
- data/tests/aws/requests/storage/delete_multiple_objects_tests.rb +12 -0
- data/tests/brightbox/compute/schema.rb +0 -13
- data/tests/brightbox/models/compute/server_tests.rb +7 -9
- data/tests/brightbox/requests/compute/interface_tests.rb +7 -19
- data/tests/digitalocean/models/compute/server_tests.rb +4 -3
- data/tests/google/models/compute/disk_tests.rb +5 -0
- data/tests/google/models/compute/disks_tests.rb +5 -0
- data/tests/google/models/compute/server_tests.rb +5 -1
- data/tests/google/models/compute/servers_tests.rb +5 -0
- data/tests/google/requests/compute/disk_tests.rb +2 -1
- data/tests/google/requests/compute/firewall_tests.rb +1 -0
- data/tests/google/requests/compute/image_tests.rb +3 -0
- data/tests/google/requests/compute/network_tests.rb +1 -0
- data/tests/google/requests/compute/operation_tests.rb +1 -0
- data/tests/google/requests/compute/server_tests.rb +2 -3
- data/tests/google/requests/compute/zone_tests.rb +1 -6
- data/tests/helpers/collection_helper.rb +10 -2
- data/tests/helpers/mock_helper.rb +4 -5
- data/tests/local/models/directories_tests.rb +17 -0
- data/tests/openstack/models/compute/security_group_tests.rb +54 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +22 -20
- data/tests/openstack/requests/network/network_tests.rb +8 -8
- data/tests/rackspace/compute_tests.rb +0 -5
- data/tests/rackspace/helper.rb +9 -4
- data/tests/rackspace/models/compute_v2/server_tests.rb +29 -1
- data/tests/rackspace/models/identity/service_catalog_tests.rb +87 -39
- data/tests/rackspace/models/queues/message_tests.rb +16 -0
- data/tests/rackspace/models/storage/file_tests.rb +29 -0
- data/tests/rackspace/requests/compute_v2/address_tests.rb +3 -1
- data/tests/rackspace/requests/compute_v2/metadata_tests.rb +4 -2
- data/tests/rackspace/requests/compute_v2/server_tests.rb +3 -6
- data/tests/vcloud_director/models/compute/media_tests.rb +18 -5
- data/tests/vcloud_director/models/compute/vapp_tests.rb +3 -1
- data/tests/vcloud_director/models/compute/vms_tests.rb +2 -1
- data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +19 -10
- data/tests/vcloud_director/requests/compute/network_tests.rb +64 -3
- data/tests/vcloud_director/requests/compute/query_tests.rb +67 -2
- data/tests/vsphere/requests/compute/set_vm_customvalue_tests.rb +21 -0
- metadata +112 -11
- data/fogkeytest1.pem +0 -27
- data/lib/fog/hp/README_HP.rdoc +0 -61
@@ -0,0 +1,446 @@
|
|
1
|
+
#Examples for working with HP Cloud Block Storage Service v13.5
|
2
|
+
|
3
|
+
HP Cloud block storage provides support for volumes and snapshots. The latest HP Cloud deployment, version 13.5, takes advantage of more OpenStack functionality and the block storage service uses slightly different commands (often noted by *v2* in the commands) than the previous 12.12 version. Verify which version of HP Cloud you are working with.
|
4
|
+
|
5
|
+
A volume can store boot images, user data or both. They provide customers with persistent and flexible permanent storage. You can think of it as list of USB devices, that can be plugged in anywhere at will. Volumes can be attached to server instances and mounted.
|
6
|
+
|
7
|
+
Snapshots are saved volume images at specific moments in time. You can take a snapshot of a volume and then use that snapshot to create a new volume.
|
8
|
+
|
9
|
+
The block storage provider has two abstractions: [a model layer](#ModelLayer) and [a request layer](#RequestLayer). Both layers are detailed below. The following code snippets can be executed from within a Ruby console (IRB):
|
10
|
+
|
11
|
+
irb
|
12
|
+
|
13
|
+
This page discusses the following tasks:
|
14
|
+
|
15
|
+
* [Connecting to the Service](#connecting-to-the-service)
|
16
|
+
|
17
|
+
**Model Layer Examples**
|
18
|
+
|
19
|
+
* [Model Volume Operations](#model-volume-operations)
|
20
|
+
* [Model Snapshot Operations](#model-snapshot-operations)
|
21
|
+
* [Model Volume Backup Operations](#model-volume-backup-operations)
|
22
|
+
|
23
|
+
**Request Layer Examples**
|
24
|
+
|
25
|
+
* [Request Volume Operations](#request-volume-operations)
|
26
|
+
* [Request Snapshot Operations](#request-snapshot-operations)
|
27
|
+
* [Volume Operations (Request Layer)](#request-volume-backup-operations)
|
28
|
+
|
29
|
+
## Connecting to the Service
|
30
|
+
|
31
|
+
To connect to the HP Cloud Block Storage Service, follow these steps:
|
32
|
+
|
33
|
+
1. Enter IRB
|
34
|
+
|
35
|
+
irb
|
36
|
+
|
37
|
+
2. Require the Fog library
|
38
|
+
|
39
|
+
require 'fog'
|
40
|
+
|
41
|
+
3. Establish a connection to the HP Cloud Block Storage service
|
42
|
+
|
43
|
+
conn = Fog::HP::BlockStorageV2.new(
|
44
|
+
:hp_access_key => "<your_ACCESS_KEY>",
|
45
|
+
:hp_secret_key => "<your_SECRET_KEY>",
|
46
|
+
:hp_auth_uri => "<IDENTITY_ENDPOINT_URL>",
|
47
|
+
:hp_tenant_id => "<your_TENANT_ID>",
|
48
|
+
:hp_avl_zone => "<your_AVAILABILITY_ZONE>",
|
49
|
+
<other optional parameters>
|
50
|
+
)
|
51
|
+
|
52
|
+
**Note**: You must use the `:hp_access_key` parameter rather than the now-deprecated `:hp_account_id` parameter you might have used in previous Ruby Fog versions.
|
53
|
+
|
54
|
+
You can find the values the access key, secret key, and other values by clicking the [`API Keys`](https://console.hpcloud.com/account/api_keys) button in the [Console Dashboard](https://console.hpcloud.com/dashboard).
|
55
|
+
|
56
|
+
## Model Volume Operations
|
57
|
+
|
58
|
+
This section discusses the volume operations you can perform using the model abstraction.
|
59
|
+
|
60
|
+
1. List all available volumes for an account:
|
61
|
+
|
62
|
+
volumes = conn.volumes
|
63
|
+
volumes.size # returns no. of volumes
|
64
|
+
# display volumes in a tabular format
|
65
|
+
volumes.table([:id, :name, :status, :created_at])
|
66
|
+
|
67
|
+
2. Obtain the details of a volume by the volume ID:
|
68
|
+
|
69
|
+
volume = conn.volumes.get("<volume_id>")
|
70
|
+
volume.name # returns name of the volume
|
71
|
+
volume.created_at # returns the date the volume was created
|
72
|
+
volume.status # returns the state of the volume e.g. available, in-use
|
73
|
+
|
74
|
+
3. List volume details using a filter:
|
75
|
+
|
76
|
+
volume = conn.volumes.all(:status => 'error')
|
77
|
+
|
78
|
+
4. Create a volume
|
79
|
+
|
80
|
+
new_volume = conn.volumes.create(
|
81
|
+
:name => "TestVolume",
|
82
|
+
:description => "My Test Volume",
|
83
|
+
:size => 1)
|
84
|
+
new_volume.id # returns the id of the volume
|
85
|
+
new_volume.name # => "TestVolume"
|
86
|
+
new_volume.status # returns the status of the volume e.g., creating, available
|
87
|
+
|
88
|
+
5. Create a new bootable volume from an suitable single-part image
|
89
|
+
|
90
|
+
new_volume = conn.volumes.create(
|
91
|
+
:name => "BootVolume",
|
92
|
+
:description => "My Boot Volume",
|
93
|
+
:image_id => 11111,
|
94
|
+
:size => 10)
|
95
|
+
new_volume.id # returns the id of the volume
|
96
|
+
**Note**: You can use a bootable volume to create a persistent server instance.
|
97
|
+
**Note**: The size of the volume you create from an image is the same as that of the image. The `:size` parameter has no effect in this case.
|
98
|
+
|
99
|
+
6. Create a volume from a volume snapshot:
|
100
|
+
|
101
|
+
new_volume = conn.volumes.create(
|
102
|
+
:name => 'VolumeFromSnapshot',
|
103
|
+
:snapshot_id => "<snapshot_id>")
|
104
|
+
**Note**: The size of the volume you create from a snapshot, is the same as that of the snapshot.
|
105
|
+
|
106
|
+
7. Create a volume from another source volume:
|
107
|
+
|
108
|
+
new_volume = conn.volumes.create(
|
109
|
+
:name => 'VolumeClone',
|
110
|
+
:source_volid => "<source_volid>")
|
111
|
+
**Note**: The size of the volume you create from a source volume, is the same as that of the source volume.
|
112
|
+
|
113
|
+
8. Attach a volume to a server:
|
114
|
+
|
115
|
+
# assuming we have a server
|
116
|
+
server.volume_attachments.create(
|
117
|
+
:server_id => server.id,
|
118
|
+
:volume_id => "<volume_id>",
|
119
|
+
:device => "/dev/sdf")
|
120
|
+
# => true
|
121
|
+
**Note**: The device parameter is the mount point on the server instance to which the volume is attached (for example, `/dev/sdf`).
|
122
|
+
|
123
|
+
9. List the attached volumes for a server:
|
124
|
+
|
125
|
+
# assuming we have a server
|
126
|
+
server.volume_attachments.all
|
127
|
+
|
128
|
+
10. Detach a volume from a server:
|
129
|
+
|
130
|
+
# assuming we have a server
|
131
|
+
att_vol = server.volume_attachments.get("<volume_id>")
|
132
|
+
att_vol.destroy
|
133
|
+
# => true
|
134
|
+
|
135
|
+
11. Update a volume:
|
136
|
+
|
137
|
+
volume = conn.volumes.get("<volume_id>")
|
138
|
+
vol.description = "from a source vol. in a diff. availability zone"
|
139
|
+
=> "from a source vol. in a diff. availability zone"
|
140
|
+
vol.save
|
141
|
+
=> true
|
142
|
+
|
143
|
+
12. Delete a volume:
|
144
|
+
|
145
|
+
volume = conn.volumes.get("<volume_id>")
|
146
|
+
volume.destroy
|
147
|
+
# => true
|
148
|
+
|
149
|
+
## Model Snapshot Operations
|
150
|
+
|
151
|
+
This section discusses the snapshot operations you can perform using the model abstraction.
|
152
|
+
|
153
|
+
1. List all available snapshots for an account:
|
154
|
+
|
155
|
+
snapshot = conn.snapshots
|
156
|
+
snapshots.size # returns no. of snapshots
|
157
|
+
# display snapshots in a tabular format
|
158
|
+
conn.snapshots.table([:id, :name, :state, :created_at])
|
159
|
+
|
160
|
+
2. List snapshots using a filter:
|
161
|
+
|
162
|
+
snapshot = conn.snapshots.all(:display_name => 'My Snapshot')
|
163
|
+
snapshot.name # returns name of the snapshot
|
164
|
+
snapshot.description # returns the description of the snapshot
|
165
|
+
snapshot.created_at # returns the date the snapshot was created
|
166
|
+
snapshot.status # returns the state of the snapshot e.g., available
|
167
|
+
|
168
|
+
3. Obtain the details of a snapshot by the ID:
|
169
|
+
|
170
|
+
snapshot = conn.snapshots.get("<snapshot_id>")
|
171
|
+
snapshot.name # returns name of the volume
|
172
|
+
snapshot.description # returns the description of the snapshot
|
173
|
+
snapshot.status # returns the state of the snapshot e.g., available
|
174
|
+
snapshot.created_at # returns the date the snapshot was created
|
175
|
+
snapshot.volume_id # returns the volume ID
|
176
|
+
|
177
|
+
4. Create a snapshot:
|
178
|
+
|
179
|
+
snapshot = conn.snapshots.create(
|
180
|
+
:volume_id => "<volume_id>",
|
181
|
+
:name => "TestSnapshot",
|
182
|
+
:description => "My Test Snapshot")
|
183
|
+
|
184
|
+
snapshot.id # returns the id of the volume
|
185
|
+
snapshot.name # => "TestVolume"
|
186
|
+
snapshot.description # returns the description of the snapshot
|
187
|
+
snapshot.status # returns the status of the volume e.g., creating, available
|
188
|
+
snapshot.created_at # returns the date the snapshot was created
|
189
|
+
snapshot.volume_id # => 1
|
190
|
+
|
191
|
+
5. Update a snapshot
|
192
|
+
|
193
|
+
snapshot = conn.snapshots.get("<snapshot_id>")
|
194
|
+
snapshot.name = "Snapshot 1"
|
195
|
+
snapshot.save
|
196
|
+
=> true
|
197
|
+
|
198
|
+
6. Delete an existing snapshot
|
199
|
+
|
200
|
+
conn.snapshots.get("<snapshot_id>").destroy
|
201
|
+
=> true
|
202
|
+
|
203
|
+
## Model Volume Backup Operations
|
204
|
+
|
205
|
+
This section discusses the volume backup operations you can perform using the model abstraction.
|
206
|
+
|
207
|
+
1. List available volume backups for an account:
|
208
|
+
|
209
|
+
conn.volume_backups
|
210
|
+
|
211
|
+
2. List details of volume backups:
|
212
|
+
|
213
|
+
conn.volume_backups.all(:details => true)
|
214
|
+
|
215
|
+
3. Obtain the details of a volume backup by ID:
|
216
|
+
|
217
|
+
volume = conn.volume_backups.get("<volume_backup_id>")
|
218
|
+
|
219
|
+
volume.name # returns the name of the volume backup
|
220
|
+
volume.status # provides the status of the volume backup e.g., available
|
221
|
+
volume.created_at # provides the date the backup was created
|
222
|
+
volume.volume_id # returns the id of the volume
|
223
|
+
volume.container # returns the container holding the backup
|
224
|
+
|
225
|
+
4. Create a volume backup:
|
226
|
+
|
227
|
+
volume = conn.volume_backups.create(
|
228
|
+
:name => "My Volume Backup",
|
229
|
+
:volume_id => "<volume_id>")
|
230
|
+
|
231
|
+
5. Restore from a volume backup into a new volume:
|
232
|
+
|
233
|
+
# restore into a new volume
|
234
|
+
backup = conn.volume_backups.get("<volume_backup_id>")
|
235
|
+
backup.restore
|
236
|
+
=> true
|
237
|
+
|
238
|
+
6. Restore from a volume backup into an existing volume:
|
239
|
+
|
240
|
+
# restore into an existing volume
|
241
|
+
backup = conn.volume_backups.get("<volume_backup_id>")
|
242
|
+
backup.restore("<existing_volume_id>")
|
243
|
+
=> true
|
244
|
+
|
245
|
+
7. Delete a volume backup:
|
246
|
+
|
247
|
+
backup = conn.volume_backups.get("<volume_backup_id>")
|
248
|
+
backup.destroy
|
249
|
+
|
250
|
+
## Request Volume Operations
|
251
|
+
|
252
|
+
This section discusses the volume operations you can perform using the request abstraction.
|
253
|
+
|
254
|
+
1. List all available volumes for an account:
|
255
|
+
|
256
|
+
response = conn.list_volumes
|
257
|
+
response.body['volumes'] # returns an array of volume hashes
|
258
|
+
response.headers # returns the headers
|
259
|
+
response.body['volumes'][0]['display_name'] # returns the name of the volume
|
260
|
+
|
261
|
+
2. List available volumes using a filter:
|
262
|
+
|
263
|
+
conn.list_volumes(:limit => 2 )
|
264
|
+
|
265
|
+
3. List volumes with details:
|
266
|
+
|
267
|
+
response = conn.list_volumes_detail
|
268
|
+
response.body['volumes'][0]['volume_image_metadata'] # returns volume image metadata
|
269
|
+
|
270
|
+
4. List volumes with details using a filter:
|
271
|
+
|
272
|
+
response = conn.list_volumes_detail(:display_name => "Test Volume")
|
273
|
+
response.body['volumes'][0]['volume_image_metadata'] # returns volume image metadata
|
274
|
+
|
275
|
+
5. Obtain the details of a volume by ID:
|
276
|
+
|
277
|
+
response = conn.get_volume_details("<volume_id>")
|
278
|
+
volume = response.body['volume']
|
279
|
+
volume['display_name'] # returns the name of the volume
|
280
|
+
volume['size'] # returns the size of the volume
|
281
|
+
volume['status'] # returns the status of the volume e.g. available, in-use
|
282
|
+
|
283
|
+
6. Create a volume:
|
284
|
+
|
285
|
+
response = conn.create_volume('display_name' => 'Test Volume', 'size' => 10)
|
286
|
+
volume = response.body['volume']
|
287
|
+
volume['id'] # returns the id of the new volume
|
288
|
+
volume['display_name'] # => "demo-vol"
|
289
|
+
volume['size'] # => 10
|
290
|
+
volume['status'] # returns the status of the volume e.g. creating, available
|
291
|
+
|
292
|
+
7. Create a new volume from an existing image:
|
293
|
+
|
294
|
+
conn.create_volume('display_name' => 'Test Volume 1',
|
295
|
+
'display_description' => 'Test Volume from image',
|
296
|
+
'size' => 10,
|
297
|
+
'imageRef' => "<image_id>")
|
298
|
+
|
299
|
+
8. Create a new volume from an existing snapshot:
|
300
|
+
|
301
|
+
response = conn.create_volume(
|
302
|
+
'display_name' => 'Test Volume 2',
|
303
|
+
'display_description' => 'New Volume from Snapshot',
|
304
|
+
'snapshot_id' => "<snapshot_id>")
|
305
|
+
volume = response.body['volume']
|
306
|
+
|
307
|
+
volume['id'] # returns the id of the new volume
|
308
|
+
volume['display_name'] # => "Test Volume 2"
|
309
|
+
volume['size'] # => 1
|
310
|
+
volume['snapshot_id'] # => 1
|
311
|
+
volume['status'] # returns the status of the volume e.g. creating, available
|
312
|
+
**Note**: The size of the volume you create from a snapshot is the same as that of the snapshot. The third parameter (the size) has no effect in this case.
|
313
|
+
|
314
|
+
9. Create a new volume from an existing volume:
|
315
|
+
|
316
|
+
conn.create_volume(
|
317
|
+
'display_name' => 'Test Volume 3',
|
318
|
+
'display_description' => 'Test volume from another image',
|
319
|
+
'source_volid' => "<source_volid>")
|
320
|
+
|
321
|
+
10. Create a new bootable volume from an suitable single-part image:
|
322
|
+
|
323
|
+
conn.create_volume(
|
324
|
+
'display_name' => "TestBootVol",
|
325
|
+
'display_description' => "My Test Boot Volume",
|
326
|
+
'size' => 10,
|
327
|
+
'imageRef' => "<bootable_image_id>")
|
328
|
+
**Note**: You can use a bootable volume to create a persistent server instance.
|
329
|
+
|
330
|
+
11. Attach an existing volume to an existing server:
|
331
|
+
|
332
|
+
response = conn.attach_volume("<server_id>", "<volume_id>", "/dev/sdf")
|
333
|
+
volume_attachment = response.body['volumeAttachment']
|
334
|
+
volume_attachment['id'] # returns the id of the volume
|
335
|
+
volume_attachment['volumeId'] # returns the id of the volume
|
336
|
+
volume_attachment['serverId'] # returns the id of the server
|
337
|
+
volume_attachment['device'] # returns the device of the volume
|
338
|
+
**Note**: The device parameter is the mount point on the server instance to which the volume is attached (for example, `/dev/sdf`)
|
339
|
+
|
340
|
+
12. List volumes attached to a server:
|
341
|
+
|
342
|
+
response = conn.list_server_volumes("<server_id>")
|
343
|
+
volume_attachments = response.body['volumeAttachments']
|
344
|
+
volume_attachment[0]['id'] # returns the id of the volume
|
345
|
+
volume_attachment[0]['volumeId'] # returns the id of the volume
|
346
|
+
volume_attachment[0]['serverId'] # returns the id of the volume
|
347
|
+
volume_attachment[0]['device'] # returns the device of the volume
|
348
|
+
|
349
|
+
13. Detach an existing volume from a server:
|
350
|
+
|
351
|
+
conn.detach_volume("<server_id>", "<volume_id>")
|
352
|
+
|
353
|
+
14. Update a volume:
|
354
|
+
|
355
|
+
conn.update_volume("<volume_id>",
|
356
|
+
{'display_name' => 'Test Volume Update'})
|
357
|
+
|
358
|
+
15. Delete an existing volume:
|
359
|
+
|
360
|
+
conn.delete_volume("<volume_id>")
|
361
|
+
|
362
|
+
## Request Snapshot Operations
|
363
|
+
|
364
|
+
This section discusses the snapshot operations you can perform using the request abstraction.
|
365
|
+
|
366
|
+
1. List all available snapshots for an account:
|
367
|
+
|
368
|
+
response = conn.list_snapshots
|
369
|
+
response.body['snapshots'] # returns an array of snapshot hashes
|
370
|
+
response.headers # returns the headers
|
371
|
+
response.body['snapshots'][0]['display_name'] # returns the name of the snapshot
|
372
|
+
response.body['snapshots'][0]['size'] # returns the size of the snapshot
|
373
|
+
response.body['snapshots'][0]['volume_id'] # returns the volume id of the snapshot
|
374
|
+
|
375
|
+
2. List the details of all snapshots:
|
376
|
+
|
377
|
+
conn.list_snapshots_detail
|
378
|
+
|
379
|
+
3. List the details of a snapshot using a filter:
|
380
|
+
|
381
|
+
conn.list_snapshots_detail(:limit => 2)
|
382
|
+
|
383
|
+
4. Obtain the details of a snapshot by ID:
|
384
|
+
|
385
|
+
response = conn.get_snapshot_details("<snapshot_id>")
|
386
|
+
snapshot = response.body['snapshot']
|
387
|
+
snapshot['display_name'] # returns the name of the snapshot
|
388
|
+
snapshot['size'] # returns the size of the snapshot
|
389
|
+
snapshot['volume_id'] # returns the volume id of the snapshot
|
390
|
+
snapshot['status'] # returns the status of the snapshot e.g. available, in-use
|
391
|
+
|
392
|
+
5. Create a new snapshot:
|
393
|
+
|
394
|
+
response = conn.create_snapshot("<volume_id>",
|
395
|
+
'display_name' => 'Test Snapshot',
|
396
|
+
'display_description' => 'Test Snapshot from Vol Test')
|
397
|
+
snapshot = response.body['snapshot']
|
398
|
+
snapshot['id'] # returns the id of the new volume
|
399
|
+
snapshot['display_name'] # => "demo-vol"
|
400
|
+
snapshot['size'] # => 1
|
401
|
+
snapshot['volume_id'] # returns the volume id of the snapshot
|
402
|
+
snapshot['status'] # returns the status of the snapshot e.g. creating, available
|
403
|
+
|
404
|
+
6. Update a snapshot:
|
405
|
+
|
406
|
+
conn.update_snapshot("<snapshot_id>", 'display_name' => "Test Snapshot 1 Update")
|
407
|
+
|
408
|
+
7. Delete a snapshot:
|
409
|
+
|
410
|
+
conn.delete_snapshot("<snapshot_id>")
|
411
|
+
|
412
|
+
## Request Volume Backup Operations
|
413
|
+
|
414
|
+
This section discusses the volume backup operations you can perform using the request abstraction.
|
415
|
+
|
416
|
+
1. List all available volume backups for an account:
|
417
|
+
|
418
|
+
conn.list_volume_backups
|
419
|
+
|
420
|
+
2. List details of all available volume backups:
|
421
|
+
|
422
|
+
conn.list_volume_backups_detail
|
423
|
+
|
424
|
+
3. Obtain the details of a volume backup by ID:
|
425
|
+
|
426
|
+
conn.get_volume_backup_details("<volume_backup_id>")
|
427
|
+
|
428
|
+
4. Create a volume backup:
|
429
|
+
|
430
|
+
conn.create_volume_backup("<volume_id>")
|
431
|
+
|
432
|
+
5. Restore into a new volume using a volume backup:
|
433
|
+
|
434
|
+
conn.restore_volume_backup("<volume_backup_id>")
|
435
|
+
# creates a new volume that is a clone of the volume the backup was created from
|
436
|
+
|
437
|
+
6. Restore into an existing volume using a volume backup:
|
438
|
+
|
439
|
+
conn.restore_volume_backup("<volume_backup_id>", "<existing_volume_id>")
|
440
|
+
|
441
|
+
7. Delete a volume backup:
|
442
|
+
|
443
|
+
conn.delete_volume_backup("<volume_backup_id>")
|
444
|
+
|
445
|
+
---------
|
446
|
+
[Documentation Home](https://github.com/fog/fog/blob/master/lib/fog/hp/README.md) | [Examples](https://github.com/fog/fog/blob/master/lib/fog/hp/examples/getting_started_examples.md)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Examples for working with HP Cloud CDN Service
|
2
|
+
|
3
|
+
The HP Cloud services provides CDN support via the request layer abstraction. In the request abstraction, you can CDN-enable a container, get a list of the CDN-enabled containers, list the metadata for a CDN-enabled container, update the metadata for a CDN-enabled container, and CDN-disable a container.
|
4
|
+
|
5
|
+
The examples on this page can be executed from within a Ruby console (IRB):
|
6
|
+
|
7
|
+
irb
|
8
|
+
|
9
|
+
* [Connecting to the Service](https://github.com/fog/fog/blob/master/lib/fog/hp/docs/connect.md)
|
10
|
+
|
11
|
+
|
12
|
+
## CDN-Enabling an Existing Container
|
13
|
+
|
14
|
+
To CDN-enable an existing container:
|
15
|
+
|
16
|
+
conn.put_container("fog-rocks")
|
17
|
+
|
18
|
+
## Listing CDN-Enabled Containers
|
19
|
+
|
20
|
+
To generate a list of CDN-enabled containers:
|
21
|
+
|
22
|
+
conn.get_containers
|
23
|
+
|
24
|
+
## Listing the Metadata for a CDN-Enabled Container
|
25
|
+
|
26
|
+
To list the metadata (or header information) for a CDN-enabled container:
|
27
|
+
|
28
|
+
conn.head_container("fog-rocks")
|
29
|
+
|
30
|
+
## Updating the Metadata for a CDN-Enabled Container
|
31
|
+
|
32
|
+
To update or modify the metadata for a CDN-enabled container, use the command
|
33
|
+
|
34
|
+
> conn.post_container("fog-rocks", {**option**})
|
35
|
+
|
36
|
+
Where _option_ can be any of the following:
|
37
|
+
|
38
|
+
* X-CDN-Enabled <Boolean> - cdn status for container
|
39
|
+
* X-CDN-URI <String> - cdn url for this container
|
40
|
+
* 'X-TTL'<~String> - integer seconds before data expires, defaults to 86400 (1 day), in 900 (15 min.) to 1577836800 (50 years)
|
41
|
+
* X-Log-Retention <Boolean>
|
42
|
+
|
43
|
+
So for example, if you want to modify the X-TTL metadata information so that the value becomes 3600, the command would be:
|
44
|
+
|
45
|
+
conn.post_container("fog-rocks", {'X-Ttl' => 3600 })
|
46
|
+
|
47
|
+
## Disabling a CDN Container
|
48
|
+
|
49
|
+
To CDN-disable container:
|
50
|
+
|
51
|
+
conn.delete_container("fog-rocks")
|
52
|
+
|
53
|
+
---------
|
54
|
+
[Documentation Home](https://github.com/fog/fog/blob/master/lib/fog/hp/README.md) | [Examples](https://github.com/fog/fog/blob/master/lib/fog/hp/examples/getting_started_examples.md)
|